Recipes: Vim configuration
依乎天理,批大郤,道大窾,因其固然

I use Vim (i.e. Vi Improved) as my usual editor. I've been using it since I first started using linux about 7 years ago (it was a concious choice not to use Emacs, mostly because I wasn't coding and wanted to be "different" from my friends who were doing computer science). My habit has always been pure vim, none of the Gtk+ nonsense with X mouse capture and such.

Unfortunately, after 6 or 7 years, I am still not a power-user. Without a copy of my vim cheat-sheet, I can only open a file, hit 'i' to enter insert mode, edit the file, use the visual mode for copy-cut-past (or, in vimspeak, yank-delete-put), do simple searches and replacements, and save the file. Most of the advanced operations are beyond me.

A few months ago (mark it February of 2008) I started doing a little bit of coding, and discovered the usefulness of split windows and folds in vim. (The former is particularly useful since I often run my laptop without X and the console display is 160x50, so split-view gives two nice columns.)

After exploring for a bit, I figure that I might try to fix-up my vim using habits to make myself more productive when I do something that I do a lot of: writing papers and lecture notes in LaTeX. While I do know about Vim-latex, I find it too big and complicated, and furthermore, as I hit my quarter-century mark, I find myself too old to remember all the key mappings. It would be, of course, easier to remember mappings that I defined myself. So I wrote down some custom mappings and stuck them in my vimrc.

Here is the file. I stick it in ~/.vim/custom/ and insert the line

runtime custom/latexcustom.vim
in my ~/.vimrc. (I don't bother to do a switch on BufRead since over 90% of the files I edit are LaTeX files and I don't have any other key-mappings defined that might be confusing.)

A quick anatomy of the file

More improvements will be added as I go along.

Back to front page