0

When I first started, I cannot use backspace to delete chars just like in windows. Then I found a solution that to modify the config file (/etc/vim/vimrc & vimrc.tiny).

This solution enables me to use the backspace to delete the chars I typed in the current file. But I still can not delete the original chars. (Original chars means the content that already exists in the file before I open it.)

E.g., there is file named 1.txt, its content:

abc

Then I open it, typing in three new chars: def, the content in this file is:

abcdef

When I use backspace to delete these chars.

I can delete def, but when the cursor comes to the char c, or b, or a.

It just does not work.

Any help from you will be highly appreciated.

1
  • And what was your solution involving the config files?
    – Ben
    Commented Nov 9, 2014 at 13:44

1 Answer 1

3

You need to set the 'backspace' option. Put the following in your ~/.vimrc:

set backspace=indent,eol,start

You also should also be using ~/.vimrc instead of /etc/vim/vimrc.

Please take a look at the following:

:h 'backspace'
:h vimrc-intro
:h vimrc_example.vim
3
  • Really appreciate your response. But I can find the file "~/.vimrc". And I was confused by "using ~/.vimrc instead of /etc/vim/vimrc"? How? Commented Dec 3, 2014 at 15:08
  • 1
    ~/.vimrc is where your personal .vimrc resides on a unix like platform. /etc/vim/vimrc is the system's vimrc which will be used as the default for any user w/o their own vimrc. This file maybe be overridden when upgrading vim. You can edit your vimrc by doing the following :e $MYVIMRC. For more vimrc information see: :h vimrc Commented Dec 3, 2014 at 15:33
  • Really thanks. There is no .vimrc file under my home directory. Just add it. Commented Dec 4, 2014 at 14:35

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