0

In both command line vim and gvim alike, I have a situation where the backspace functionality behaves like some of my old vi experiences.

If I press backspace in edit mode, the character is not erased until I return to command mode. If I start with vim -u NONE -N or vim -u NORC -N, then backspace behaves as I would expect.

I tried isolating the problem in my vimrc by placing finish above the lines until the problem was fixed; however, even after placing finish on the top line, the behavior persists.

My vimrc is here: http://pastie.org/9602002

The last line was just added today by suggestion of the wiki, but it offered no behavior change. It seems like the problem exists outside my vimrc, but I have no idea where.

EDIT: I have isolated the issue. It appears vim -N is all that is required to mitigate this issue. Is there a way to set no-compatible mode from vimrc?

2
  • What is the output of verbose set backspace?. The backspace setting should fix this.
    – FDinoff
    Sep 28, 2014 at 17:15
  • backspace=indent,eol,start
    – 2mac
    Sep 28, 2014 at 17:19

1 Answer 1

0

Adding set nocompatible in vimrc appears to have resolved the issue.

For some reason, this wasn't being set when the vimrc was loaded.

EDIT: nocompatible is only set when loading a user rc file (~/.vimrc) and not a global one. If you use the global vimrc, you must set nocompatible yourself; otherwise, it will be set for you.

3
  • 1
    For "some" reason? You don't have a vimrc. Your vimrc should be there: ~/.vimrc.
    – romainl
    Sep 28, 2014 at 19:34
  • That isn't correct. I use the global one in /etc/vimrc or /etc/vim/vimrc depending on the distro. I had talked this over with #vim on Freenode, and they found it perplexing as well.
    – 2mac
    Sep 28, 2014 at 22:47
  • nocompatible is only set automatically when a user vimrc is found. Since you don't have one there is no reason to expect it to happen. Your settings are supposed to go in ~/.vimrc (and ~/.vim/vimrc if you use 7.4) and nowhere else.
    – romainl
    Sep 29, 2014 at 5:18

You must log in to answer this question.

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