Vsvim: Ctrl-R to redo is not working in VsVim

Created on 27 Feb 2012  ·  30Comments  ·  Source: VsVim/VsVim

I'm using vs2010 + latest VsVim
Looks like vim Ctrl-R is working in VsVim?
When I press Ctrl-R, VS says: '(Ctrl-R) was pressed. Waiting for second key of chord...'
Note: I understand that there is an Option button in after the VsVim command line. But even if I choose to VsVim to handle Ctrl+R, VS is still handling Ctrl+R and complains: '(Ctrl+R) was pressed. Waiting for second key of chord...' I just tried to change this setting and let VS handle Ctrl+R, then change it back to VsVim. But still can't redo a previously undoed editting.
I wonder if this is what is expected (because Ctrl+R has not yet been implemented) or caused by my VS settings?

All 30 comments

@wiserfirst, Ctrl-R is definitely implemented in VsVim. The (Ctrl+R) was pressed. Waiting for second key of chord... message is from Visual Studio,
so VsVim is probably not configured correctly. Try playing around with the
VsVim options a little more (Options button in the bottom right corner of
each tab).

Tim, thanks for the reply.
I've been playing around with VsVim several rounds, including update to the latest code from github; uninstall and reinstall VsVim in VS; let VS handle Ctrl-R and then change it back to let VsVim handle Ctrl-R. But none of these seem to work. The anoying prompt from VS "(Ctrl+R) was pressed. Waiting for second key of chord..." always shows up when ever I try to redo something in command mode or try to paste some previous yanked text in insert mode (Ctrl-R + 0)

@wiserfirst when you click on the Options button in VsVim does it have VsVim listed as handling Ctrl+R?

@jaredpar yes, it has VsVim listed as handling Ctrl+R
You can see my VsVim options in this image http://t.co/Q2oIBSd2

That's really odd behavior. The Ctrl-R should be binding to VsVim in that case. Can you tell me more about this issue to help me track it down?

  • Does it only happen in certain file types (.cs, .cshtml, etc ...)?
  • Do you have any other plugins installed?
  • What keys does VS have bound to Ctrl+r? You can check by going to Tools -> Options -> Environment -> Keyboard and typing Ctrl+r into the "press shortcut keys" box.

@jaredpar I started getting the similar behavior with Ctrl+U. At some point I used both Handle all with VsVim and Handle all with Visual Studio buttons and set it individually. Now VsVim won't _not_ handle Ctrl+U. I wonder if the problem is with the buttons? I'll see if I can debug the issue

@jaredpar Sorry for the delay. I've been very busy at work.

  1. I don't think it only happens in certain file types. I use VS and VsVim to edit a lot of different files (including .cs .aspx .html .config .js), but Ctrl-R always don't work.
  2. On my main dev PC, there are two other plugins (JSEnhancements and VisualSVN). But I've tested on other PCs with only VsVim installed in Visual Stuadio and Ctrl-R don't work on these PCs too.
  3. In Tools -> Options -> Environment -> Keyboard, when Ctrl-R is typed into the "press shortcut keys" box, nothing is shown. And furthermore, I use a VS macro to list all keybindings in my current VS setting and only two involves Ctrl-R:
    Edit.RefreshLocalCache
    Transact-SQL Editor::Ctrl+K, Ctrl+R
    View.ArchitectureExplorer
    Global::Ctrl+\, Ctrl+R
    If you think a full list of keybindings would help, I could also provide it.
    BTW: I'm using a simplified chinese version of Visual Studio.

Hmm, that's really odd.

My best guess at this point is that it's something about the simplified Chinese version that's causing the problem. Likely a localization issue I haven't caught yet. Going to try and get a hold of a simplified Chinese version of Visual Studio this weekend and see if I can track this down.

