Vim automatically continues a comment when I press Enter in Insert mode, which I find helpful.
However, I do not want the comment continued after pressing 'o' from normal mode to insert a new line below the end of the comment.
I read that I need to remove the option o
from my formatoptions
, so I put this line right at the end of my vimrc file:
set formatoptions-=o
But it has changed nothing, and when I execute :set formatoptions
from iside of vim it shows me my formatoptions are croql
.
How do I get rid of the 'o'?
Edit:
I've followed some steps pointed out in the comments by Sato Katsura:
The solution starts with running
:verb set fo
to see where formatoptions was last modified.
Here's the output to verb set fo
:
formatoptions=croql
Last set from /usr/share/vim/vim73/ftplugin/vim.vim
.vimrc
, so we can't help at all until you post it. I'm guessing a plugin changes it, or it isn't being source correctly.set formatoptions-=o
in my vimrc work?", that this disables comments when pressingo
is coincidental :-)