Re: Backspace and Delete in vi.



Steve Welsh wrote:

Nathan wrote:

It was set to "xterm" I changed it to vt100 with no change in result.

Robert Newson wrote:


Nathan wrote:


I need to interact with a number of Unix/Linux servers at work.  I
use putty as an SSH client to do so.
I use vi as my editor of choice.
On some of these servers, when i try to backspace, or delete, text in
VI, i end up with varied results.  Sometimes when i press the delete
key, it doesnt delete a character, rather, it capitalizes it. and
backspace generally does nothing.

Both keys work at the shell prompt, and in other full screen editors.
Why does this happen to me in vi?



At a guess, the term setting is wrong.

Pressing the DELETE key generates an esc sequence (ESC [ 3 ~) which
includes a TILDE (~) character - which is the convert char case
command of VI.

what's the value of:

$ echo $term

I've had it set (automatically) to ANSI and VI messed up as the
terminal being emulated was a VT100; changing it thus fixed the problem.

If I recall correctly, the correct key for deleting a single character
is 'X' in command mode. That works in every single `vi' or `vim'
environment I have ever used.

Not quite: it depends which character you mean to delete:

 lower case   x - delete character under cursor, unless at end of line, then
 upper case   X - delete character left of cursor.

However, vim allows use of the arrow keys, etc whilst in INPUT mode as it[1] spots the ESC sequence arriving in a very short space of time.

[1] more likely the library that VIM is using.



Steve



.



Relevant Pages

  • Re: Backspace and Delete in vi.
    ... Steve Welsh wrote: ... I use vi as my editor of choice. ... On some of these servers, when i try to backspace, or delete, text in VI, i end up with varied results. ... Both keys work at the shell prompt, and in other full screen editors. ...
    (comp.os.linux)
  • Re: MPro/Iconclipboard conflict?
    ... PC-style Delete (ie. Delete deletes forward, Backspace ... The editor itself probably doesn't by default: ... click menu over the window, ... tick 'PC style delete keys'. ...
    (comp.sys.acorn.apps)
  • Re: BETA4 Vi backspace behavior
    ... >>You all are right about the behavior of vi, but the backspace in vim is ... didn't have any way of actually deleting characters on the line. ... Look on the bright side, your editor may have bizarre commands, but it ...
    (freebsd-current)
  • Re: MPro/Iconclipboard conflict?
    ... (ie. Delete deletes forward, Backspace back). ... The editor itself ... click menu over the window, ... They took the radical step of actually making the keys do what they ...
    (comp.sys.acorn.apps)
  • bringing ee up to date
    ... -is a simple screen oriented text editor. ... +.\" To format this reference page, use the command: ... -Turn off display of information window at top of terminal. ... -.Ss "Control keys" ...
    (freebsd-hackers)