• +43 660 1453541
  • contact@germaniumhq.com

Vim Ultimate Editing: Version Your Vim Configuration


Vim Ultimate Editing: Version Your Vim Configuration

This is the last article from the Vim Ultimate Editing series. We looked at what makes Vim (in my case neovim) the best editor out there. We’ve analyzed the console support, the awesome UltiSnips, and today we’re looking at having the configuration as a git repository.

One of the things that really annoyed me at Sublime was that it had each snippet as its own XML file. This is super annoying. Right now, I have 669 snippets, in a total of 74 files, that are structured by file type. The name of the file tells me the file type. Having them all in a single folder makes everything entirely unmanageable.

Another thing that bothered me is that plugins in Sublime are zip files. So in order to get updates you need to manually fetch zip files. A workaround is Dropbox, but why go directly in workaround mode?

Fortunately, Vim comes with better solutions. First UltiSnips has sane snippet management, with multiple snippets in the same file, with the easy markup that I’ve already described in the last article. Using the multiple file types greatly simplifies organizing the snippets.

Second, using pathogen or Vundle allows you using plugins directly from other git repositories. In my case, I’m using pathogen, so I have all the plugins as git submodules.

Besides the cool factor, this allows me to simply go on any computer with a shell and vim installed, and a git clone --recursive later, I have all my plugins, all my settings, and all my snippets on that machine.

Not only that, but moving these around becomes fantastically easy. If I change some snippets in a place or install another plugin, all I execute is a bunch of git push and git pull.

This allows me at the end of the day to always build on my previous knowledge and get an amazing experience when editing.

At the end of this mini-series, by no means, I’m saying Vim is an easy editor. I think it has a really slow learning curve. But the climb is worth it because it goes higher than any other text editor out there.