Committing to a better editor
Yeah, I use vim. You know, for those trivial edits or during remote sessions. Nevermore! I finally got tired of selling myself short. This past weekend I committed myself to use vim (mostly gvim) for any and all of my daily coding. This is something that was long overdue, and after getting real friendly with vim this weekend, I wish I would have done it much sooner. …
Once I got comfortable with the basics by going through vimtutor, I started configuring my .vimrc file with some convenient mappings. I have a habit of pressing Crtl-S constantly while coding, so I mapped that in vim to save by putting this in my .vimrc file:
map <C-S> <Esc>:w<CR>
map! <C-S> <Esc>:w<CR>
Sweet! I then googled around a bit and picked out additional scripts and mappings that looked useful (most of them found on Vim Tip Wiki.) My .vimrc file is here.
Then it was on to plugins. This blog post by Jamis had a bunch of useful tips. I don’t even need a project browser pane thanks to FuzzyFinderTextMate. I just launch gvim from the root of my project (I made a little convenience script to make this even easier) and every file is a few keystrokes away. I should note I used vim 7’s new graphical tab feature the first day, but soon found buffers to be quicker and more capable/compatible with plugins, though tabs were a good way to ease into things.
I also love the snippetEmu plugin (the snippets for JavaScript were severly lacking, so I added some.)
I put my whole configuration directory including my .vimrc file on github so I can pull it down into whatever work environment I’m in. Feel free to peruse.
If you are still using Notepad++, Gedit, or some other not-bad-but-not-terribly-awesome editor, commit to something better! That is, if you really are serious about this. This is serious business, darn it!
Yeah, I know, it’s awkward. Similar to learning Linux/git/anything worthwhile, it can be awkward at first, but the payoffs can be astronomical. That was the case for me after installing Ubuntu about, eh, two years ago. If I’ve gained this much from vim in just a weekend, I can’t imagine how my work flow will be in two years.
Times are tough, invest in your future!