1

I want prevent Vim from following behavior: if I'm editing source code file and type a comment in Vim and press Enter or O, it will automatically start the next line with //, so it looks like this:

// this is a comment
//

These commands: :set formatoptions-=r, :set formatoptions-=o help, but only when I run them in Vim, but when i put this line set formatoptions-=or to the end of my vimrc file and restart Vim nothing happens so I need run them manually from editor every time I open new file.

Why addition of aforementioned line to the vimrc file has no effect?

Thomas Baruchel
  • 7,236
  • 2
  • 27
  • 46
Alexander
  • 257
  • 1
  • 3
  • 11
  • 3
    http://stackoverflow.com/q/19461862 – glts Nov 28 '15 at 12:22
  • 1
    Read the link glts put in as a comment Alexander, but you are probably bumping into a setlocal fo=... in one or more autoloaded FileType plugins. Each filetype usually sets a default formatoptions, so you may have to track through ftplugin, either under ~/.vim/ftplugin or in the system files (here as /usr/share/vim/vim74/ftplugin, but that will change by OS and release). – Brian Tiffin Nov 28 '15 at 14:56

0 Answers0