DPHenderson

A Monologue with the Æther

MacVim

vim, sweet, vim

MacVim, at its core vim, is a multi-modal text editor. A text editor is the one truly indispensable tool that every programmer has. Vim like any text editor worth the name is highly customizable allowing the programmer to write code without a lot of writing. I’ve heard it said about vim that if you spend all your time in insert mode then your doing it wrong. That’s generally true unless you’re actually writing instead of coding.

I began using vim, gvim, and MacVim fairly heavily starting in 2008. Vim is the command line tool; gvim is the GUI wrapper for vim on most Unix, Linux, and BSD based operating systems, Mac OS X being the exception in that it uses a very different windowing GUI paradigm than the other BSDs; MacVim is the GUI wrapper for Mac OS X.

Earlier, I stated without explanation that (Mac)Vim is a multi-modal text editor. Vim has different modes of operation; the four primary modes are normal, insert, command, and replace. Normal mode is normal because that is where most of the heavy lifting is done in vim. It is where most of the editing occurs. Insert mode should be self-explanatory but for the sake of completeness; it would be the mode where what you type appears as strings of characters on the screen. Command mode allows you to execute commands including built-in functions and shell commands (aka command line). Triggering replacement mode causes an overwrite behavior where the character under the cursor is replaced by whichever character is typed. There are many other modes; the only other mode that I use heavily is visual mode which has three variants: character, line, and block. Visual mode is a visual highlight selection mode. Visual character mode should be fairly self-explanatory: highlight character-by-character. Visual line mode selects by line. Visual block is the most interesting and often the visual mode I use. A visual block selection is a column-wise selection.

Vim like most text editors that are worth a damn is not for the faint-of-heart nor the dilettante. If all you need to do is type characters into a file, there are much easier methods, but if you need the ability to make characters in a file bend to your will, then you could do worse than vim.