Durham, North Carolina
My Vim config is somewhere in the middle ground between minimalist and power user. It currently sits at around 300 lines with the first 100 being dedicated to plugins (don’t worry, its heavily commented, I don’t have 100 plugins), the next 100 or so lines on general configuration, and the last 100 on plugin configuration. I’m using Vundle for managing the plugins and I’m quite pleased with it. I’ve heard that Neobundle is also great, but until I have an issue with Vundle I see no reason to switch. Having a good plugin manager is important, having the current best, not so much.
I divide my plugins up into 4 categories: Indispensible, Use Sometimes, Experimenting, and Not Using. By far my most important plugins are ctrlp, ack.vim and the vim-tmux-navigator. Vim’s built in file management is, if not broken, at least wildly inconvenient compared to competing editors like Sublime Text. Typing in paths is great if you’re working on a small project, but for larger projects with deep paths it’s important to be able to use a mixture of strategy including fuzzy finding and content searches. I wrote a piece last fall detailing in depth how I use ctrlp and ack.vim along with NerdTree and built-in methods to manage my files.
The other plugins I’d want to highlight in Indispensible and Use Sometimes are YouCompleteMe and UltiSnips. YCM is a great tool for syntax completion that works with a variety of different sources. UltiSnips is a snippets library for Vim that is really nice to use. I hate that every snippets library seems to have their own syntax, so stuff like this can never be reused across editors or environments, but otherwise there’s very little to complain about with UltiSnips.
Beyond plugins, my config isn’t super exciting. Much of it unfortunately is dedicated to making Vim behave like a modern computer program, assuring it that it’s not 1990 anymore and we have the system resources to provide crazy luxuries like line numbers and background files. I try to stick close to baseline Vim behavior as much as is reasonable. I keep leader mapped to
\\. I know many people prefer to remap it to
,, but I use comma all the time for its built-in function of moving backwards when searching for a character in a line. I recently saw an article suggesting to map the space key to leader and I may consider trying that. I use the vim-pencil plugin to use different wrapping rules and motions when writing text than I use for code.
You can see a snapshot of the full config from the time of this interview in this gist. To see the latest, you can look in my dotfiles repo.
By far the most useful resource for me was Practical Vim by Drew Neil. It’s a great read for understanding the philosophy behind Vim, and slowly building up your skills. I’m about due for a re-read actually. Drew’s screencasts at Vimcasts are also great, though I personally always prefer text to video. I also learned a lot from looking at other peoples configs. My vimrc was originally based on Wynn Netherland’s vimrc, though both have diverged considerably now. I also learned a lot from reading the recommended configuration from Janus a “vim bootstrap” project. I don’t recommend taking a heavyweight config like that to start, I think its better to build up your own, but projects like that are great inspiration for what is possible.
I actually can say without shame that I’ve never written any Vimscript beyond the very simple stuff used in the Vimrc config. I prefer to invest my time in projects and tasks that have as much long term value as possible. Since Vimscript is limited to just Vim, and Vim has such a great ability to work with command line tools and scripts, I prefer to write scripts to find or manipulate files on the command line level, and then call them from Vim if needed. The fact that Vimscript is not a greatly loved language helps make this easier.
I’m currently working on a library to define “projects” on the command line, groups of files that you can then search in list or pick from using command line tools. I’ll be excited to use that with Vim, but since its written as a command line tool in Python, the great thing about it is that it ends up being editor agnostic, at least for most use cases.
I spend a large chunk of my days in Vim, between writing code and writing posts for my blog. I’m in more meetings at work these days, so it may not be quite as much as it used to be, but Vim is definitely constantly open. In addition to the project I mentioned above and work, I’m working on starting a new series about jQuery on my blog.