When I run vim in a terminal screen buffer under the gnu screen terminal multiplexer, the effect of Cntrl-A is initiation a screen binding. But when I run vim in a terminal screen buffer without gnu screen, the effect of Cntrl-A is vim incrementing the number under the cursor. What is giving screen priority over vim in this case? Can I override or customize this priority scheme?
Asked
Active
Viewed 133 times
1 Answers
1
Ctrl-A is GNU Screen's default escape character, also called the command character; it precedes every screen command. You can change it to something else using a command-line switch (-e xy) when you run screen or within screen using ctrl-a : escape xy. In both cases x is the new escape character, for example ^B, and y is the key to send that escape character to the program in the window. Or you can put the "escape" command in your .screenrc initialization file. The default is -e ^Aa meaning you can send a ctrl-A to vi by typing ctrl-a followed by "a".
This is explained in the GNU Screen manual in the sections on Invoking Screen and Command Character.

JoeT
- 31
- 3
-
Your comment on how to resolve the problematic use case I raised is useful. My question about the source of screen's keyboard priority over vim remains. – seewalker Nov 26 '13 at 08:48
-
That's just the way it works? Screen passes all keyboard input to vim except the escape char (Ctrl-a by default), which it recognizes as a command to screen itself. – JoeT Nov 26 '13 at 13:51