A set of Vim options is installed (i.e. the material you control with :set ). But plugins use variables, usually called g:PluginName_OptionName or so, to get something very close to the parameters. With different areas of variables ( g: b: w: you can even achieve something like parameters associated with a buffer or window in Vim: this means that the plugin first checks for the presence of a local variable, and returns to using the global variable, if local does not exist.
Plugins must provide default values ββfor their configuration variables, which can be overridden by the user .vimrc . This is achieved using a test similar to this:
if ! exists('g:PluginName_ConfigItem') let g:PluginName_ConfigItem = 'default value' endif
If you plan to publish your plugin, be sure to document the variables and what values ββthey may contain.
source share