Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've just installed Solaris 11 Express, and I can't for the life of me work out how to get vim to backspace correctly.

The backspace key works fine at the normal console.

However, under vim, it simple goes back a character, but doesn't actually delete anything.

I've tried :set bs=2, no luck.

I've tried both the included system vim (/usr/bin/vim) and OpenCSW vim (/opt/csw/bin/vim).

I've tried setting the TERM to "xterm" or "xterm-color", no change. I've pasted my termcap file here:

http://paste.pocoo.org/show/452455/

Any ideas? =(

Cheers, Victor

share|improve this question
    
Does it work if you use CTRL-H? –  Frands Hansen Aug 4 '11 at 10:30
    
@fbh: Hmm, nope, Ctrl-H simply goes to the left one character as well. The weird things is, the console backspace works fine, just not in vim. –  victorhooi Aug 4 '11 at 23:47
add comment

3 Answers

It's likely that you're actually running vi (which is symlinked when you try to invoke vim). In vi to the best of my knowledge, in insert mode, you can't backspace stuff you didn't just type (in that insert erm... 'session'). In command mode, hitting backspace has always just moved the cursor back one character. To delete you're supposed to be using x aren't you?

share|improve this answer
    
Hmm, I'm fairly sure it's the vim binary - "file /opt/csw/bin/vim" returns "ELF 32-bit LSB executable 80386 Version 1 [FPU], dynamically linked, stripped", and ls reports a 1.8 Mb binary. –  victorhooi Aug 4 '11 at 23:46
add comment

You should try the Vim from www.sunfreeware.com, to see whether it's a environment problem or the problem of Vim you installed.

Try ssh from another Linux/UNIX to your computer and use Vim, see what happens.

share|improve this answer
add comment

Hmm, what user90483 said. I have the same behavior with vi/vim under Linux. Backspace won't actually delete anything unless you're in edit mode, not command mode. Are you in the right mode? If I hit "i", the backspace will delete things. If I hit "esc" at that point, backspace is equivalent to the "h" key and moves the cursor to the left.

Also, if you're using vi correctly, in the terminal, can you issue "stty erase " followed by ctrl-v and then the backspace key, then hit enter, before trying vim? This has the feel of the terminal "erase" being mishandled by vim; your shell may be compensating for all types of backspace signals.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.