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

Ctrl-T mapped to Toggle()

Expand Messages
  • Volker Glave
    There s a toggle.vim plugin here doing mappings ... But instead as it seems the mapping goes to ... ... ... so I m losing default Ctrl-T (Jump to older
    Message 1 of 4 , Feb 1, 2008
    • 0 Attachment
      There's a toggle.vim plugin here doing mappings
      | 46 imap <S-C-T> <C-O>:call Toggle()<CR>
      | 47 nmap <S-C-T> :call Toggle()<CR>

      But instead as it seems the mapping goes to <C-T> ...
      | :map <S-C-T>
      | n <C-T> :call Toggle()<CR>
      ... so I'm losing default Ctrl-T (Jump to older entry in the
      tag stack).

      So, are S-C-mappings in general getting reshaped to
      C-mappings?
      Hm, from todo.txt:
      "8 Should mapping <C-A> and <C-S-A> both work?"

      More interestingly, what's the best way for me to
      revert to normal C-T behaviour?
      Should I unmap C-T in vimrc?
      Should I disable toggle.vim plugin? How? Assume
      that I don't have change/write access to the plugin
      directory.

      I'm using
      | version 7.0.224
      | :ver
      | VIM - Vi IMproved 7.0 (2006 May 7, compiled May 1 2007 10:53:35)
      | MS-Windows 32 bit console version
      | Included patches: 1-224

      Thanks in advance!
      Volker
      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_use" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • Tony Mechelynck
      ... IIUC, when x is a letter, C-x is represented as (x and 0x1F) regardless of whether x is upper- or lower-case: Ctrl-a and Ctrl-A are both 0x01, Ctrl-b and
      Message 2 of 4 , Feb 2, 2008
      • 0 Attachment
        Volker Glave wrote:
        > There's a toggle.vim plugin here doing mappings
        > | 46 imap <S-C-T> <C-O>:call Toggle()<CR>
        > | 47 nmap <S-C-T> :call Toggle()<CR>
        >
        > But instead as it seems the mapping goes to <C-T> ...
        > | :map <S-C-T>
        > | n <C-T> :call Toggle()<CR>
        > ... so I'm losing default Ctrl-T (Jump to older entry in the
        > tag stack).
        >
        > So, are S-C-mappings in general getting reshaped to
        > C-mappings?
        > Hm, from todo.txt:
        > "8 Should mapping <C-A> and <C-S-A> both work?"
        >
        > More interestingly, what's the best way for me to
        > revert to normal C-T behaviour?
        > Should I unmap C-T in vimrc?
        > Should I disable toggle.vim plugin? How? Assume
        > that I don't have change/write access to the plugin
        > directory.
        >
        > I'm using
        > | version 7.0.224
        > | :ver
        > | VIM - Vi IMproved 7.0 (2006 May 7, compiled May 1 2007 10:53:35)
        > | MS-Windows 32 bit console version
        > | Included patches: 1-224
        >
        > Thanks in advance!
        > Volker

        IIUC, when x is a letter, C-x is represented as (x and 0x1F) regardless of
        whether x is upper- or lower-case: Ctrl-a and Ctrl-A are both 0x01, Ctrl-b and
        Ctrl-B are both 0x02, etc., so, yes, S-C-mappings *for letters* are the same
        as C-mappings. It's not really Vim's fault, it's (IIRC) part of the ASCII
        specification. For non-printing keys (such as arrow keys and F keys) it's
        different. For non-letter printing keys, I'm not sure.

        If you want to keep the special Ctrl-T mapping, you can always map the default
        Ctrl-T function by using (for instance) ":noremap <F2> <C-T>"

        In general, when creating "custom" mappings in Vim, it's best to stay away
        from printing keys and cursor movement keys (with or without Shift and/or
        Ctrl) because most of these are already taken. I recommend using F keys (with
        or without Shift, and possibly excepting F1=Help and F10=Menu) as your best
        bets for "user" mappings; or multikey mappings starting with <Leader> or
        <LocalLeader> (q.v.) if you're writing a general-use plugin.


        Best regards,
        Tony.
        --
        A pretty young maiden from France
        Decided she'd "just take a chance."
        She let herself go
        For an hour or so
        And now all her sisters are aunts.


        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_use" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      • Richard Hartmann
        ... Setting pastetoggle to F1 was the best thing I ever did :) SCNR, Richard --~--~---------~--~----~------------~-------~--~----~ You received this message
        Message 3 of 4 , Feb 2, 2008
        • 0 Attachment
          On Feb 2, 2008 2:32 PM, Tony Mechelynck <antoine.mechelynck@...> wrote:

          > I recommend using F keys (with
          > or without Shift, and possibly excepting F1=Help and F10=Menu) as your best
          > bets for "user" mappings;

          Setting pastetoggle to F1 was the best thing I ever did :)


          SCNR,
          Richard

          --~--~---------~--~----~------------~-------~--~----~
          You received this message from the "vim_use" maillist.
          For more information, visit http://www.vim.org/maillist.php
          -~----------~----~----~----~------~----~------~--~---
        • Volker Glave
          On Feb 2, 2:32 pm, Tony Mechelynck ... Ok, thank you. ... Since I do not need Toggle() that much I do a ... in vimrc now to undo
          Message 4 of 4 , Feb 4, 2008
          • 0 Attachment
            On Feb 2, 2:32 pm, Tony Mechelynck <antoine.mechely...@...>
            wrote:
            > Volker Glave wrote:
            > > There's a toggle.vim plugin here doing mappings
            > > | 46 imap <S-C-T> <C-O>:call Toggle()<CR>
            > > | 47 nmap <S-C-T> :call Toggle()<CR>
            >
            > > But instead as it seems the mapping goes to <C-T> ...
            > > | :map <S-C-T>
            > > | n <C-T> :call Toggle()<CR>
            > > ... so I'm losing default Ctrl-T (Jump to older entry in the
            > > tag stack).
            >
            > > So, are S-C-mappings in general getting reshaped to
            > > C-mappings?
            > > Hm, from todo.txt:
            > > "8 Should mapping <C-A> and <C-S-A> both work?"
            >
            > IIUC, when x is a letter, C-x is represented as (x and 0x1F) regardless of
            > whether x is upper- or lower-case: Ctrl-a and Ctrl-A are both 0x01, Ctrl-b and
            > Ctrl-B are both 0x02, etc., so, yes, S-C-mappings *for letters* are the same
            > as C-mappings. It's not really Vim's fault, it's (IIRC) part of the ASCII
            > specification. For non-printing keys (such as arrow keys and F keys) it's
            > different. For non-letter printing keys, I'm not sure.

            Ok, thank you.

            > If you want to keep the special Ctrl-T mapping, you can always map the default
            > Ctrl-T function by using (for instance) ":noremap <F2> <C-T>"

            Since I do not need Toggle() that much I do a
            :autocmd VimEnter * unmap <C-T>
            in vimrc now to undo the mapping.

            > In general, when creating "custom" mappings in Vim, it's best to stay away
            > from printing keys and cursor movement keys (with or without Shift and/or
            > Ctrl) because most of these are already taken. I recommend using F keys ...

            Yes. (In this case the mapping was done in an existing toggle.vim
            plugin, that I don't have access to, though. To be true, I do have
            access,
            but it's a given profile that may update itself now and than, so a
            change
            won't last ...)

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