Reputation: 11194
My system has some default vim settings that make no sense to use on programming language files. I'd like to change my formatoptions
setting for any buffer with a programming language filetype.
I had been adding an autocmd
to my .vimrc for each file extension:
au FileType python,c,cpp,java setlocal formatoptions=crql
But it's getting annoying to maintain this list. How can I configure settings for all programming language filetypes (c
, cpp
, python
, java
...) and possibly all structured syntaxes (xml
, yaml
, cfg
, diff
...), but not for miscellaneous filetypes like gitcommit
and no filetype? Do I need to maintain my own blacklist?
Upvotes: 1
Views: 1220
Reputation: 5240
You might be better off turning on for everything, then selectively turning them off for the filetype's where it's a problem.
Upvotes: 2