Closed chalbin73 closed 3 months ago
Ok so i manually checked the filetype with :lua vim.bo[<bufnr>].filetype
, and according to vim, an h file is of the 'cpp' file type. So enabling the formatter for this filetype worked. So now it works.
Maybe this could be something to add to the documentation somewhere ?
Because I thought formatters_by_ft
would match with the actual filename itself, I did not know that vim had an internal filetype.
I just saw that there was an option in Neovim to detect .h header files as C files, just set :
vim.g.c_syntax_for_h = 1
somewhere in your config and the file type of .h files will be C.
I don't want to replicate the entirety of the vim help docs in this project, so I have to draw the line somewhere. For that reason, I do assume some familiarity with basic vim concepts such as the filetype. I am happy to answer these questions when they come in, though. Glad you figured it out!
Neovim version (nvim -v)
NVIM v0.9.5
Operating system/version
Linux 6.8.4-zen
Add the debug logs
log_level = vim.log.levels.DEBUG
and pasted the log contents below.Log file
Describe the bug
The 'uncrustify' formatter requested for C, is not run on the header files (.h), even though it works perfectly on the .c files.
What is the severity of this bug?
minor (annoyance)
Steps To Reproduce
Setup conform with :
Additional context
No response