UNIX VI editor equivalent of LINUX

Hi All,

I am comfortable working in LINUX and need equivalents for HP-UX for below mentioned,

  1. We use TAB key to expand/reveal a name in LINUX. Is there any way to make this work for UNIX, where it is double escape.

  2. Also can we use make use of left,down,up,right keys instead of hjkl keys.

How to change these in VI editor. Please suggest.

Thanks a lot.

Do you mean name completion?
That will depend of your configuration and environment, typically with ksh, you would have in your .profile:

export EDITOR=/usr/bin/vi

To see if its something of the sort you were thinking about, just type:

 set -o vi

And see if it works...
(Here its using Esc key twice...)

What's wrong with hjkl keys ? :wink:

1 Like
  • If I uderstood your need correctly, I'd simply say : "install 'bash' in your HP-UX box(es)" ;

good luck, and success.
alexandre botao

Enabling the arrow keys, insert key, and page up/page down keys in "vi" has to be done in a ".exrc" file in your home directory. See "man ex". The contents of the ".exrc" file depend on your terminal (or terminal emulator). For the root account I have more than one saved version and copy the one which matches the value of $TERM.
First check whether you have a ".exrc" file already to see whether you are going to edit it or create it.

The format of a .exrc file is very basic:
map key_you_press key_in_vi
map key_you_press key_in_vi

The "key_you_press" is the exact control sequence generated when you press that key. The "key_in_vi" is the key (e.g. "k") you would press in vi to get that effect.

I don't know how to generate a ".exrc" file using "vi". I use "echo" to generate mine.
For vt220 control sequences:

(
echo "map \033[A k"
echo "map \033[B j"
echo "map \033[D h"
echo "map \033[C l"
echo "map \033[2~ i"
echo "map \033[5~ \002"
echo "map \033[6~ \006"
) >>.exrc
1 Like