Timothy Adams wrote:
Since the topic of mapping control+char is being kicked around, can anyone tell me 
why my mapping of <C-/> doesn't work?

*tim*



Because / is a printable character which is neither a question mark nor a lowercase letter, nor in the range 0x40-0x5F

When 7-bit ASCII was invented (or maybe earlier than that), the following convention for "Ctrl+printable key" was established (I'm giving the latest version):

- Ctrl+x (where x is in the range 0x40-0x5F included) means "x and 0x1F"
- Ctrl+y (where y is lowercase ASCII) means the same as Ctrl+upcase(y)
- Ctrl+? means 0x7F

Most other printable keys don't have an established Ctrl counterpart in "cooked" keyboard input (which is what Vim uses). They might not work at all, or give the same thing with as without Ctrl, or give something on some platforms and something else on other platforms. Better not use them.

For most _non_-printable keys, including most specially the F keys, there is usually a way to determine that they have been used with Ctrl, though how to do that may vary from one terminal (one termcap entry) to the next. But the problem here is that some of them may not reach Vim on some systems: for instance, in my Linux+kde installation, no Ctrl+Fn key ever reaches any X11 client application (including gvim): the window manager catches them for its own purposes (switching virtual desktops).


Note: "Raw" keyboard input would allow catching a Ctrl press on any keyboard... but it would also confuse AZ on a French (AZERTY) keyboard with QW on an English (QWERTY) keyboard or on a Swiss (QWERTZ) one...


Best regards,
Tony.
--
For a good time, call (415) 642-9483
  • C-/ Timothy Adams
    • Re: C-/ A.J.Mechelynck

Reply via email to