Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to bind Ctrl-+ and Ctrl-- in Vim to resize the current window. However, Terminal does not seem to pass anything when I press Ctrl-+. Ctrl-- does work.

I checked in Vim itself using Ctrl-V and in Bash using cat -v. No luck. Disabling the hotkeys for OS X's Spaces is no use, either.

MacVim seems to have the same problem. Is this a reserved hotkey for OS X, perhaps?

share|improve this question
1  
If you open Keyboard Viewer from the Input menu you can enable in System Preferences » Language & Text » Input Sources, you'll notice that pressing Ctrl will prevent Shift from taking hold. This is why on my British keyboard, Ctrl-Minus and Ctrl-Shift-Minus both produce ^_. Unfortunately, switching to a different keyboard layout with + on its own, unmodified key, such as German, doesn't help either. But other applications, such as System Preferences » Keyboard » Keyboard Shortcuts or third party applications such as Butler receive Cmd-+ just fine. – Daniel Beck Dec 28 '10 at 11:57
    
Daniel: thank you, I had not gotten that far. FWIW, I am using an external non-Apple USB "International" and the MBP's internal US keyboard. Both keyboards give the same results. I would not even mind the "non-shiftiness" if Ctrl-= (a.k.a. Ctrl-+ minus the shift) worked — but even that combination does not get through. – janmoesen Dec 28 '10 at 14:11
up vote 0 down vote accepted

It is not actually a key combination (Ctrl-Minus) you enter, but a UNIX control code -- like what happens when you enter ^D or ^C (caret notation). That's why cat -v displays it as ^_.

There's just no control code associated with Ctrl-Plus or Ctrl-Equals. It just doesn't work like you want: you're actually assigning a command to ASCII character 0x1F.

share|improve this answer
    
Thank you! I will try and see if I can make Terminal.app pass along some other (as of yet unused) sequence using its keyboard mapping. Too bad I would have to do that for every terminal application I use Vim with, though. – janmoesen Jan 2 '11 at 10:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .