Love

I have enjoyed moving to an open-source development stack. I use Ruby and Ruby-On-Rails on a daily basis. I love writing golang code. I am intimately familiar with Postgresql, Elasticsearch, and Redis. I can read a man page and know what I’m looking at. I have written a 4-line bash script that helps me fill out my timesheets by reading all of my git commits and arranging them in chronological order.

In short, I love working in Linux. I love bending computers to my will. I love creating things that people use to make their lives easier.

Magic

I do all this with text. The files I write are compiled or interpreted by the computer and turned into action. It’s like designing and building a machine in the air that you can’t really see, but you know is there by its effects. Writing code is like weaving a magic spell. It’s like invoking the arcane language to create something that wasn’t there before. It’s exhilarating when the elements come together and the pieces fit and the solution to the problem you want to solve falls out in front of you because you picked the right abstraction.

Tools

The editor I use (vim) was invented in the 1976 and IMproved in 1991. I am writing what you see here using it. What I write is interpreted by Jekyll and Markdown (two other open source projects that simplify creating static sites like this one).

my editor - how meta

Vim is “highly configurable”, read “highly configurable if you know what the hell you’re doing and are not afraid”. nerd humor alert: “There are two types of people in the world: Those who know vimscript, and those who aren’t Tim Pope.”

As great and wonderful as my editor is, and despite the fact that I have learned to use plugins to extend it, and make modifications to it on startup that make my editor my own, there are some things I was missing from my days as a .NET developer using Visual Studio. Tab-completion for known properties of objects I’m dealing with, and snippets that allow me to quickly create boilerplate code that I write all the time. Stuff that’s necessary, but I don’t even have to think about. It’s the meter in which I have to rhyme.

The problem is that the package that my OS comes with for Vim is outdated, meaning I have an older version of it. There are plugins for Vim like YouCompleteMe (for tab-completion) and Ultisnips (for that boilerplate code) that I could use if only my version of Vim were up to date.

Making the Tools Better

Step 1: Install the new version of Vim

In order to get back some of the things I miss, I need to install the latest version of vim so I can install the plugins I want. Luckily, YouCompleteMe had instructions for installing the latest version of vim. Follow the instructions on that page to complete your new installation.

Step 2: Install Plugins

I want to use YouCompleteMe and Ultisnips. With a little configuration, and a third plugin called Supertab, they go together like chocolate and peanut butter. A quick reminder - read the installation docs for YouCompleteMe. It’s a compiled component, so you’ll have to compile it before you can use it. You’ll probably also want to install the default snippets for Ultisnips and make them all work together with this bit of vimscript in your .vimrc:

" make YCM compatible with UltiSnips (using supertab)
let g:ycm_key_list_select_completion = ['<C-n>', '<Down>']
let g:ycm_key_list_previous_completion = ['<C-p>', '<Up>']
let g:SuperTabDefaultCompletionType = '<C-n>'

" better key bindings for UltiSnipsExpandTrigger
let g:UltiSnipsExpandTrigger = "<tab>"
let g:UltiSnipsJumpForwardTrigger = "<tab>"
let g:UltiSnipsJumpBackwardTrigger = "<s-tab>"

Step 3: Profit

Once you’ve followed the steps above, you should be up and running with tab-completion and, voila! Happy Vimming!


comments powered by Disqus