Monday, June 06, 2005

Backspace + Screen + Vim + PuTTy in FreeBSD

If you use putty to ssh to FreeBSD, you will notice the backspace key won't work in vim in insert mode. The easiest solution is set the backspace to Ctrl-? in your putty setting.

Now when you starting working with gnu screen, you will met another problem. The Ctrl-? backspace now shows as ~ in your shell prompt. If you set the putty back the Ctrl-H, it will works again.

So what should we do if we want to use vim inside screen, through PuTTy in a FreeBSD environment? The solution is, use Ctrl-H in your PuTTy, and add the following code to your .vimrc file:

:if &term == "termname"
: set t_kb=^V
: fixdel
:endif

The above code is copied from vimdoc.

3 comments:

Mario Ponce said...

I just appended these line to my vimrc:

set backspace=2

Anonymous said...

set backspace=2 worked fine, thanks!

Anonymous said...

Thank you, this worked perfectly! I was having this issue when using vim inside of screen. Using "screen" for "termname" resolved it. Adding this comment so that people searching for GNU screen might find this post as well.