Re: does not work (was: vim question)
- On Wed, Mar 01, 2006 at 11:52:04PM -0300, Luis A. Florit wrote:
> ...continuation...Good for you: that was going to be my next question.
> These are the keys shown by í<C-v><S-...>:
> S-Up ^[[aI think that Tony is more qualified than I am to help you work out
> 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.
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
- * El 05/03/06 a las 13:08, Gerald Lai chamullaba:
> On Sun, 5 Mar 2006, Luis A. Florit wrote:Yep, now you do. ;)
> >* 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>
> 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
> 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 :)