I added this line to my .vimrc: set formatoptions-=ro. When I open any file it works as intended, except if it is .vimrc. In that case it doesn't work. Why does this happen and how to fix it?

1 Answer 1


The FileType plugin for vim files sets the format options. It contains the following line:

setlocal fo-=t fo+=croql

If you want to overwrite this, create the file .vim/after/ftplugin/vim.vim and add your personal formatoptions to it.

When Vim loads the .vimrc it will first load the global vim.vim FileType plugin and then load .vim/after/ftplugin/vim.vim. So you can overwrite any settings from there.

See :help after-directory.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.