Vim Stuff

I get a lot of hits to my blog from people looking for Vim resources, probably due to Vim for TextMate fans. I think Vim might be getting a resurgence from developers using Linux on netbooks and the refreshing speed and efficiency of Vim.

Here are some of my recent discoveries and tips for Vim.

Macvim

Macvim is works really well for me: it retains Mac–friendly keyboard shortcuts. I use gvim in Linux which is good, but macvim seems to get the blend of native and vim–like behavior just right.

Sysadmin

I always forget to sudo when editing config files on servers, but :w !sudo tee % totally solved that. Kev found that tip on commandlinefu

Projects

I like using NERDTree for navigating around projects. I set it to map–leader x:

map <leader>x :NERDTree<CR>

Ack

I search through files all the time rather than hunting for them. I used this plugin to call Ack: Ack and Vim integration

Then I map it to map–leader a:

map <leader>a :Ack

Rails

I’ve got used to using rails.vim. .Rake over a test method is incredibly handy, and Rserver! makes switching between projects easier (it starts a server for the current project, killing any existing servers).

When I work on Rails projects I always seem to split the screen between a model or controller and their tests. Controllers and views is common too. If you’re not quite used to working with Vim yet, try learning the keyboard shortcuts for window management so you can creatively split and manage windows.

Cappuccino

I’ve been developing interfaces with Cappuccino lately, and I found that using Vim with their syntax highlighting works better with spell checking turned off:

au BufNewFile,BufRead *.j setf objj
au BufNewFile,BufRead *.j set nospell
blog comments powered by Disqus