Loading ...
Sorry, an error occurred while loading the content.

109949Re: Mapping ctrl-; (ctrl semicolon)

Expand Messages
  • Tony Mechelynck
    Dec 3, 2009
    • 0 Attachment
      On 01/12/09 10:19, Karl Guertin wrote:
      > I'm trying to set up a mapping on ctrl-; but vim seems to be unable to
      > detect the keystroke:
      >
      > :imap<c-;> blah
      >
      > Vim seems to read it as a modifier-free semicolon regardless of what I
      > do. I'm on MacVim snapshot 51 based on Vim 7.2.303. I've tested with
      > the --noplugin switch and through SSH to a linux 7.0 version. I'm
      > unaware of any mac shortcuts that would interfere nor any terminal
      > control characters. I am able to receive the event in other
      > applications. Searching is somewhat difficult due to the trouble with
      > search engines indexing ; and there is no mention in the help files.
      >
      > Is anybody else experiencing this? Is there a workaround?
      >

      No, there isn't.

      The only printable keys which can reliably be used with Ctrl, with
      predictable results, in cooked mode on any OS, are those defined by
      ASCII, and that means the following AND NO OTHERS:

      - ASCII characters 0x40 to 0x5F (i.e. uppercase A to Z, plus the six
      nonalpha characters at-sign, left-bracket, slash, right-bracket,
      circumflex and underscore), where Ctrl subtracts 0x40, thus mapping them
      to 0x00 to 0x1F respectively. This explains why Ctrl-[ means Esc, Ctrl-I
      means Tab, Ctrl-M means Enter, etc.
      - Lowercase letters, whose Ctrl counterpart is the same as for the
      corresponding uppercase (thus Ctrl+letter and Ctrl+Shift+letter are
      always the same for a given letter)
      - In addition, Ctrl-? is mapped to 0x7F (DEL).

      Vim may or may not see other Ctrl-combinations, but that depends on the
      terminal, and in most cases it won't see them, or confuse them with
      something else such as the same key without Ctrl.


      Best regards,
      Tony.
      --
      hundred-and-one symptoms of being an internet addict:
      216. Your pet rock leaves home.

      --
      You received this message from the "vim_use" maillist.
      For more information, visit http://www.vim.org/maillist.php
    • Show all 5 messages in this topic