A while ago, I had to put
filetype plugin on
in my .vimrc for a plugin I use.
But this caused a change in autoindent: Whenever I write a comment “//”, and then press enter, vim autoindentation automatically enters another “//” in the next line.
// This is a comment. <ENTER>
// <-- vim automatically puts '// ' there
What can I do to avoid this?
I use the autoindent setting in my vim file.
I already tried
filetype plugin indent off
but it does not work.
Take a look at
:h formatoptionsand:h fo-table. The options you need to turn off arerando. Turning them off prevents vim from automatically inserting the comment leader (in this case “//”) when you press enter in insert mode or when you pressoorOin normal mode.