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

Re: does not work (was: vim question)

Expand Messages
  • A. J. Mechelynck
    Luis A. Florit wrote: [...] ... [...] Maybe your console Vim and your console terminal are misunderstanding each other. Open vim in a terminal, hit i to start
    Message 1 of 34 , Mar 1, 2006
    • 0 Attachment
      Luis A. Florit wrote:
      [...]
      > Yes. 'vim -u NONE' with Vim 6.3 in Linux, and Vim 6.4 in SunOS.
      > Same results... This is what I did:
      >
      > vim -u NONE somefile
      > :set keymodel=startsel
      > <some movement>
      > <S-Up>
      >
      > Just nothing happens. Even after moving the whole .vim directory.
      > It really sounds like the terminal is sending the wrong strings to vim.
      >
      > I am using an rxvt through ssh, so there are many things that can
      > be problematic. But I don't think the problem is between version
      > 6.3 and 6.4:
      >
      > In Linux in version 6.3, the behaviour of vim in an rxvt is the
      > same as the SunOS version 6.3. And in Linux version 6.3, the
      > behaviour of xterm is quite different from the one in rxvt with
      > this shifted-movement keys. For example, for a xterm in normal mode:
      >
      > key does
      >
      > S-Up A
      > S-Left DjD
      > S-Down bb
      > S-Right DjDA
      >
      > With or without '-u NONE'. Nice, isn't it? :)
      > The same for an rxvt just blinks the screen.
      [...]

      Maybe your console Vim and your console terminal are misunderstanding
      each other. Open vim in a terminal, hit i to start Insert mode, then hit
      Ctrl-K followed by Shift-Up. Vim should insert <S-Up> (6 characters)
      into the editfile buffer. Similarly for other non-printing key combinations.

      If Vim understands what you type correctly, then the problem is
      elsewhere. If it doesn't, then it can be:

      a) A genuine misunderstanding. The error could lie in a bad
      termcap/terminfo, or a badly set $TERM or 'term'. (What are they set to?
      ":echo $TERM" and ":verbose set term?", without the quotes, will tell
      you. What do you get by Ctrl-V followed by Shift-Up in Insert mode?)
      b) A timeout. This can be cured by tweaking the options 'timeout',
      'ttimeout', 'timeoutlen' and 'ttimeoutlen' (q.v.). Start with

      :set timeout ttimeout timeoutlen=5000 ttimeoutlen=500

      which means "time out after 5 seconds on multikey mappings and
      abbreviations actually typed-in, after half a second on key sequences
      sent by the keyboard driver". Afterwards you can set more appropriate
      settings for your typing speed, computer speed and line speed.


      Best regards,
      Tony.
    • 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.