Vsvim

  1. Vsvim Surround
  2. Vsvim Key Bindings

VsVim implements basic telemetry using Azure Application Insights to identify which Visual Studio versions are being most commonly used and prioritize features. If you'd prefer to opt-out of the telemetry collection, you can disable it from the Tools - Options - VsVim option dialog. Vim Emulator Plugin for Visual Studio 2015+. Contribute to VsVim/VsVim development by creating an account on GitHub.

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.

Plugins

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!

Vsvim Surround

Highlighter plugin

Vsvim

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

Vsvim map

(Avoiding) Git in Visual Studio

Vsvim Key Bindings

ConfigVsvimVsvim

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.

Visual Studio Teams - Code Search

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.

Workarounds

Filling empty line between { and }

When you type a new method, VS aids you and you end up with this:

If you don't write anything there immediately, but return to it later, VsVim forces you to type from the hard BoL of the empty line. I don't know any good way to deal with it, but at least there's certainly a nice assortment of acceptable ways:

  • ddO
  • i, End
  • If the expression is simple, just do i and type it (ignoring intendation), it'll auto-format automatically when you type “;” or other trigger.