I'd like to bind to control-minus in my .tmux.conf but it doesn't seem to work:
bind C-- split-window -v
Is this possible?
C- notation doesn't refer to actual keyboard hardware combinations. They refer to ASCII control codes. Historically, the notation was used to indicate ASCII characters between 0 and 31 by subtracting 64 from the ASCII value of the character used in conjunction with
C-. For example,
C-@ represents ASCII 0 (
@ is ASCII 64;
C-G represents ASCII 7 (
G is ASCII 71; etc. In other words, you generate ASCII x (for x between 0 and 31) by holding the Control key while pressing the key for ASCII x+64.
You'll notice that
- (ASCII 45) is too small to subtract 64 from! So technically,
C-- does not exist as a character. The only "real" control characters are
C-_. However, having to hold down the shift key is a little cumbersome, so typically you can type the lowercase letter instead (that is, Control-Shift-a and Control-a are equivalent). Since
_ are on the same key (at least on my US QWERTY keyboard),
C-_ can be used to represent the character generated by either Control-Shift-- or Control-_.
(This doesn't explain why
C-_ are not equivalent while
C-A are. I suspect that while nearly every keyboard will have
A on the same key, the same is not true for