bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

arrow keys in vi insert mode


From: Dick Streefland
Subject: arrow keys in vi insert mode
Date: Sun, 22 Sep 2002 23:36:18 +0200
User-agent: Mutt/1.4i

Hi,

This is not really a bug report, but a change request. I noticed that
in readline-4.3, there are now default mappings for the arrow keys in
vi insert mode. This is great, because until now I had to use the
following kludge in my ~/.inputrc to get the arrow keys to work:

"[A": "kA"
"[B": "jA"
"[C": "la"
"[D": "i"

However, when you use the cursor up/down keys, the cursor will always
be positioned at the start of the line, even when you are in insert
mode. I think it is more convenient to position the cursor at the end
of the line when you are in insert mode. It also means that for simple
command line editing using only the arrow and backspace keys, there is
no difference in the behavior of the vi and emacs modes.

The following trivial patch implements this change:

--- readline-4.3/misc.c.orig    2002-02-05 19:59:32.000000000 +0100
+++ readline-4.3/misc.c 2002-09-22 18:57:38.000000000 +0200
@@ -298,7 +298,7 @@
     rl_point = rl_end;
 
 #if defined (VI_MODE)
-  if (rl_editing_mode == vi_mode)
+  if (rl_editing_mode == vi_mode && _rl_keymap != vi_insertion_keymap)
     rl_point = 0;
 #endif /* VI_MODE */
 

-- 
Dick Streefland                    ////               De Bilt
dick.streefland@xs4all.nl         (@ @)       The Netherlands
------------------------------oOO--(_)--OOo------------------




reply via email to

[Prev in Thread] Current Thread [Next in Thread]