of the original file with the string in the 'patchmode' option
appended. This option should start with a dot. Use a string like
".orig" or ".org". 'backupdir' must not be empty for this to work
(Detail: The backup file is renamed to the patchmode file after the
new file has been successfully written, that's why it must be possible
to write a backup file). If there was no file to be backed up, an
empty file is created.
When the 'backupskip' pattern matches, a patchmode file is not made.
Using 'patchmode' for compressed files appends the extension at the
end (e.g., "file.gz.orig"), thus the resulting name isn't always
recognized as a compressed file.
Only normal file name characters can be used, `/\*?[|<>` are illegal.
*'path'* *'pa'* *E343* *E345* *E347* *E854*
'path' 'pa' string (default ".,,")
global or local to buffer |global-local|
This is a list of directories which will be searched when using the
|gf|, [f, ]f, ^Wf, |:find|, |:sfind|, |:tabfind| and other commands,
provided that the file being searched for has a relative path (not
starting with "/", "./" or "../"). The directories in the 'path'
option may be relative or absolute.
- Use commas to separate directory names: >vim
set path=.,/usr/local/include,/usr/include
< - Spaces can also be used to separate directory names. To have a
space in a directory name, precede it with an extra backslash, and
escape the space: >vim
set path=.,/dir/with\\\ space
< - To include a comma in a directory name precede it with an extra
backslash: >vim
set path=.,/dir/with\\,comma
< - To search relative to the directory of the current file, use: >vim
set path=.
< - To search in the current directory use an empty string between two
commas: >vim
set path=,,
< - A directory name may end in a ':' or '/'.
- Environment variables are expanded |:set_env|.
- When using |netrw| URLs can be used. For example, adding
"https://www.vim.org" will make ":find index.html" work.
- Search upwards and downwards in a directory tree using "*", "**" and
";". See |file-searching| for info and syntax.
- Careful with '\' characters, type two to get one in the option: >vim
set path=.,c:\\include
< Or just use '/' instead: >vim
set path=.,c:/include
< Don't forget "." or files won't even be found in the same directory as
the file!
The maximum length is limited. How much depends on the system, mostly
it is something like 256 or 1024 characters.
You can check if all the include files are found, using the value of
'path', see |:checkpath|.
The use of |:set+=| and |:set-=| is preferred when adding or removing
directories from the list. This avoids problems when a future version
uses another default. To remove the current directory use: >vim
set path-=
< To add the current directory use: >vim
set path+=
< To use an environment variable, you probably need to replace the
separator. Here is an example to append $INCL, in which directory
names are separated with a semicolon: >vim
let &path = &path .. "," .. substitute($INCL, ';', ',', 'g')
< Replace the ';' with a ':' or whatever separator is used. Note that
this doesn't work when $INCL contains a comma or white space.
*'preserveindent'* *'pi'* *'nopreserveindent'* *'nopi'*
'preserveindent' 'pi' boolean (default off)
local to buffer
When changing the indent of the current line, preserve as much of the
indent structure as possible. Normally the indent is replaced by a
series of tabs followed by spaces as required (unless |'expandtab'| is
enabled, in which case only spaces are used). Enabling this option
means the indent will preserve as many existing characters as possible
for indenting, and only add additional tabs or spaces as required.
'expandtab' does not apply to the preserved white space, a Tab remains
a Tab.
NOTE: When using ">>" multiple times the resulting indent is a mix of
tabs and spaces. You might not like this.
Also see 'copyindent'.
Use |:retab| to clean