Re: vi customization problem
- Check the output of stty:
Code:
$ stty -g|cut -d: -f7
7f
or the same in human readable form:
Code:
$ stty -a|sed -n 's/.* \(erase [^;]*\).*/\1/p'
For stty from GNU coreutils this should give For stty on Solaris (and probably on AIX, too): - Check that the mapping is set up properly:
Code:
$ cat ~/.exrc|tr \\b @|sed -n '/:map.* @$/p'|od -cAn
: m a p ! 177 @ \n
You should get similar output.
Re: vi customization problem
Quote:
Originally Posted by
schragge
Check the output of stty:
Code:
$ stty -g|cut -d: -f7
-> This gave me 'ff'
Quote:
or the same in human readable form:
Code:
$ stty -a|sed -n 's/.* \(erase [^;]*\).*/\1/p'
On AIX -> ' erase = ^? '
Quote:
Check that the mapping is set up properly:
Code:
$ sed -n '/\ch/p' ~/.exrc|od -aAn
: m a p ! sp del sp bs nl
You should get the same output.
I haven't really set any mappings in .exrc.
The problem is when I do 'vi .exrc'
and type 'map <backspace> ', it moves my cursor one step left to the space. It doesn't put anything after the word map.
So I was wondering since backspace is acting like an 'h' or 'left arrow', how do I represent it as text?
In the insert mode: backspace = move cursor one step leftdel = Change case of character
In the command mode: backspace = function of delete or xdel = Change case of character
This is very weird. :confused:
Re: vi customization problem
In vi, you enter any control character by quoting it with Ctrl+V (e.g. see this answer). This means: to enter <backspace>, press Ctrl+V Backspace, to enter ^H press Ctrl+V Ctrl+H.
Another thought. I've compiled and installed the traditional vi. Backspace in it actually deletes characters left of the cursor, although they remain displayed until you exit the insert mode by pressing Esc. This is even documented in the tutorial:
Quote:
Notice that when you backspace during an insertion the characters you backspace over are not erased; the cursor moves backwards, and the characters remain on the display. This is often useful if you are planning to type in something similar. In any case the characters disappear when you hit ESC; if you want to get rid of them immediately, hit an ESC and then a again.
I can also observe the same behaviour in nvi.
Re: vi customization problem
Thanks you for the help :)
I just realized that my vi has the same behavior (it is version 5 something).
What I now know is that my delete key puts a ~ in the insert mode, and changes the case in command mode.
My backspace key in insert mode moves my cursor one left and deletes the character on the cursor (although it will reflect AFTER a mode switch), and in my command mode, it does what Ctrl+x does, i.e., erase character under cursor.
But when I used vim, backspace and delete worked just as commands in real time at insert mode (a backspace reflected a backspace and del could do what Ctrl+x does).
Can I possible do that in traditional vi?
I would also like to map an 'Esc+\' to a 'Tab+Tab', to auto-complete the way it is done in bash.
Thanks,