Django, Python, & Random Leftovers

Fixing vim backspace

Posted: September 9, 2008
Author: Scott Newman
Category: Linux

While installing my new Slicehost server today, I ran across a problem with the vim editor that took me a long time to solve. I couldn't use backspace in insert mode.

The fix turned out to be very simple. Create a .vimrc file in your home directory, and add these lines:

inoremap ^? ^H
set t_kb=^H
set t_kD=^?

With this in place, everything works as expected again. I hope this saves someone the trouble I went through!

By the way: If you're an old salt like I am, create an alias so that 'vi' launches the vim editor. In your /etc/profile or ~/.bashrc file:

alias vi=vim

Articles by Category
Python, Django, Subversion, Mac, Linux, PHP, PostgreSQL