Backspace key not working in Vim/vi

vim

Solution

To allow backspacing over everything in insert mode (including automatically inserted indentation, line breaks and start of insert) you can set the `backspace` option:

:set backspace=indent,eol,start

or

:set backspace=2  "compatible with version 5.4 and earlier

By default this option is empty, not allowing you to backspace over the above-mentioned things. This is the standard Vi behavior.

You can put this line to your `vimrc` file to have it set automatically when Vim starts:

set backspace=indent,eol,start  " more powerful backspacing

Also, starting from Vim 8.0 if no user vimrc file is found, Vim will set `backspace` to this value by loading the `defaults.vim` script.

Problem

I just did some changes to the `.vimrc` file and `.bash_aliases` file and from that time I can't delete words with backspace key. My `.vimrc` file has: ``` set nocompatible set number set incsearch set autoindent set ruler set autowrite set smarttab set linebreak set spell set et set title set mouse=v set history=50 set tabstop=4 set matchtime=2 set matchpairs+=<:> syntax enable filetype plugin indent on filetype indent on set sw=4 map <f2> :w\|!python % hi SpellBad ctermfg=000 guifg=#000 ``` And my `.bash_aliases` file has two line for Vim: ``` alias vim="vim -c 'startinsert' -u ~/.vim/.vimrc" alias vi="vi -c 'startinsert' -u ~/.vim/.vimrc" ``` My `~/.vim` directory doesn't have a single plugin or script, so there's isn't any chance that plugin will cause this. `~/.vim/.vimrc` is a symlink. The actual `.vimrc` file is in `~/vimrc/` directory which is a git repository.

Original source

Related problems