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?
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.