Vim Tips Wiki
Register
We recommend that you log in before editing. This will allow other users to leave you a message about your edit, and will let you track edits via your Watchlist. Creating an account is quick and free.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 20: Line 20:
   
 
There's also a bug in xterm (at least v224) that may bring other users into the same backspace problem. Here's the link: http://bugs.gentoo.org/show_bug.cgi?id=154090.
 
There's also a bug in xterm (at least v224) that may bring other users into the same backspace problem. Here's the link: http://bugs.gentoo.org/show_bug.cgi?id=154090.
 
If backspace doesn't work properly in insert mode, e.g. inserting '^?', try putting this your .bashrc:
 
<strong>stty erase '^?'</strong>
 
   
 
==Delete key problems==
 
==Delete key problems==
Line 79: Line 76:
 
*Ctrl-Backspace key combination emits &lt;Del> (127 or ^?)
 
*Ctrl-Backspace key combination emits &lt;Del> (127 or ^?)
   
I got it to work on my system by creating a .vimrc file in the home directory with the line:
 
set t_kb=^?
 
where for ^? I pressed backspace. Don't forget to open a new terminal window after your changes in .vimrc
 
 
On some Linux systems, pressing backspace in xterm or uxterm will move the cursor left (without deleting the character). To fix, add:
 
xterm.*backarrowKey: false
 
To your .Xresources file and run:
 
xrdb -merge ~/.Xresources
 
 
----
 
----
 
Alternatively, in .vimrc, type this:
 
"imap ^? ^H"
 
 
----
 
 
My terminal sends ^? for backspace and ^[[3~ for delete. To get these keys working in vim like they work in other programs, I put
 
<pre>
 
:set backspace=indent,eol,start
 
:set t_kb=^?
 
:set t_kD=^[[3~
 
</pre>
 
into my .vimrc. (Of course, using ^V <backspace> and ^V <delete> to insert the characters.)
 
Please note that all contributions to the Vim Tips Wiki are considered to be released under the CC-BY-SA
Cancel Editing help (opens in new window)

Templates used on this page: