This is always the first Visual Studio extension I install - could not imagine working in Visual Studio without it. VsVim is rock-solid and simply allows me to edit code more quickly.
For the uninitiated (or the Vi-traumatized):
1) It does not take comprehensive knowledge of Vi(m) commands to be much more productive with this extension (or Vi(m) generally). Basic Vi commands (http://www.cs.colostate.edu/helpdocs/vi.html) pack a lot of punch. 2) Yes, I am quite familiar with comparable Windows keyboard shortcuts for many things I do Vi-style using VsVim - and find myself seamlessly interleaving them with Vi(m) commands; TMTOWDI; but Vi is everywhere (including Visual Studio thanks to this awesome extension) and reduces reaches for my mouse and contortion on my keyboard more than anything else I have tried over 20+ years of nerdery.
Sure, maybe I am using the wrong name for the feature (its really just renaming, not refactoring). In VS, if you highlight (select) a variable name, on the declaration, and type over it with a new name, an icon appears that you can click on to open a menu that says "Rename <old name> to <new name>". Then if you click that, VS updates all of the references to this variable to the new name.
Also, you mentioned C#, which I haven't tried this in. I noticed this in VB, which is what most of the code I am working with is written in. This is not resharper or a similar plugin, as I do not have these for VS 2013 (still vanilla on that).
I don't have to do the renames that often, so I can work around for now by temporarily disabling the plugin and re-enabling when done, with VS restarts. I wouldn't do this for small local variables, but for properties, etc. of classes that are referenced multiple places, this might still be the quickest way, as a workaround.
VS has the option to replace tabs with a configurable number of spaces (Tools>Options>Text Editor>All Languages>Tabs, also configurable per file type). VsVim doesn't seem to honour this setting. Any chance of getting this included?
VsVim does support honoring this. It just prefers settings from the _vimrc file over the Visual Studio default if it finds a _vimrc. Here is a link that details how to get VsVim to respect Visual Studio over vim defaults for all settings
i don't seem to be able to bring any of this bindings to work:
so what i currently do is 'yiw' on the source and 'ciw<C-r>0' on the target.
but since i cant even repeat the change/paste via '.' my fingers hurt after the third occurence :)
is there a (more) painless way to do so?
Great plugin! Use it every day.
I was looking for a fast way to navigate between C# method declarations, and found the Vim commands ]m and [m. They don't seem to be in VsVim. or am I missing something?
This works as expected in gVim:
au FocusLost,TabLeave * call feedkeys("\<C-\>\<C-n>")
After I added it to my _vsvimrc (in my 'home' folder, C:\Users\hxchba), it seemed to have no effect.
Is there a 'VsVim' way to get the desired functionality?
Thanks for providing us with VsVim and making VisualStudio much more useful...
i'm facing the same thing as this guy: http://stackoverflow.com/questions/3718026/vim-indent-current-blank-line-and-insert
but none of the 'standard'-vim solutions seem to work for vsvim...
am i really stuck spamming C-t in insert-mode?
I'm actually baffled at why the accepted answer works. When I try that on gVim it doesn't indent the value but instead stays at column 0. Is there a particular setting I need to get `S` to indent to the column of the line above?
it surely works here..:
* freebsd 10.0
* vim & gvim
~ fire up (g)vim
~ write this (whereas _ denotes cursor):
~ press ESC and then S - you end up with:
Minor feature request.
When you use visual studio's "Go To Line" dialog (double-click on the line number label in the status bar at the bottom), it will expand folded code if the target line is contained there, then position the caret on the appropriate line.
VsVim does not do this and seems to stop on the outermost fold containing the target line (e.g. if a fold covers lines 5 to 100 and you do ':20<CR>' to go to line 20, the caret will go to the beginning of the fold at line 5 and stay there). If the fold has been expanded, it will jump to the target line as desired.
Thanks in advance,
I see! I have never tried using folds in gVim (I edit mainly plain text files there and they are short).
So what do you usually do when there's a clash between what VS does and what gVim does? In this case I hope the VS behaviour wins (or perhaps a setting could be provided to allow people to choose)!
Whenever the action involves cursor movement or placement I take gVim over Visual Studio. The reason being that most vim guys intuitively know where a given key stroke will take them. Doing actions like expanding the outlining would break say a jump followed by a yank. I get lots of negative feedback whenever I break cursor movement even, and sometimes especially, when it is subtle.
In general though it's not a problem because gVim has a setting that toggles between the behavior. I can just implement that and hence give people a work around. I'm trying to determine if there is such a setting here that I can just implement
Could you add an option or disable VSvim while in report designer from reporting services, also in design mode of webpages would be good sometimes to have ctrl-v because "p" does not work in there :)
keep up the great work, this extension rocks.
Hello thank you for the reply, it's included in the SQL data tools http://msdn.microsoft.com/en-us/data/tools.aspx
this is the type of project http://i.technet.microsoft.com/dynimg/IC574428.gif
anyway for now I just remap the orignal ctrl-v so I can paste stuff in designer mode of aspx design view, for the report editor I have to disable plugin due to key stroke strange behavior
it should be possible to make this work by mapping Tab to Down in insert mode (small bug that needs to be fixed though). But this would mean that every occurence of Tab would move the key down. Is that the feature you are looking for?
This sounds like it would move the cursor down when typing, sadly I use tab to indent into lines. Ahwell was a nice thought.
I do however have another question. I created a _vsvimrc file in my home directory to remap hjkl keys to jkl; using the nnoremap command for each key. Everything works nicely appart from now ; moves the cursor two character to the right instead of one. Is this a bug or can I specify how many characters are moved on the keypress?
Sorry for the long question
No problem on the long question. Can you post your _vsvimrc somewhere that I can take a look at it? Also do you have any other extensions installed? It's possible one of them is interferring here and causing the double behavior.
I have extensions for git, sql server and a comment spell checker but the problem still occurs with these disabled. Here is a dropbox link to the _vsvimrc file
Sorry for the delay, I just debugged into it today and figured out what is going wrong. The issue is that there is a single space after the 'l' character on the 'nnoremap ; l ' line. This means that when you hit ';' it runs the key sequence 'l<Space>' which causes the cursor to generally speaking go right twice.
This is strangely enough the behavior that gVim displays. It considers any trailing white space on the line to be part of the mapping