MacVim FTW
9/09/2008

While I've always been a fan of Xcode... peers in the office have turned me onto an excellent port of gvim for OS X known as MacVim:

http://code.google.com/p/macvim/



While there are a million configuration options out there, here are a few I'm running with:

syntax on
set background=dark
set softtabstop=2
set tabstop=4
set shiftwidth=2
set expandtab
set autoindent

Basically those options enable dark background w/ syntax and 2 space softtabs. (and 4 spaces for existing tabs).

if has("gui_running")
colorscheme koehler
set columns=90 lines=65
set transparency=8
endif

For running gui (i.e. macvim) use the dark color theme 'koehler' and give some initial window dimensions. Since I'm a big fan of 80 col code, and vim really doesn't have a good way of displaying that (fail) I use a 90 col window. Also the |transparency| option is a MacVim only option for that gives the window 92% opacity.

set guifont=Monaco:h10
set guioptions=egmrLt
set enc=utf-8
hi LineNr guifg=#333333

These options are enable Monaco 10pt (aliased) and the |guioptions| passes in some flags to always open a window with the toolbar collapsed. The |hi LineNr| is to override the color themes line numbers foreground. The default for koehler is a bright yellow line number foreground, and I like my line numbers to be non-distracting.

:nmap :set invnumber

And finally, this option simply maps double typing control-n while in normal mode (i.e. not insert or visual mode) to show/hide line numbers. Very handy if you don't want to always see line numbers when the file opens.

Anyways, thought I'd pass on this good find.



The old archives are here.