- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: use of arrow buttons in vi editor
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-03-2006 10:35 PM
тАО09-03-2006 10:35 PM
We are unable to use all arrow buttons in vi editor of our hp-ux server (rp3440 )
(right arrow L , down-arrow J etc).
We can use arrow buttons in vi editor only on Terminal and not on windows key board ( login by telnet).
Is there any mapping to be done to activate arrow keys on vi editor ?
Regards
Raju
Solved! Go to Solution.
- Tags:
- vi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-03-2006 11:21 PM
тАО09-03-2006 11:21 PM
Re: use of arrow buttons in vi editor
You must find a terminal emulation software that can emulate that.
In fact, some software allow you to do keyboard remapping such that when you press the arrow keys, it will emulate "right arrow L"
We had been using a terminal emulation software from FTP Software in the past.
hope this helps!
kind regards
yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-04-2006 12:30 AM
тАО09-04-2006 12:30 AM
Re: use of arrow buttons in vi editor
Thought the terminal software can be changed to meet this need its possible to do it yourself.
Example, right after connect
stty erase ^?
That sets the erase sequence to backspace.
I would think the arrow keys can be set in a smilar fashion, though its vi and I like the standard keyboard layout, or at least I'm used to it.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-04-2006 08:58 AM
тАО09-04-2006 08:58 AM
Re: use of arrow buttons in vi editor
So .exrc must be completely rewritten for every terminal type. An HP terminal is very different from a Wyse or VT100, so you'll need to follow these steps:
1. Identify the terminal emulation you are using (ie, yyse30, vt220, ansi, etc). The easiest is to ask the terminal itself with ttytype -s
2. Get a copy of the emulator's tech reference manual and determine if the arrow keys are functional. If they are (and remember that the arrow keys are PC keys that must be seen by your emulator and then something generated by the emulator when the key is pressed) then you'll need a list of the keys and codes. An alternative is to ask HP's terminfo database with the untic command (see below).
3. From the keys and codes, create a new .exrc file with the appropriate map. For example, the up-arrow key for a VT100 terminal emulator should generate ESC [ A while an HP terminal generates ESC A.
Now an easy way to get the map is to use the untic command along with the man page for terminfo. Start by getting a list of codes based on your terminal:
untic $(ttytype)
Print this list, then look up the curses code for the keys you want to map. For instance, the up-arrow key is called cuu1 in the curses capname. Find cuu1 in the untic list and there is the corresponding code generated by the up-arrow key. The ESC code is represented by \E.
Here's a starting point - be sure to "Save Link" since this is a binary file with embedded escape codes and Unix file line terminators: http://examples.oreilly.com/upt2/split/exrc
This file will need some editing based on your needs and terminal emulator.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-04-2006 06:48 PM
тАО09-04-2006 06:48 PM
Re: use of arrow buttons in vi editor
Thanks for the information.
The output of untic $(ttytype)..
#untic $(ttytype)
TERM = (hp)
hp|hpex|hewlett-packard extended capabilities,
am, xhp, da, db, mir,
cols#80, lines#24, lm#0, xmc#0, nlab#8, lh#2, lw#8,
bel=^G, cr=\r, tbc=\E3, clear=\E&a0y0C\EJ,
el=\EK, ed=\EJ, hpa=\E&a%p1%dC, cup=\E&a%p1%dy%p2%dC,
cud1=\EB, home=\E&a0y0C, cub1=\b, cuf1=\EC,
cuu1=\EA, dch1=\EP, dl1=\EM, smir=\EQ,
smso=\E&dB, smul=\E&dD, sgr0=\E&d@, rmir=\ER,
rmso=\E&d@, rmul=\E&d@, il1=\EL, kbs=\b,
ktbc=\E3, kclr=\EJ, kctab=\E2, kdch1=\EP,
kdl1=\EM, kcud1=\EB, krmir=\ER, kel=\EK,
ked=\EJ, kf1=\Ep, kf2=\Eq, kf3=\Er,
kf4=\Es, kf5=\Et, kf6=\Eu, kf7=\Ev,
kf8=\Ew, khome=\Eh, kich
From the output the arrow keys have the following keys :
1) left-arrow = cub1 , code generated is \b
2)right-arrow = cuf1 , code generated is \EC
3)up-arrow =cuu1 , code generated is \EA
4)down-arrow = cud1 , code generated is \EB
I have tried to map in .exrc without success.
How to map the above in .exrc file ?
Regards
Raju
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-05-2006 12:29 AM
тАО09-05-2006 12:29 AM
Re: use of arrow buttons in vi editor
cp /usr/newconfig/etc/skel/.exrc $HOME/.exrc
Then run vi and the arrow keys should work fine. The arrow keys need to be mapped for use in insert mode too and the newconfig file has these listed.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-05-2006 06:23 PM
тАО09-05-2006 06:23 PM
Re: use of arrow buttons in vi editor
I have copied the hp file to $HOME directory.
Still I can't use the arrow key buttons.
View our .exrc file :
-------------------------------------------
set autoindent autowrite showmatch wrapmargin=0 report=1
map ^W :set wrapmargin=8
map ^X {!}sort -b
map ^[h 1G
map ^[H 1G
map ^[F G
map ^[V ^B
map ^[U ^F
map ^[T ^Yk
map ^[S ^Ej
map ^[Q i
map ^[P x
map ^[L O
map ^[M dd
map ^[K D
map ^[J DjdG$
map! ^[A ^[ka
map! ^[D ^[ha
map! ^[C ^[la
map! ^[B ^[ja
map! ^[L ^M
map! ^[Q ^[
map! ^[R ^[
---------------------------------
Regards
Raju
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-06-2006 09:02 PM
тАО09-06-2006 09:02 PM
Re: use of arrow buttons in vi editor
is there a way to set vi options in the "shell vi" set -o vi,
to use, for example, cursors to navigate the command history?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-07-2006 01:47 AM
тАО09-07-2006 01:47 AM
SolutionBill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-07-2006 10:20 AM
тАО09-07-2006 10:20 AM
Re: use of arrow buttons in vi editor
I don't think so. Possibley for emacs mode but I don't see any control chars for vi for ksh.
Basically you should not be using the arrow keys in vi, but the standard h, j, k l. These work in the shell and gdb.
I only use the arrow keys when I'm moving away from the home keys or using the mouse or looking at the screen.
- Tags:
- history