(default "tcqj")
local to buffer
This is a sequence of letters which describes how automatic
formatting is to be done.
See |fo-table| for possible values and |gq| for how to format text.
Commas can be inserted for readability.
To avoid problems with flags that are added in the future, use the
"+=" and "-=" feature of ":set" |add-option-flags|.
*'formatprg'* *'fp'*
'formatprg' 'fp' string (default "")
global or local to buffer |global-local|
The name of an external program that will be used to format the lines
selected with the |gq| operator. The program must take the input on
stdin and produce the output on stdout. The Unix program "fmt" is
such a program.
If the 'formatexpr' option is not empty it will be used instead.
Otherwise, if 'formatprg' option is an empty string, the internal
format function will be used |C-indenting|.
Environment variables are expanded |:set_env|. See |option-backslash|
about including spaces and backslashes.
This option cannot be set from a |modeline| or in the |sandbox|, for
security reasons.
*'fsync'* *'fs'* *'nofsync'* *'nofs'*
'fsync' 'fs' boolean (default on)
global
When on, the OS function fsync() will be called after saving a file
(|:write|, |writefile()|, …), |swap-file|, |undo-persistence| and |shada-file|.
This flushes the file to disk, ensuring that it is safely written.
Slow on some systems: writing buffers, quitting Nvim, and other
operations may sometimes take a few seconds.
Files are ALWAYS flushed ('fsync' is ignored) when:
- |CursorHold| event is triggered
- |:preserve| is called
- system signals low battery life
- Nvim exits abnormally
This option cannot be set from a |modeline| or in the |sandbox|, for
security reasons.
*'gdefault'* *'gd'* *'nogdefault'* *'nogd'*
'gdefault' 'gd' boolean (default off)
global
When on, the ":substitute" flag 'g' is default on. This means that
all matches in a line are substituted instead of one. When a 'g' flag
is given to a ":substitute" command, this will toggle the substitution
of all or one match. See |complex-change|.
command 'gdefault' on 'gdefault' off ~
:s/// subst. all subst. one
:s///g subst. one subst. all
:s///gg subst. all subst. one
NOTE: Setting this option may break plugins that rely on the default
behavior of the 'g' flag. This will also make the 'g' flag have the
opposite effect of that documented in |:s_g|.
*'grepformat'* *'gfm'*
'grepformat' 'gfm' string (default "%f:%l:%m,%f:%l%m,%f %l%m")
global or local to buffer |global-local|
Format to recognize for the ":grep" command output.
This is a scanf-like string that uses the same format as the
'errorformat' option: see |errorformat|.
If ripgrep ('grepprg') is available, this option defaults to `%f:%l:%c:%m`.
*'grepprg'* *'gp'*
'grepprg' 'gp' string (default see below)
global or local to buffer |global-local|
Program to use for the |:grep| command. This option may contain '%'
and '#' characters, which are expanded like when used in a command-
line. The placeholder "$*" is allowed to specify where the arguments
will be included. Environment variables are expanded |:set_env|. See
|option-backslash| about including spaces and backslashes.
Special value: When 'grepprg' is set to "internal" the |:grep| command
works like |:vimgrep|, |:lgrep| like |:lvimgrep|, |:grepadd| like
|:vimgrepadd| and |:lgrepadd| like |:lvimgrepadd|.
See also the section |:make_makeprg|, since most of the comments there
apply equally to 'grepprg'.
This option cannot be set from a |modeline| or in the |sandbox|, for
security reasons.
This option defaults to:
- `rg --vimgrep -uu ` if ripgrep is available (|:checkhealth|),
- `grep -HIn $* /dev/null` on Unix,
- `findstr /n $* nul` on Windows.
Ripgrep can perform additional filtering such as using .gitignore rules
and skipping hidden files. This is disabled by default (see the -u option)
to more closely match the behaviour