On 5/17/06, Ken Morley <[EMAIL PROTECTED]> wrote:
I am new to OpenBSD 3.8, but have a lot of experience with SuSE & RedHat
Linuxes.



The problem is that I've always been able to use the cursor keys when
editing with VIM under

SuSE and RedHat and I can't seem to break the habit.  So, I keep
trashing the file I'm working on

by using the control keys.

(function keys)


I currently use VanDyke's Secure-CRT 5.0 terminal emulation software.
No matter how I configure

Try using putty. save yourself a registration fee and support open
source software.


OpenBSD or the terminal emulation software, I can't find a combination
that will correct the problem.

try TERM=xterm or its variants

If you have a suggestion other than removing those keys from the
keyboard, I would love to hear it.



Thanks very much!



Ken Morley



From the OpenBSD console, I have seen that it generates different ansi
sequences than what is -typical- in xterm etc. I can't complain, 'ansi
sequences' are misleading, in that ansi sequences were never
standardized, though the name implies it.

vim does it's best to define sequences depending on your TERM. However
this doesnt map correctly to an OpenBSD console with TERM=vt220 or
TERM=wsvt25. I've found the need for these in my vimrc:

if $HOSTTYPE=="OpenBSD"
 " OpenBSD function keys
 set t_k1=[11~ " f1 through ..
 set t_k2=[12~
 set t_k3=[13~
 set t_k4=[14~
 set t_k5=[15~
 set t_k6=[17~
 set t_k7=[18~
 set t_k8=[19~
 set t_k9=[20~
 set t_k;=[21~
 set t_F1=[23~
 set t_F2=[24~ " ...f12
 set t_kP=[5~  " page up
 set t_kN=[6~  " page down
 set t_kh=[7~  " home
 set [EMAIL PROTECTED]  " end
endif

Simply look up the :help section that lists all of the key code
variables and re-configure them. For F1, simply into a .vimrc:

set t_k1=<esc><ctrl+v><F1>

and so on...

Do this from SecureCRT and they keys will work correctly.

As somebody else pointed out, try using hjkl and vimtutor. You'll
thank yourself later. Some people say vi is only for hardcore hackers
who like to overcomplicate something as simple as an editor, but I
feel it allows me to be so lazy that I barely have to move my hands
around, esp wen using ^[ instead of the escape key.

jdq

Reply via email to