Hello,
After applying the Redhat patch for the vi editor, I found that
if I logged in as superuser and used vi, the backspace key would
no longer delete characters (it just produced ^?). Although my
initial terminal window did not have this problem, after exiting
from superuser, it adopted this problem as well. Entering "man vi"
I discovered that I now had a different editor, vim. This stands for
"vi improved" or "vi imitation" for the more cynical. More
information can be gleaned by entering "vi" followed by ":help".
I learned that this beast could be tamed by using a .vimrc file.
After a long read through the help documentation I discovered
buried in the depths of this tome, that a .vimrc file can be created
by entering ":mkv". (This was located in the "options.txt", one of over
150 files and sections.) Unfortunately, this command just puts in
writing the undesired attributes that I had just discovered.
Furthermore, the .vimrc file contained the line "set textwidth=78",
which now caused the line to break after 78 characters, something else
I had not asked for. Inserting a "#" before this line had no
beneficial effect because the writer of vim decided that a new standard
for a comment was necessary; one must use a double quote.
It seemed that the backspace key problem was a key mapping problem.
Using Google search, I came across the site
http://aterm.sourceforge.net/keyboard.html which mentioned using
:help fixdel. This section mentioned the command
:set t_kb=^V<DEL>
(note that ^V is control V and <BS> is the delete key)
Saving this in .vimrc gives the line
imap [CTRL-BS] [CTRL-DEL]
However, using vi as su with a modified .vimrc file in /root still gave
the same problem. Why does vim have this problem? The documentation
mentions the following:
Note about Linux: By default the backspace key
produces CTRL-?, which is wrong. You can fix it by
...
So the author designed vim to be at odds with the default Linux.
Does anyone have any ideas on how to get vim with su to behave as the
default Linux?
All answers appreciated.
Donald Gudehus