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

Re: does not work (was: vim question)

Expand Messages
  • Luis A. Florit
    ...continuation... These are the keys shown by í : S-Up ^[[a S-Right ^[[c S-Down ^[[b S-Left ^[[d C-Up ^[Oa C-Right ^[Oc C-Down ^[Ob
    Message 1 of 34 , Mar 1, 2006
    • 0 Attachment
      ...continuation...

      These are the keys shown by í<C-v><S-...>:

      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.

      L.


      * El 01/03/06 a las 23:17, Luis A. Florit chamullaba:

      > > On Tue, Feb 28, 2006 at 09:11:16PM -0300, Luis A. Florit wrote:
      > > > * El 28/02/06 a las 15:22, Gerald Lai chamullaba:
      > > >
      > > > > >>> 2) how to select text with Shift-cursorkey.
      > > > > [snip]
      > > > > >>>For (2), I put
      > > > > >>>
      > > > > >>> set keymodel=startsel
      > > > > >>>
      > > > > >>>in my .vimrc file, but the screen just blinks and does nothing.
      > > > > >>>I even deleted my .vim and .vimrc stuff and give this command
      > > > > >>>alone, with no results. I also tried mixing it with
      > > > > >>>'selectmode'
      > > > > >>>with no results either.
      > > > >
      > > > > If you don't mind, you could manually define mappings that would
      > > > > do
      > > > > that. I have mappings that would visually select words when doing
      > > > > a
      > > > > Ctrl-Shift-arrow key combination in GVim.
      > > > >
      > > > > "down/up selection
      > > > > nmap <C-S-Down> v<Down>
      > > [snip]
      > > >
      > > > Don't worry, I am far from being a purist.
      > > > But it didn't work either. Just blinks the console.
      > > > Tried with konsole and gnome-terminal, with same behavior.
      > > >
      > > > The tip in ':help xterm-cursor-keys' also doesn't helped with this,
      > > > although explains weird behavior.
      > >
      > > I do not trust CTRL- with anything other than A-Za-z. On other
      > > characters, I am willing to try it, but if it does not work,
      > > I give up. So let's stick with <S-Up> and so on.
      > >
      > > 1. If you are still using vim 6.3, please try it with vim 6.4. Many
      > > bugs were fixed (and few, if any, new features were added) between 6.3
      > > and 6.4, and it is possible that this is one of them.
      >
      > I've installed 6.4 in a SunOS.
      >
      > > 2. :set keymodel=startsel should work, and (starting in Normal mode)
      > > <S-Up> will enter Visual mode. You have already tried this with
      > > $ vim -u NONE right?
      >
      > 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.
      >
      > > If it is not working, there is a problem.
      > > You can try a work-around, like
      > >
      > > :nmap <S-Up> v<Up>
      >
      > This was my original first try, and nothing happens, either.
      > I was never able to make this shifted-cursor mappings work.
      >
      > > or you can try to fix the problem.
      > >
      > > 3. Please send :version information. (The first thing I will do is
      > > check that you are using vim 6.4!)
      >
      > Here you are:
      >
      > VIM - Vi IMproved 6.4 (2005 Oct 15, compiled Feb 28 2006 19:56:17)
      > Compiled by luis@Zygmund
      > Normal version without GUI. Features included (+) or not (-):
      > -arabic +autocmd -balloon_eval -browse +builtin_terms +byte_offset
      > +cindent -clientserver -clipboard +cmdline_compl +cmdline_hist
      > +cmdline_info +comments +cryptv -cscope +dialog_con +diff +digraphs
      > -dnd -ebcdic -emacs_tags +eval +ex_extra +extra_search -farsi
      > +file_in_path +find_in_path +folding -footer +fork() -gettext
      > -hangul_input -iconv +insert_expand +jumplist -keymap -langmap
      > +libcall
      > +linebreak +lispindent +listcmds +localmap +menu +mksession
      > +modify_fname +mouse -mouseshape -mouse_dec -mouse_gpm -mouse_jsbterm
      > -mouse_netterm +mouse_xterm -multi_byte +multi_lang -netbeans_intg
      > -osfiletype +path_extra -perl +postscript +printer -python +quickfix
      > -rightleft -ruby +scrollbind -signs +smartindent -sniff +statusline
      > -sun_workshop +syntax +tag_binary +tag_old_static -tag_any_white -tcl
      > +terminfo +termresponse +textobjects +title -toolbar +user_commands
      > +vertsplit +virtualedit +visual +visualextra +viminfo +vreplace
      > +wildignore +wildmenu +windows +writebackup -X11 -xfontset -xim -xsmp
      > -xterm_clipboard -xterm_save
      > system vimrc file: "$VIM/vimrc"
      > user vimrc file: "$HOME/.vimrc"
      > user exrc file: "$HOME/.exrc"
      > fall-back for $VIM: "/impa/home/p/luis/bin/vim64/share/vim"
      > Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -O2 -fno-strength-reduce -Wall
      > Linking: gcc -o vim -ltermlib -ldl
      >
      > > Remind us what system you are using.
      >
      > This vim 6.4 was in:
      > SunOS 5.9 Generic_118558-06 sun4u sparc SUNW,Sun-Fire-280R Solaris
      >
      > > (I think you said something about xterm and gnome-terminal?)
      >
      > Yes, I tried that in Linux, too.
      >
      > > Is there also a problem in gvim?
      >
      > No, gvim works perfectly: <S-Left> visual selects by characters,
      > <C-Left> visual selects by words.
      >
      > > I could go on, but that is plenty for now.
      >
      > Certainly it is, and thank you very much,
      >
      > Luis.
    • 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.