[Top][All Lists]

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

Re: [vile] system-mapped-chars

From: Wayne Cuddy
Subject: Re: [vile] system-mapped-chars
Date: Fri, 26 Dec 2014 14:54:35 -0500
User-agent: Mutt/

On Tue, Dec 23, 2014 at 08:16:11PM -0500, Thomas Dickey wrote:
> On Tue, Dec 23, 2014 at 01:02:23PM -0500, Wayne Cuddy wrote:
> > Can system-defined maps be adjusted after compile time? It doesn't
> > seem so.
> no - it's built-in...
> Very briefly, it uses the terminfo/termcap/whatever database for
> home/end, and adds in - if asked - the xterm function-keys.
> The latter isn't much used (but I should rework it, since I've
> incorporated much of that into ncurses as extended capabilities).  My
> main use for it is to ensure that special keys come in as a special key
> rather than individual bytes.
> but I digress...
> > I've found that HOME/END keypad keys don't always map to #H/#E
> > respectively.
> That really sounds more like a mismatch between terminal emulator
> and terminal database.  (If it's some program setting TERM to "xterm"
> but not really xterm, I've been there a lot).
> Given some more details, I may be able to offer advice.
> > I've been able to get around this with additional maps for
> > terminal-specific sequences in the vilerc file but it would be nice if
> > there was an easy way to add to the system maps.
> > 
> > Wayne
> > 

Sorry, took me a bit of research, this was actually an issue for a
co-worker. I don't use the HOME/END or really any of the keypad keys, to
me that's what makes vi-style editors so efficient.

Aside from Linux we also use HP-UX at the shop. We run HP's OEM xterm as
well as rxvt-unicode that we built ourselves. We don't really have a
preference except that rxvt tends to be lighter with respect to network
I/O between itself and the X-server. This normally isn't noticed but we
use a VNC-style terminal server environment and high output/scrolling
can have a noticeable effect on the VNC/X host. But this is maybe an
xterm discussion for another day.

Vile is linked with HP's OEM curses (xcurses) library. Surprisingly the
HOME/END keys work as expected in rxvt. In Xterm, either running locally
on Linux while ssh'd into an HP host or running HP's xterm via X when
the HOME/END keys are used they produce ^[OH and ^[OE respectively.

On top of that the user wanted the HOME/END keys to operate on the
current line instead of the entire file. So here are the vilerc
entries I created.

map #H 0
map #E $
map! #H ^[0i
map! #E ^[A

; Handle HP Xterm
map ^[OH 0
map ^[OF $
map! ^[OF ^[A
map! ^[OH ^[0i

The above tends to work quite well so perhaps this is sufficient. I
was just surprised that the HP Xterm didn't produce #H/#E forcing me
to map the terminal escapes.

Thanks again,

reply via email to

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