How to disable that pesky auto-comment in vim

Been using a newer release of vim and dislike how, after you type a comment on a line, vim assumes you want the next line commented also? Or, more frustrating, have you pasted something you copied from another file or from the web, only to find vim helpfully commented and indented a bunch of lines? Here’s a quick fix. Place it in your vimrc:

autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o


You may also like...