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

mapping control+0-1 or backtick

Expand Messages
  • Robert Mark Bram
    Hi All, Is it possible to map to control+number or control+`? I found these mappings didn t work. map :hide bn map :hide bn I looked
    Message 1 of 4 , Aug 3, 2009
    • 0 Attachment
      Hi All,

      Is it possible to map to control+number or control+`?

      I found these mappings didn't work.

      map <C-`> :hide bn<CR>
      map <C-1> :hide bn<CR>

      I looked through :help keycodes and couldn't find reference to
      backtick or tilde, but I have seen that you can map to the backtick by
      itself. For example:

      " Use backtick for escape.
      :imap ` <Esc>

      Thanks for any advice!

      Rob
      :)


      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_use" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • Tony Mechelynck
      ... You can map any key that Vim knows about. In particular, you can map 1 or ` by themselves, these are ordinary printable keys. What concerns the Ctrl +
      Message 2 of 4 , Aug 15, 2009
      • 0 Attachment
        On 04/08/09 02:23, Robert Mark Bram wrote:
        >
        > Hi All,
        >
        > Is it possible to map to control+number or control+`?
        >
        > I found these mappings didn't work.
        >
        > map<C-`> :hide bn<CR>
        > map<C-1> :hide bn<CR>
        >
        > I looked through :help keycodes and couldn't find reference to
        > backtick or tilde, but I have seen that you can map to the backtick by
        > itself. For example:
        >
        > " Use backtick for escape.
        > :imap `<Esc>
        >
        > Thanks for any advice!
        >
        > Rob
        > :)

        You can map any key that Vim knows about. In particular, you can map 1
        or ` by themselves, these are ordinary "printable" keys.

        What concerns the Ctrl + printable key combinations, Vim knows only
        those defined by ASCII, as follows:

        - Ctrl + anything in the range [0x40-0x5F] = the original key minus 0x40
        - Ctrl + lowercase [a-z] = Ctrl + the corresponding uppercase
        - Ctrl + ? = 0x7F

        ` (backtick, 0x60) and 1 (one, 0x31) fall in none of the above
        categories, so Vim doesn't know about their Ctrl combinations.

        The above does not apply to the Ctrl + _non_-printable key combinations,
        some of which (such as Ctrl+arrows) can be detected by Vim on some
        platforms. For instance on my openSUSE Linux + KDE system, gvim gets
        Ctrl-arrow combinations with no problem but Ctrl-Fn keys are intercepted
        by the window manager. For _Console_ Vim I'm less sure which arrow-key
        combinations it can get.


        Best regards,
        Tony.
        --
        hundred-and-one symptoms of being an internet addict:
        101. U can read htis w/o ny porblm and cant figur eout Y its evn listd.

        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_use" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      • Robert Mark Bram
        Hi Tony, ... Thank you very much for this clear explanation - I didn t understand what I had read from help, and this really clears it up. Shame I can t use
        Message 3 of 4 , Aug 15, 2009
        • 0 Attachment
          Hi Tony,

          > > Is it possible to map to control+number or control+`?

          > You can map any key that Vim knows about. In particular, you can map 1
          > or ` by themselves, these are ordinary "printable" keys.
          >
          > What concerns the Ctrl + printable key combinations, Vim knows only
          > those defined by ASCII, as follows:
          >
          > - Ctrl + anything in the range [0x40-0x5F] = the original key minus 0x40
          > - Ctrl + lowercase [a-z] = Ctrl + the corresponding uppercase
          > - Ctrl + ? = 0x7F
          >
          > ` (backtick, 0x60) and 1 (one, 0x31) fall in none of the above
          > categories, so Vim doesn't know about their Ctrl combinations.

          Thank you very much for this clear explanation - I didn't understand
          what I had read from help, and this really clears it up. Shame I can't
          use any key combo though.

          Rob
          :)
          --~--~---------~--~----~------------~-------~--~----~
          You received this message from the "vim_use" maillist.
          For more information, visit http://www.vim.org/maillist.php
          -~----------~----~----~----~------~----~------~--~---
        • Tony Mechelynck
          ... You can use Shift-F5 (which is known to have no default binding in Vim, so that one is safe ), Ctrl-Up (which probably does have a default binding), Alt-d
          Message 4 of 4 , Aug 15, 2009
          • 0 Attachment
            On 15/08/09 16:16, Robert Mark Bram wrote:
            >
            > Hi Tony,
            >
            >>> Is it possible to map to control+number or control+`?
            >
            >> You can map any key that Vim knows about. In particular, you can map 1
            >> or ` by themselves, these are ordinary "printable" keys.
            >>
            >> What concerns the Ctrl + printable key combinations, Vim knows only
            >> those defined by ASCII, as follows:
            >>
            >> - Ctrl + anything in the range [0x40-0x5F] = the original key minus 0x40
            >> - Ctrl + lowercase [a-z] = Ctrl + the corresponding uppercase
            >> - Ctrl + ? = 0x7F
            >>
            >> ` (backtick, 0x60) and 1 (one, 0x31) fall in none of the above
            >> categories, so Vim doesn't know about their Ctrl combinations.
            >
            > Thank you very much for this clear explanation - I didn't understand
            > what I had read from help, and this really clears it up. Shame I can't
            > use any key combo though.
            >
            > Rob
            > :)

            You can use Shift-F5 (which is known to have no default binding in Vim,
            so that one is "safe"), Ctrl-Up (which probably does have a default
            binding), Alt-d (which is known to be seen by Vim as synonymous with รค
            aka a-umlaut, so it's probably a bad choice in Insert mode if you
            occasionally type German text), etc.


            Best regards,
            Tony.
            --
            Uncle Ed's Rule of Thumb:
            Never use your thumb for a rule. You'll either hit it with a
            hammmer or get a splinter in it.

            --~--~---------~--~----~------------~-------~--~----~
            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.