1

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?

2
  • 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, 2010 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, 2010 at 14:11

1 Answer 1

1

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.

1
  • 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, 2011 at 10:21

You must log in to answer this question.

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