2

I'd like to have Ctrl-[ work, i.e., have it exit insert mode, in VsVim in Visual Studio and in gVim both on my Windows XP and Windows 8 Pro virtual machines under Parallels 9 running on OS X Lion. I really don't know why that key sequence does not seem to work under both Windows OSs.

Ctrl-C works in gVim, but I don't care for that key sequence as an alternative (especially since it has other semantics in Visual Studio). I have no vimrc set up on Windows and thus no key mappings and indeed running :map and that keychord (which I can't type here because of the angle brackets?) reports "no mappings found". I've interacted with the author of VsVim (who is very helpful) to no avail thus far as seen here. I think it is something on my system since it happens in gVim too. The key sequence works great for me in Emacs where I have my viper config set to map Ctrl-[ to viper escape on both OS X and Windows. So the physical keyboard works fine. Lots of googling hasn't yielded a solution yet.

Any ideas on how to see why this is happening, or, even better, a solution for this problem? For instance, if something is consuming the Ctrl-[ chord system wide (or application wide?), how do I find what it is? I am really stumped on this one as I am not a Windows expert or a Parallels expert (though, as I say, I've googled this quite a bit with an eye toward Windows and Parallels).

1

Background

Esc (the escape key) exits modes such as 'Insert' mode and 'Visual' mode and causes gVim to go back into 'Normal' mode. Ctrl-[ does this as well, both Esc and Ctrl-[ perform the same function in gVim.

Unfortunately, as the OP mentioned, pressing Ctrl-[ in gVim in a Parallels Virtual Machine running Windows doesn't make gVim exit back to 'Normal' mode like it's supposed to. But pressing Esc fortunately does make gVim exit back to 'Normal' mode.

Solution

You can fix this issue by creating a shortcut from Ctrl-[ to Esc.

Steps to create the necessary shortcut:

  1. Open Parallels Desktop.
  2. Go to: Parallels Desktop menu -> Preferences -> Shortcuts tab -> [Your Virtual Machine] (Under the "Virtual Machines" heading).
  3. Click the '+' button to add a shortcut.
  4. In the textbox in the "From" section, press the [ key.
  5. Click the "^ Ctrl" button in the "From" section.
  6. Click the textbox in the "To" section, then press the esc key. This should make the word "Esc" appear in the textbox.
  7. Click the "OK" button.
| improve this answer | |
  • Jay, thank you!! Really appreciate you taking the time to post this. It works. – Joe Mar 22 '14 at 3:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.