0

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

2
  • Does it work if you use CTRL-H? Aug 4, 2011 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, 2011 at 23:47

3 Answers 3

1

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?

1
  • 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, 2011 at 23:46
0

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.

0

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .