Resharper and ViEmu Keybindings ( and Visual Assist )

别等时光非礼了梦想. 提交于 2019-12-05 02:15:18

You can also create mappings in ViEmu that will call the VS and R# actions. For example, I have these lines in my _viemurc file for commenting and uncommenting a selection:

map <C-S-c> gS:vsc Edit.CommentSelection<CR>
map <C-A-c> gS:vsc Edit.UncommentSelection<CR>

The :vsc is for "visual studio command," and then you enter the exact text of the command, as it appears in the commands list when you go to Tool>Options>Keyboard

I don't use any of the R# ones in this way, but it does work, as with:

map <C-S-A-f> gS:vsc ReSharper.FindUsages<CR>

I use both as well, but I'm using the IntelliJ keybindings instead, so I can't speak specifically to the Visual Studio bindings. J.P. Boodhoo has some changes that he has made via AutoHotKey to provide additional Vim-like functionality to Visual Studio + ReSharper + ViEmu.

I have removed a few of the scanned keys, though, because I want to keep some of the ReSharper functionality over the ViEmu functionality, though the way I use these tools change over time as I learn more shortcuts from either ViEmu or ReSharper.

I have noticed the following, which may be useful to know. Some of the ReSharper keyboard mappings that ViEmu hoses, will work once you have a different ReSharper dialog open. I use the IntelliJ IDEA-based shortcuts, but I assume this will work similarly for ReSharper's VS scheme.

Example: ViEmu binds to Ctrl+N which R# uses for Go To Type. However, ViEmu does not bind to Ctrl+Shift+N which R# uses for Go To File. Therefore, if you hit Ctrl+Shift+N the Go To dialog is launched. You can then take your finger off Shift and hit N again and the dialog will switch to Go To Type.

This is very useful, if like me you use Go To Type a lot and don't really want to mess with the keyboard mappings.

As @Jay noted the best way is to set up custom bindings.

Here is example of bindings at https://github.com/StanislawSwierc/Profile. I created my bindings based on the previous at https://github.com/w1ld/viemu_settings

I use both plugins, but I really prefer the power of the Vi input model that ViEmu gives. I really don't miss so much the Resharper keybindings...

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!