Two years with Vim

Two years ago I was using Visual Studio Code for my daily tasks, and it was pretty good to me. But then I saw a video from Nick Nisi (vim + tmux) that changed my mind completely.

I switched to Vim and have been using it full-time ever since. And now I want to discuss my experience with this transition and share some of the things that I’ve learned along the way.

Prior to my switch, I had heard a lot about Vim being too complicated and requiring a lot of configuration time. While this partially true, it’s worth it when you consider what the end result is. The end result is a personalized tool which meets your exact workflow specifications.

If you can’t find a beer that you like, it might be time to brew your own. It might take some time until you get the ingredients just right. But it’ll be worth it in the end!

That’s how my editor looks now:

Vim + Tmux/ConEmu

Vim works well with Tmux. So if you’re on Linux or OS X, then Tmux + Vim is a combination you’ll want to use. For Windows users it’s possible to use ConEmu instead of Tmux, and it works pretty well. I will probably write about my ConEmu setup someday.

Vim plugins

I don’t really want to create an IDE from Vim, but I want an editor that takes into account the specifics of the languages I’m using. To achieve that, I use Vim plugins.

As a Web developer, I need support for the following: TypeScript, JavaScript, CSS, C#, F#, and Python.

Here is the list of all of the major plugins I use and a short description for each:

  • NERDTree – a plugin that allows you to see your directories in Tree View
  • FZF – an awesome plugin for fuzzy searches. It requires FZF utility
  • YouCompleteMe – a complete engine. Works well with C#, JavaScript, and TypeScript
  • Vim-fugitive – provides comprehensive Git support
  • Ultisnips – your code snippets
  • Gundo.vim – Tree View for your Undo command
  • OneDark – a nice dark color scheme ported from Atom
  • Omnisharp-vim – a C# language engine
  • ternjs/tern_for_vim – a JavaScript completer
  • Vim-game-code-break – a cool game that will put a smile on your face 🙂

Final tips on configuration

Finally some useful tips regarding Vim configuration:

  • Don’t copy another coder’s Vim configuration. This will not help you at all. Instead it makes your configuration process confusing, and your vimrc becomes too messy. It’s best to add to its functionality is piece by piece.
  • Don’t be afraid of trying alternative plugins. I spent way too much time with CtrlP before finally trying FZF…
  • Try to keep your key bindings consistent throughout your language-related plugins. For example, I use plugins for TypeScript, JavaScript, C#, and F#. All of these plugins have different key bindings for the “Go To Definition” feature. So instead of keeping the original settings, make sure you reconfigure them. So for example, “gd” will always be “Go To Definition”.
  • Try to group all of your settings. Keep all plugin-related settings in one place.Try to keep your vimrc as structured as possible to avoid surprises in the future.
  • Remap CapsLock to Ctrl key. It’s one of the largest and, at the same time, most useless keys! Remapping it to Ctrl makes life much easier.

And finally, here is my own Vim configuration on GitHub!

This entry was posted in Editor, IDE, Linux, Tmux, Vim and tagged , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s