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

Re: does not work (was: vim question)

Expand Messages
  • Benji Fisher
    ... Good for you: that was going to be my next question. ... I think that Tony is more qualified than I am to help you work out terminal-related issues; see
    Message 1 of 34 , Mar 1, 2006
    • 0 Attachment
      On Wed, Mar 01, 2006 at 11:52:04PM -0300, Luis A. Florit wrote:
      > ...continuation...
      >
      > These are the keys shown by í<C-v><S-...>:

      Good for you: that was going to be my next question.

      > S-Up ^[[a
      > S-Right ^[[c
      > S-Down ^[[b
      > S-Left ^[[d
      >
      > C-Up ^[Oa
      > C-Right ^[Oc
      > C-Down ^[Ob
      > C-Left ^[Ob
      >
      > where ^[ means <Esc>.
      >
      > So, vim understand these strings literally and reproduce
      > them as normal commands. What is strange is that the
      > strings sent in insert mode produce no problem (Up is ^[OA,
      > but it obeys the "up"; don't understand why the difference).
      >
      > Hence, this indeed has to do with ':help xterm-cursor-keys',
      > although the tip there just does not work for me.

      I think that Tony is more qualified than I am to help you work out
      terminal-related issues; see his post. A work-around (a very
      non-portable one) is to do

      :nmap ^[[a <S-Up>

      or, if that does not work,

      :nmap ^[[a v<Up>

      and so on. You should be able to enter ^[[a (either on the command line
      or in your vimrc or another script file) with <C-V><S-Up> .

      HTH --Benji Fisher
    • Luis A. Florit
      ... Yep, now you do. ;) L.
      Message 34 of 34 , Mar 5, 2006
      • 0 Attachment
        * El 05/03/06 a las 13:08, Gerald Lai chamullaba:

        > On Sun, 5 Mar 2006, Luis A. Florit wrote:
        >
        > >* El 05/03/06 a las 17:39, Luis A. Florit chamullaba:
        > >
        > >>>>nmap OA <Up>
        > >>>>
        > >>>>that works fine, EXCEPT because now the O command in normal
        > >>>>mode waits for a second for a 2nd key, as you said...
        > >>>>So, I had to make another setting:
        > >>>>
        > >>>>set timeout timeoutlen=1000 ttimeoutlen=100
        > >>>>
        > >>>>for the O to not wait that long (1/10 sec).
        > >>>
        > >>>A correction:
        > >>>set timeout timeoutlen=1000 ttimeoutlen=100
        > >>>works fine if, instead of :nmap OA <Up>
        > >>>we make
        > >>>
        > >>>set <xF2>=OA
        > >>>nmap <xF2> <Up>
        > [snip]
        >
        > Sorry, I forgot to include one detail that was 'ttimeoutlen'. The
        > advantage of "encapsulating" the keycode in <xFn> like:
        >
        > set timeout timeoutlen=1000 ttimeoutlen=100
        > set <xF2>=^[[a
        > map <xF2> <S-Up>
        >
        > as opposed to only:
        >
        > map <Esc>[a <S-Up>
        >
        > is that <xF2> can be treated as a keycode of a single keystroke
        > (within a mapping context) as opposed to a mapping of multiple
        > keystrokes.
        >
        > Then setting 'ttimeoutlen' to a really small value ensures that the
        > keycodes cannot (be humanly-possible but shell-possible to) be
        > entered manually.
        >
        > Hope I'm making sense :)

        Yep, now you do. ;)

        L.
      Your message has been successfully submitted and would be delivered to recipients shortly.