[lug] vi question

Matthew Beldyk matt at beldyk.org
Fri Aug 15 13:03:10 MDT 2008

I use vim instead of plain vi and I've seen similar behavior when some
stuff was changed on our machines, basically we figured out that it
was related to not using ncurses when compiling vim (or just
downloading a package)  For some reason when this is done, certain key
bindings are not set up and vim wanted to behave like old vi (when
people didn't have arrow keys on their keyboard).

You can also add your own custom key bindings to vim.  I believe
adding the lines few lines to your ~/.vimrc may help (these map
commands are from http://hea-www.harvard.edu/~fine/Tech/vi.html )
map! ^? ^H
map! ^[OA ^[ka
map! ^[OB ^[ja
map! ^[OC ^[la
map! ^[OD ^[ha

You can also try running vim as `vim -N <filename>` which turns on
nocompatablity mode which is the same as having the line "set
nocompatable" in your .vimrc
Also I've seen different behavior using vim when you have a ~/.vimrc
file vs when there isn't one.

The short answer is use vim instead of vi, if you want this
functionality (and syntax highlighting and other neat things) and make
sure you compile in ncurses. I've found the whole getting vim to
behave correctly to be a bit of a black art, where I try a couple
things and have found that ever installation is different. (also term
variables make a difference sometimes, just saw Jeffery's email)

Good luck and I'm curious if any/which of my solutions work for you.


On Fri, Aug 15, 2008 at 12:28 PM, Gary Hodges <Gary.Hodges at noaa.gov> wrote:
> We've just made some computing changes here and a colleague is reporting
> that vi is no longer working as expected.  I know little about vi, so I come
> here seeking answers.
> Previously my colleague could enter into the replace mode (Shift-R) and then
> use the arrow keys to move around and replace text.  Now the arrow keys
> produce a letter (A,B,C or D) depending on the key, each on a new line.
> Gary
> _______________________________________________
> Web Page:  http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
> Join us on IRC: lug.boulder.co.us port=6667 channel=#colug

Calvin: Know what I pray for?
Hobbes: What?
Calvin: The strength to change what I can, the inability to accept
what I can't, and the incapacity to tell the difference.

More information about the LUG mailing list