30 Jun 2018

From Vim to Visual Studio

Whilst a big vim fan, part of my day job at Qunifi involves heavy use of the Microsoft Azure tech stack, and using Visual Studio makes that a whole lot easier. Here are the plugins and tweaks I'm currently using to ease the Vim to Visual Studio transition.


VsVim plugin

VsVim is definitely the plugin that boosted my productivity the most on Visual Studio. This plugin provides most of the vim keyboard shortcuts that you already know and love. The editor defaults to normal mode. Commands that you run can be seen in a command bar below the editing window.

I was pleased to see support for gT/gt to move between tabs. The biggest gotcha was no default support for all ctrl+$key bindings out of the box. This means ctrl+d/ctrl+u to go down/up a page won’t work by default. These are left out because Visual Studio already has bindings for these key combinations, so you have to do some digging if you’re after that functionality.

Whilst I’m using VsVim, there are other vim emulation plugins out there, so get in touch if I should be using something else!

Highlighter plugin

I miss being able to navigate to a word and press # to clearly highlight all instances. The vim plugin doesn’t provide this, or rather the highlight doesn’t stay once I start doing something else. The highlighter plugin however makes it much clearer.

Workflow Tweaks

(Avoiding) Git in Visual Studio

Visual Studio has a whole git interface but try as I might I can’t seem to get on with it. This is particularly problematic when I want to do nearly anything beyond a very basic commit, e.g. stage part of a file, or amend the last commit, or stash some changes. For this reason I’ve taken to using Git Bash (which is already bundled up in the Git for Windows package). That way I can lean on the commands I already know. It also helps me maintain a clear understanding regarding the state of the repo rather than being unsure what VS is handling for me.

Having said that, if you don’t know git and are starting to use Visual Studio it makes more sense to learn the VS git interface, but beyond basic usage I’m a little unconvinced.

This one doesn’t isn’t a Visual Studio specific tweak, rather for those who are using Visual Studio Team Services. Definitely enable the code search plugin. It will index all your repos and allow a total code search. This is a rarely required tool in the toolbox but it’s a genuine time saver to go from ‘some loose recollection of a piece of code we might have written at some point’ to a concrete file and repo.

Dev Vim Visual Studio
Back to posts