Is it possible to map keys in VsVim to Visual Studio commands? For example, can I map gb
to View.NavigateBackward
?
This is where you can map keys like the traditional vim editor (it lives in your windows user home directory). VsVim also allows you to bind things to visual studio commands, and by extension, resharper. The following are a number of useful bindings
How to map keys in vim Say you want to setup vim to have a certain key stroke, preform a desired operation You can use the map command to do this. The file [s] to add the mappings are ~/.vimrc or /etc/vim/vimrc or you can add a map, temporarily, through vim command-line.
Say you want to setup vim to have a certain key stroke, preform a desired operation You can use the map command to do this. The file [s] to add the mappings are ~/.vimrc or /etc/vim/vimrc or you can add a map, temporarily, through vim command-line. Keys can be mapped in all types of modes, all mapping syntaxes are the same as described above
Resharper / VsVim Handling of Ctrl In the VsVim Settings you can set whether VsVim or VisualStudio should handle the various Ctrl key combinations, there is fine grained control over the various Ctrl combinations, but in general, prefer using VsVim if VsVim has functionality that uses Ctrl.
You do it via your _vsvimrc file.
This should do the trick:
nnoremap gb :vsc View.NavigateBackward<CR>
You can even map extension commands, like those from Resharper:
nnoremap gi :vsc Resharper.Resharper_GotoImplementation<CR>
The full documentation is here: https://github.com/jaredpar/VsVim/wiki/VsVim-Nonstandard-Behavior
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With