@jaredpar thanks for your reply.
Maybe this is caused by a localization issue. But when I was trying to search the Internet for a solution to this issue, I also noticed a post on stackoverflow (http://stackoverflow.com/questions/8500229/how-to-redo-when-using-vsvim/9416430#9416430). So I suppose there might be some other people who are not using a simplified Chinese version of VS, but also have problem with Ctrl-R to redo.
BTW: I update to the latest VsVim code from github at least once a week and build it myself. But I have to remove the current installation and then install the new version every time. So I wonder if there is any more convenient way to upgrade an existing VsVim installation.
I really appreciate that you've done such a great job in providing a nice tool for development in Visual Studio!

I took a look at that stack overflow question and it looks like in that particular case the user hadn't yet tried to remove Ctrl+R with the options menu.

Yeah upgrading to the new version does require an uninstall / reinstall combination. I've been working on a powershell script to automate the process. It's called dogfood.ps1 and it's in the root directory of the github enlistment. It's not quite right yet though. It works about 1/2 of the time. There is a timing issue that I can't quite figure out yet.

@jaredpar <Ctrl+R> still don't work on my PC...
I really hope this could be fixed, thank you in advance.

Sorry for the delay here. Got caught up in a nasty Dev11 bug. Going to try and look into this tomorrow.

I was able to get a Simplified Chinese install today and repro the problem. I also figured out how to work around it. First open up the Keyboard options page

  • Tools -> Options
  • Navigate to Environment -> Keyboard
  • Put the rusor in the "Press Shortcut Key box"
  • Hit CTRL+R

This should populate the "Shortcut Currently used by" box with 3-4 entries. For each one of those entries

  • Navigate to the command in the list box in the dialog
  • Hit "Remove" for the key binding which has "Ctrl R"

After you remove all 4 bindings of Ctrl+R then it will start working fine in VsVim.

As for actually fixing this so that it just works in VsVim I could use a bit of help from you if possible. I'm really hampered here by my inability to read / translate simplified Chinese. If i knew what the commands were it would make it significantly easier to track down the problem. If possible for each one of the commands above that you remove could you give me the closest possible English translation if there is one?

On my home computer there are 4 entries listed in the "Shortcut Currently used by" box:
1 编辑.查看空白 (CTRL+R, CTRL+W (文本编辑器))
2 查询设计器.执行SQL (CTRL+R (查询设计器))
3 查询设计器.执行SQL (CTRL+R (视图设计器))
4 格式.按钮 "右" (CTRL+R (VC对话框编辑器))
Their English translations are (Currently I don't have a English verion of VS on hand, so these translations might not be quite exact. But I think the meaning should be correct):
1 Edit.View Blank (CTRL+R, CTRL+W (Text Editor))
2 Query Designer .Execute SQL (CTRL+R (Query Designer))
3 Query Designer .Execute SQL (CTRL+R (View Designer))
4 Format.Button "Right" (CTRL+R (VC Dialog Editor))
I hope this would be helpful for you. If you find the Chinese characters not the same as what you see in VS, please change the character set setting in your browser to "Unicode (UTF-8)". If the viewing problem remains, please let me know. I can provide a picture to avoid the problem.

BTW: After removing all 4 keybindings, CTRL+R still don't work. In fact, I've already tried that on my office PC several weeks ago.

Removing all 4 doesn't fix it? That's really odd because it does fix it on my machine. Essentially I find each one of those commands, delete the key binding and then suddenly CTRL+R starts working.

I've just updated to the latest code from Github, but strange thing happenned when I tried to let VS handle all keys. Now the VsVim Option Dialog is empty and I can't select keys to handle with VsVim anymore!

It sounds like you ran into a subtle settings bug I've been working on. Try and reset all settings, restart Visual Studio and the keys will come back

  • Tools -> Import / Export Settings
  • Reset All Settings

I found a way to make re-do command work. Add the following mapping in vsvimrc
nnoremap <C-Q> <C-R>

then use <C-Q> to re-do. This is not perfect, but at least I can have the re-do command.
BTW: I wonder if <C-R> in insert mode is working now. I noticed that related issues are all closed.

Right now <C-R> in insert mode isn't implemented yet. Here is the primary issue tracking it

https://github.com/jaredpar/VsVim/issues/636

I've read this issue but I thought it was closed too. My mistake :) Sorry

I had this problem too and strangely solved it by setting Options -> "Ctrl + Shift + R" -> Handled by VsVim.

EDIT: For some reason this stopped working today, however pressing Ctrl + R with Shift seems to redo. Weird!?

I have the same problem, after tried everything, I finally map Ctrl+R to Edit.Redo using keyboard option page... and it works.

@tiwb are you unable to use Ctrl+R in normal mode or insert mode?

Mapping to Edit.Redo will defiinitely work. VsVim intercepts that command and performs vim undo / redo instead of normal Visual Studio undo / redo

OK, the redo feature can be (somehow) fixed. But what about (copy the word under cursor in the command line) ? I got stuck on this feature.

@raoulinet I'm unsure which feature you're speaking of. Could you elaborate?

@jaredpar My best guess is that @raoulinet wanted to copy something in a register and then use Ctrl+R to paste it in command line. I believe this is not implemented in VsVim and it's another issue which has nothing to do with the Ctrl+R redo problem.
I'm now using VS2012 and it seems that the original Ctrl+R redo problem doesn't occur any more. So I think it's time to close this issue.

I'll put this here as it might be useful:

I had this problem on VS2015 and I started to try the solution above - deleting all of the Ctrl-R shortcuts. Most of mine were created by ReSharper and they were compound ones, e.g. Ctrl-R, Ctrl-I. I removed a few of these to no effect. Then I noticed that the View.SolutionExplorer command had just Ctrl-R as one of its shortcuts. Removing this one fixed the problem

I have exactly the same problem on a Japanese VS 2010. I deleted all shortcut bound with Ctrl+R, it is not fixed.
I wonder VS might always catch ctrl+R since it is possible for a Ctrl+R, XXXX shortcut combination.

I found a work-around for this problem. Since I'm so used to using CTRL+R for refactoring, I didn't want to change it, so I decided to map CTRL+Y to it (I haven't used this shortcut in VIM, and I'm not aware if it does something useful). I added this line to my ~/_vimrc:

inoremap <C-Y> <C-r>

Now, if I press CTRL+Y in INSERT mode, I can then type the register name, and it will paste it. Helps me A LOT!

@jaredpar thanks for your reply.
Maybe this is caused by a localization issue. But when I was trying to search the Internet for a solution to this issue, I also noticed a post on stackoverflow (http://stackoverflow.com/questions/8500229/how-to-redo-when-using-vsvim/9416430#9416430). So I suppose there might be some other people who are not using a simplified Chinese version of VS, but also have problem with Ctrl-R to redo.
BTW: I update to the latest VsVim code from github at least once a week and build it myself. But I have to remove the current installation and then install the new version every time. So I wonder if there is any more convenient way to upgrade an existing VsVim installation.
I really appreciate that you've done such a great job in providing a nice tool for development in Visual Studio!

The stackoverflow question How to redo when using VsVim? provide a solution to the problem.

Please read the remark of @NoSaidTheCompiler for a solution that works with recent version of VsVim and VisualStudio.

Was this page helpful?
0 / 5 - 0 ratings