Home Explore Blog CI



neovim

2nd chunk of `runtime/doc/options.txt`
0723c04fcc0eb212f2371a6960791a0eb5cedf03f5f0535f0000000100000fa5
	Subtract the {value} from a number option, or remove
			the {value} from a string option, if it is there.
			If the {value} is not found in a string option, there
			is no error or warning.  When the option is a comma-
			separated list, a comma is deleted, unless the option
			becomes empty.
			When the option is a list of flags, {value} must be
			exactly as they appear in the option.  Remove flags
			one by one to avoid problems.
			The individual values from a comma separated list or
			list of flags can be inserted by typing 'wildchar'.
			See |complete-set-option|.
			Also see |:set-args| above.

The {option} arguments to ":set" may be repeated.  For example: >
	:set ai nosi sw=3 ts=3
If you make an error in one of the arguments, an error message will be given
and the following arguments will be ignored.

							*:set-verbose*
When 'verbose' is non-zero, displaying an option value will also tell where it
was last set.  Example: >
	:verbose set shiftwidth cindent?
<  shiftwidth=4 ~
	  Last set from modeline line 1 ~
  cindent ~
	  Last set from /usr/local/share/vim/vim60/ftplugin/c.vim line 30 ~
This is only done when specific option values are requested, not for ":verbose
set all" or ":verbose set" without an argument.
When the option was set by hand there is no "Last set" message.
When the option was set while executing a function, user command or
autocommand, the script in which it was defined is reported.
A few special texts:
	Last set from modeline line 1 ~
		Option was set in a |modeline|.
	Last set from --cmd argument ~
		Option was set with command line argument |--cmd| or +.
	Last set from -c argument ~
		Option was set with command line argument |-c|, +, |-S| or
		|-q|.
	Last set from environment variable ~
		Option was set from $VIMINIT.
	Last set from error handler ~
		Option was cleared when evaluating it resulted in an error.

							*option-backslash*
To include white space in a string option value it has to be preceded with a
backslash.  To include a backslash you have to use two.  Effectively this
means that the number of backslashes in an option value is halved (rounded
down).
In options 'path', 'cdpath', and 'tags', spaces have to be preceded with three
backslashes instead because they can be separated by either commas or spaces.
Comma-separated options like 'backupdir' and 'tags' will also require commas
to be escaped with two backslashes, whereas this is not needed for
non-comma-separated ones like 'makeprg'.
When setting options using |:let| and |literal-string|, you need to use one
fewer layer of backslash.
A few examples: >
   :set makeprg=make\ file	    results in "make file"
   :let &makeprg='make file'	    (same as above)
   :set makeprg=make\\\ file	    results in "make\ file"
   :set tags=tags\ /usr/tags	    results in "tags" and "/usr/tags"
   :set tags=tags\\\ file	    results in "tags file"
   :let &tags='tags\ file'	    (same as above)

   :set makeprg=make,file	    results in "make,file"
   :set makeprg=make\\,file	    results in "make\,file"
   :set tags=tags,file		    results in "tags" and "file"
   :set tags=tags\\,file	    results in "tags\,file"
   :let &tags='tags\,file'	    (same as above)

The "|" character separates a ":set" command from a following command.  To
include the "|" in the option value, use "\|" instead.  This example sets the
'titlestring' option to "hi|there": >
   :set titlestring=hi\|there
This sets the 'titlestring' option to "hi" and 'iconstring' to "there": >
   :set titlestring=hi|set iconstring=there

Similarly, the double quote character starts a comment.  To include the '"' in
the option value, use '\"' instead.  This example sets the 'titlestring'
option to "hi "there"": >
   :set titlestring=hi\ \"there\"

For Win32 backslashes in file names are mostly not removed.  More precise: For
options that expect a file name (those where environment variables are
expanded) a backslash before a normal file name character is not removed.  But
a backslash before a special

Title: Advanced Option Handling in Vim
Summary
This section delves into the more nuanced aspects of handling options in Vim. It covers removing values from options using `:set-=`, including specific instructions for comma-separated lists and flags. It explains how to repeat options in the `:set` command and how errors are handled. The section also details the `:set-verbose` option, which displays where an option was last set, including special cases like modelines, command-line arguments, and environment variables. It includes information on how to include special characters (white space, backslashes, commas, |, and ") in option values using backslashes. Finally, it mentions the handling of backslashes in filenames on Win32 systems.