Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using arrow keys to navigate in vi 1

Status
Not open for further replies.

pjb

Programmer
May 1, 2001
148
US
I'm one of those that uses the up, dwn, lft, rt arrow keys on the keybord to navigate around in vi. This works in all my various connections (using Hummingbird Exceed to connect)because the use of the arrow key also acts like the escape key and breaks me out of the insert/append mode mode if I am in it. However, I just set up a new connection to a new machine and this feature does not work as well because pressing the arrow keys will not break append/insert. Is there something with an stty command I can do?
 
that will be a feature of the TERM used, and eventually of using VIM instead of vi. (note that its possible that on the background you are using VIM even if invoking it as vi.

vi will either be using termcap or terminfo, so look at the TERM type used, then look at the corresponding termcap/terminfo used to see if they are configured correctly according to the emulation you are using in Hummingbird

Regards

Frederico Fonseca
SysSoft Integrated Ltd
 
Hi,

You can also map the arrows with the original vi movment keys ( hjkl)
h = left arrow
j = down
k = up
l = right

when in vi, type this

:map ctl-v leftarrow h

the action above will map the left arrow
ctrl-v stands for the combination of CTRL and V
leftarrow stands for pressing one left arrow

To keep the arrow keys mapped all the time, put the lines in .exrc file in home directory like this
Code:
map ^[[D h
map ^[[B j
map ^[[A k
map ^[[C l

Ali
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top