Verbose startup while avoiding File not found

From Vim Tips Wiki

Contents

I want to run Vim with 'verbose' set, but then it gives a lot of "file not found" messages at startup and closedown. I'd like to avoid those messages, while still seeing where an option was set whenever I interrogate its value.

Then, instead of 'set <optionName>', just use 'Set <optionName>' -- it would be better to change this function to do two things:

Save and restore the actual value of verbose instead of just assuming 0.

Extend it to take over the entire behaviour of the 'set' command (as it is, it always just echoes the value of the option and the file where the option was set).

However, those are left to the reader as an exercise (note that the first is very easy and the second might be a little more interesting, though quite simple, also).

Note that if one decides to indeed replace the built-in ':set' with this 'Set' (by placing all the functionality of ':set' into the function), then the following might be useful:

cab set Set

This will allow one to type ':set' in lower-case and still get the functionality desired.

Most "File not found" messages can be avoided by adding the corresponding file as a zero-length file in a :help after-directory. This, however, does not apply to toolbar icons (searched for at startup), since the internal icons are only used when external ones are not found; hence my notion of setting 'verbose' while running Vim but not during startup and closedown. I'm not saying my tip cures all problems just by itself, it would be too easy.

To display an option verbosely without setting 'verbose' permanently, use

:verbose set option?

hence, combining the above two user remarks, the idea of

:cabbrev Set verbose set

or even

:cabbrev set verbose set

Note: under Vim 7, several commands other than ":set" are affected by the 'verbose' setting, saying "what changed it latest" (and of course ":setlocal" and ":setglobal" already were in Vim 6). -- Tonymec 05:06, 6 January 2008 (UTC)