Over the last couple of years, most of us here have settled on a shared base vim config. I originally assembled this config after leaving vim for TextMate for a while, only to return wanting the best of both worlds. This isn’t exactly an original endeavor, but the result is a little different from other vim setups.
Atomic Vim has a few ideas that (not entirely consistently) direct its approach:
- graceful degradation across vim versions/capabilities
- easy to set up dependencies (primary features depend only on ruby and ctags)
- fully functional in a terminal – I don’t want to feel hamstrung over SSH
- project/directory oriented – like TextMate
- customizable on a project-by-project basis – particularly files indexed for fuzzy navigation and directories ignored from navigation and search
- tries not to override existing vim shortcuts (at least, moreso than our previous shared vim config; surround.vim is included and is a notable exception)
- tries not to add shortcuts for things that can be done just as easily with standard vim shortcuts (@
v@ for vsplit is an exception, but I normally use @ v@ out of habit)
Clone into @~/.vim@
source ~/.vim/common-vimrc.vim to your @.vimrc@.
brew install ctags to get exuberant ctags. I’ve mainly used the config under cygwin on windows, but gvim works pretty well (I’ve never tried setting up ctags and ruby for use in gvim on windows).
If your working directory contains a @.vim@ file, this is sourced automatically. We mainly use this file to add directories to
Uses fuzzyfinder for file completion. Out of the box fuzzyfinder doesn’t offer textmate-style navigation. It does offer a mode to fuzzily match filenames in your tags file however. Since having an up to date tags file has other benefits, we opted to post-process the tags file and add fake entries for files of interest in which ctags didn’t find anything to tag.
Any file with an extension in
g:taggable_extensions is guaranteed to get a
tags file entry, though any file in one of the
g:vim_ignore directories will be pruned. This tweak to standard ctags behavior makes all the difference.
Ack.vim is included. @
It’s pretty easy to extend the ruby scripts, but this is an area that can use improvement.
- abolish – use @:S@ to replace as you would @:s@
but it handles case variations for you automatically (and more).
- fugitive – awesome git support
- surround – modify things like quotes and parens
- align – align code easily, such as forcing all equal signs in a series of assignments to be in a column
- snipmate – TextMate-like snippets.
- conqueterm – embed a terminal in vim (thanks janus)
To make it easy for each of us to customize the configuration and port our config between machines, we’ve each tweaked a few things in files like
colthorp-vimrc.vim which we source after