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

Re: map! gt and map! gT Don't work

Expand Messages
  • Tony Mechelynck
    ... The only _printable_ keys which have a portable Ctrl-equivalent are those foreseen in ASCII. These are: - characters 0x40 to 0x5F, whose Ctrl-equivalent is
    Message 1 of 25 , Jun 3, 2009
    • 0 Attachment
      On 03/06/09 01:27, John Little wrote:
      >
      >
      >> Anyone tell me why the following commands...
      >> map!<C-=> <C-o>gt
      >> map!<C--> <C-o>gT
      >
      > One usually can't map control-minus or control-=, historically there
      > was no such control code.
      > To see what you can map, in insert mode type a control-V (or control-Q
      > if control-V is paste for you) then a key combination you are
      > considering mapping. Watch out, though, weird stuff can happen if your
      > OS (or window manager, or session manager...) does something with the
      > key strokes.
      >
      >> can i map<C-=> & <C--> so as to go to next/previous tab in the premise
      >
      > Your mappings are otherwise ok. In my gvim
      >
      > map!<A-=> <C-o>gt
      > map!<A--> <C-o>gT
      >
      > work with the Alt key. (In my vim in a terminal, these don't work,
      > alt-something gets turned into esc-something.)
      >
      > HTH, John

      The only _printable_ keys which have a portable Ctrl-equivalent are
      those foreseen in ASCII. These are:

      - characters 0x40 to 0x5F, whose Ctrl-equivalent is obtained by
      subtracting 0x40;
      - lowercase letters a to z, whose Ctrl-equivalent is the same as that of
      the corresponding uppercase letter (meaning also that Ctrl-Shift-letter
      is guaranteed to be the same as Ctrl-letter without Shift -- at least
      according to the ASCII standard, which Vim follows here);
      - the question mark 0x3F, where Ctrl-? is the DEL character, 0x7F.

      Since the minus/dash (0x2D) and the equal sign (0x3D) are not among the
      above, any program which recognizes Ctrl-- and/or Ctrl-= must use fancy
      footwork for the purpose, and Vim doesn't.

      Some _unprintable_ keys, such as F1 to F12 and the cursor-movement keys,
      may have recognisable Ctrl-equivalents, but they are transmitted from
      the keyboard to the program in a totally different way, which may be
      OS-dependent and/or terminal-dependent. (FYI, I have found Shift-Fn to
      be more portable in gvim over several OSes than are Ctrl-Fn or Alt-Fn.
      Ctrl-arrow keys seem to work.)

      As for the Alt key, gvim usually maps it to "OR with 0x80", which means
      that an ASCII key with Alt will usually become synonymous with some
      special or accented character. Caveat emptor! (especially in Insert
      mode). For instance, ç (as in "garçon") is synonymous with Alt-g and é
      (as in "risqué") with Alt-i. Both these French words are entries in my
      Oxford's (unilingual) dictionary. How console terminals map
      Alt-combinations depends on the terminal, and some may not map them at all.


      Best regards,
      Tony.
      --
      Corrupt, stupid grasping functionaries will make at least as big a
      muddle of socialism as stupid, selfish and acquisitive employers can
      make of capitalism.
      -- Walter Lippmann

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