![]() ![]() All of this means that for most cases with or without user vimrc, Vim will start in nocompatible mode with one important exception. #Macvim gvimr Patch#From Vim 8 (specifically patch ) also loads $RUNTIME/defaults.vim if it doesn't finds a user vimrc which will also turn on nocompatible (this file is loaded after /usr/share/vim/vimrc so it will overwrite any changes you may have made there). For example in my Ubuntu box, :scriptnames suggests that the file /usr/share/vim/vimrc file used which contains a line runtime! debian.vim at the top which means it sources $RUNTIME/debian.vim file. Many linux distros explicitly use set nocompatible. The last note is important since this is OS and distro dependent. Note that this does NOT happen when a system-wide vimrc file was found. Then the option will be set to 'nocompatible'. The "-clean" command line argument is given, or The "-N" command line argument is given, or The "VIMINIT" environment variable is set, or From the manual:Ī vimrc file in the current directory is found, or In particular, the compatible-default section outlines under what conditions compatible is turned off and when it isn't. I strongly suggest everyone who're not already familiar with it to carefully read the help sections for compatible and compatible-default. There are a lot of more subtle aspects to this. #Macvim gvimr manual#So the side effects part in the manual stands for both set compatible and set nocompatible No it's not a noop, unless you set nocp before any other option, which at least in my case i put that in the middle of my vimrc after other options, which indeed reset other compatibility mode affected optionsįor instance: :echo &history " Should yield 50 if you left as default Having nocp inside a vimrc is a NO-OP because it was already reset by the presence of the file If you set this option in your vimrc file, you NOTE: Setting or resetting this option can have a lot of unexpectedĮffects: Mappings are interpreted in another way, undo behavesĭifferently, etc. ![]() Other options are also changed as a side effect. This is a special kind of option, because when it's set or reset, vimrc after other options you might risk causing other unwanted side effectsįrom the manual Note that creating a vimrc file will cause the 'compatible' option to be off Moreover if you manually (arbitrarily) add it to your. vimrc file makes vim automatically turn off vi compatibility. ![]() This is an instance where could have easily caught it had i been actually reading the manual instead of skimming it. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |