0

I have a Ubuntu 12.04 OS. I installed vi and vim, but the backspace doesn't work properly. It is doing the same thing that delete key do.

I am expecting the backspace key to delete a character backwards, but it deletes forwards. I did some search on the Internet, there are too much suggestions for changing the .vimrc file, but non of them worked for me.

Is there anybody who has the same issue?

3 Answers3

0

As explained in answer SO/a/10197995/1699311, you have to correct your terminal setting.
However, if you really want to stick with incorrect terminal behaviour (which will affect some other programs) you can instruct Vim to accommodate with that with :fixdel (it internally swap Backspace and Delete keys.)
All the previous suppose you don't have some mapping on that key.

gildux
  • 448
  • 6
  • 12
-1

Try adding the following to your .vimrc file, which would correct the behavior of the backspace key:

set backspace=2

Also, you can execute it inside vi/vim command mode:

:set backspace=2

Additionally, here is more information and solutions if this doesn't work for you: http://vim.wikia.com/wiki/Backspace_and_delete_problems

Tabiko
  • 353
  • 1
  • 3
  • 8
-1

If your backspaces deletes forward you can use the command in vimrc file as shown below

set backspace=2

now on the vi command mode do the follwoing to re-excecute the .vimrc file

:so %

To know which .vimrc file is being read do the following

:echo $MYVIMRC
Stryker
  • 5,732
  • 1
  • 57
  • 70