Automatic Comment Prefixing

For a long time, I hated the fact that if I had something like this in Vim:

// foo{C}

Where {C} is the cursor, and hit o onto the next line, Vim would insert the comment bit for me:

// foo
// {C}

More often than not, I didn’t actually want that. Thankfully, as with a lot of my Vim problems, the dotfiles of Ben Orenstein came to my rescue with this line:

set formatoptions-=or

This stops Vim continuing the comment automatically.

As an aside, it seems like a good time to mention that my dotfiles are on Github also if you, like me, like trawling through other’s dotfiles for gems.

comments powered by Disqus… Click Here