5

I already have a .vimrc in my home dirrectory(~). but still I need to use set nocompatible in my vimrc for certain feature.

Jens
  • 69,818
  • 15
  • 125
  • 179
ravi
  • 3,304
  • 6
  • 25
  • 27
  • You need to use your system wide vimrc for a certain feature? Which one? – Joel Burget Aug 11 '11 at 15:47
  • corrected the post...I need to use set nocompatible so that on pressing arrow it does not put garbage characters('A','B',...) – ravi Aug 11 '11 at 16:15
  • @ravi Also see this question [In a .vimrc, is `set nocompatible` completely useless?](http://stackoverflow.com/questions/5845557/in-a-vimrc-is-set-nocompatible-completely-useless) – Johnny Baloney Nov 07 '13 at 10:50

1 Answers1

9

Note: This answer was rewritten after Jens pointed out that I totally screwed it up. My thanks to him for the correction.

It's in the docs. The system vimrc file (often found in /etc/vimrc or /etc/vim/vimrc) performs the system-wide default initializations. Following that, vim looks in 4 different places for user-specific initializations, one of which is ~/.vimrc (this is described in the next section of the docs). The first of those that exists is used, the others are ignored.

Peter Rowell
  • 17,605
  • 2
  • 49
  • 65
  • 3
    That's just plain wrong. That section does only refer to where the user specific initialization is looked for. The section right above that one says something about the system vimrc. It is common to have system vimrc set up by the OS vendor and the user place personal settings in `~/.vimrc`. – Jens Aug 29 '11 at 10:21
  • 1
    @Jens: You are 100% correct. My apologies. This kind of bad answer is what I get for doing a quick-and-dirty. I was going to delete this answer, but since it's the only one I thought it would be better to make it correct. – Peter Rowell Aug 29 '11 at 17:12