Question

I have found via :verbose set fo that

formatoptions=a1njwcroql
  Last set from /usr/local/share/vim/vim74/ftplugin/vim.vim

This is helpful but I obviously can't touch that file.

So, rather than using the unsavory hammer autocmd, I am to do something in ~/.vim/after/ftplugin/ as noted here.

However I want my adjustment to apply across all filetypes unless I specify otherwise. There is no way in hell I'm going to generate one ~/.vim/after/ftplugin/*.vim for each language and maintain that, that is far worse than the autocmd.

So hopefully there is something really basic I am missing that I can use to override Vim's default ftplugin overrides, namely, where I can run :set fo-=r where it will actually do something, because doing it in the ~/.vimrc does not work (the Vim default ftplugin overrides it (inconsistently between languages, I might add).

To clarify:

  1. My vimrc sets formatoptions to a reasonable default that I decided upon ahead of time, this happens to be caq1njw
  2. Vim decides for whatever historical or other reason that e.g. for the Vim filetype what we want is setlocal fo-=t fo+=croql in $VIMRUNTIME/ftplugin/vim.vim
  3. I am now wanting to override $VIMRUNTIME/ftplugin/vim.vim's override further, with the statement setlocal fo-=r (not using an autocmd, I know how to do that).

No correct solution

OTHER TIPS

Here's the basic autocmd I'm using now, that will have to suffice if there isn't a "right way":

au BufEnter * setlocal fo-=r

Seems to work well enough.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top