Let's JAM!

More Vim Helps

Ahhhh Vim. Where would I be without thee?


Here are a few more things which I have found useful to have in my ~/.vimrc as of late:



set number

set relativenumber


These commands add line numbers, but not in the typical way. Rather than showing how many lines from the top, it instead shows me how many lines from my current line it is. See here:



set undofile


This line has vim create a file with a .un extension. This file contains a revision history, allowing Vim to have "Undo/Redo" functionality after page reloads, etc.


nnoremap / /\v

vnoremap / /\v

 And these are some amazingly helpful lines. Vim, for some unknown reason, makes it a total pain in the butt to use regular Perl style regexes in your searches. This makes all searches behave as a Perl style regex [i.e., /(foo|bar)/ rather than /\(foo\|bar\)/]. Horaah for Vim's awesome customizability! :-D