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

Mapping ctrl-; (ctrl semicolon)

Expand Messages
  • Karl Guertin
    I m trying to set up a mapping on ctrl-; but vim seems to be unable to ... Vim seems to read it as a modifier-free semicolon regardless of what I do. I m on
    Message 1 of 5 , Dec 1, 2009
    • 0 Attachment
      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?

      --
      You received this message from the "vim_use" maillist.
      For more information, visit http://www.vim.org/maillist.php
    • Tim Chase
      ... When you say that other applications see it, are they GUI or console apps (especially via SSH)? In insert mode, you can try typing control+V followed by
      Message 2 of 5 , Dec 1, 2009
      • 0 Attachment
        > 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.

        When you say that other applications see it, are they GUI or
        console apps (especially via SSH)? In insert mode, you can try
        typing control+V followed by control+; and see if Vim sees the
        character. You might also try the same experiment in gvim. I
        don't think ctrl+; is a standard key encoding in terminals, so
        vim won't likely get a chance to see it to process it.

        -tim

        --
        You received this message from the "vim_use" maillist.
        For more information, visit http://www.vim.org/maillist.php
      • Karl Guertin
        ... Sorry. That d be gui apps (tested with a quick firebug onkeypress handler in firefox). ... This was being done in MacVim (which I know is slightly
        Message 3 of 5 , Dec 1, 2009
        • 0 Attachment
          On Dec 1, 7:34 am, Tim Chase <v...@...> wrote:
          > When you say that other applications see it, are they GUI or
          > console apps (especially via SSH)?

          Sorry. That'd be gui apps (tested with a quick firebug onkeypress
          handler in firefox).

          > In insert mode, you can try typing control+V followed by control+;
          > and see if Vim sees the character.  You might also try the same experiment
          > in gvim.

          This was being done in MacVim (which I know is slightly different) and
          it does not see the event. It gets a plain ;. The term seems to be
          eating ctrl-; and vim never even gets it. I was writing here mostly to
          see if anybody else was seeing it or it's something with my system
          setup that I'm missing.

          --
          You received this message from the "vim_use" maillist.
          For more information, visit http://www.vim.org/maillist.php
        • Chris Jones
          ... Same here, on linux debian, both with xterm & rxvt. On a US keyboard, the following all appear to behave likewise, both with the Ctrl and Ctrl+Shift
          Message 4 of 5 , Dec 1, 2009
          • 0 Attachment
            On Tue, Dec 01, 2009 at 01:10:15PM EST, Karl Guertin wrote:
            > On Dec 1, 7:34 am, Tim Chase <v...@...> wrote:
            > > When you say that other applications see it, are they GUI or
            > > console apps (especially via SSH)?
            >
            > Sorry. That'd be gui apps (tested with a quick firebug onkeypress
            > handler in firefox).
            >
            > > In insert mode, you can try typing control+V followed by control+;
            > > and see if Vim sees the character.  You might also try the same experiment
            > > in gvim.
            >
            > This was being done in MacVim (which I know is slightly different) and
            > it does not see the event. It gets a plain ;. The term seems to be
            > eating ctrl-; and vim never even gets it. I was writing here mostly to
            > see if anybody else was seeing it or it's something with my system
            > setup that I'm missing.

            Same here, on linux debian, both with xterm & rxvt.

            On a US keyboard, the following all appear to behave likewise, both with
            the Ctrl and Ctrl+Shift modifiers:

            , . ; ' - = 0 9 1 2

            < > : " _ + ) ( ! @


            CJ

            --
            You received this message from the "vim_use" maillist.
            For more information, visit http://www.vim.org/maillist.php
          • Tony Mechelynck
            ... 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
            Message 5 of 5 , 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
            Your message has been successfully submitted and would be delivered to recipients shortly.