aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/options.lua
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/options.lua')
-rw-r--r--src/nvim/options.lua1202
1 files changed, 729 insertions, 473 deletions
diff --git a/src/nvim/options.lua b/src/nvim/options.lua
index 9f86ef7489..dcd6e0a58b 100644
--- a/src/nvim/options.lua
+++ b/src/nvim/options.lua
@@ -7,13 +7,16 @@
--- @field alias? string|string[]
--- @field short_desc? string|fun(): string
--- @field varname? string
---- @field type vim.option_type|vim.option_type[]
+--- @field flags_varname? string
+--- @field type vim.option_type
--- @field immutable? boolean
--- @field list? 'comma'|'onecomma'|'commacolon'|'onecommacolon'|'flags'|'flagscomma'
--- @field scope vim.option_scope[]
--- @field deny_duplicates? boolean
--- @field enable_if? string
---- @field defaults? vim.option_defaults
+--- @field defaults? vim.option_defaults|vim.option_value|fun(): string
+--- @field values? vim.option_valid_values
+--- @field flags? true|table<string,integer>
--- @field secure? true
--- @field noglob? true
--- @field normal_fname_chars? true
@@ -27,7 +30,11 @@
--- @field no_mkrc? true
--- @field alloced? true
--- @field redraw? vim.option_redraw[]
+---
+--- If not provided and `values` is present, then is set to 'did_set_str_generic'
--- @field cb? string
+---
+--- If not provided and `values` is present, then is set to 'expand_set_str_generic'
--- @field expand_cb? string
--- @field tags? string[]
@@ -35,14 +42,15 @@
--- @field condition? string
--- string: #ifdef string
--- !string: #ifndef string
---- @field if_true integer|boolean|string|fun(): string
---- @field if_false? integer|boolean|string
+--- @field if_true vim.option_value|fun(): string
+--- @field if_false? vim.option_value
--- @field doc? string Default to show in options.txt
---- @field meta? integer|boolean|string Default to use in Lua meta files
+--- @field meta? string Default to use in Lua meta files
--- @alias vim.option_scope 'global'|'buf'|'win'
--- @alias vim.option_type 'boolean'|'number'|'string'
---- @alias vim.option_value boolean|number|string
+--- @alias vim.option_value boolean|integer|string
+--- @alias vim.option_valid_values (string|[string,vim.option_valid_values])[]
--- @alias vim.option_redraw
--- |'statuslines'
@@ -78,7 +86,7 @@ local function N_(s) -- luacheck: ignore 211 (currently unused)
end
-- luacheck: ignore 621
-return {
+local options = {
cstr = cstr,
--- @type string[]
valid_scopes = { 'global', 'buf', 'win' },
@@ -87,7 +95,7 @@ return {
options = {
{
abbreviation = 'al',
- defaults = { if_true = 224 },
+ defaults = 224,
full_name = 'aleph',
scope = { 'global' },
short_desc = N_('ASCII code of the letter Aleph (Hebrew)'),
@@ -96,7 +104,7 @@ return {
},
{
abbreviation = 'ari',
- defaults = { if_true = false },
+ defaults = false,
desc = [=[
Allow CTRL-_ in Insert mode. This is default off, to avoid that users
that accidentally type CTRL-_ instead of SHIFT-_ get into reverse
@@ -111,7 +119,8 @@ return {
{
abbreviation = 'ambw',
cb = 'did_set_ambiwidth',
- defaults = { if_true = 'single' },
+ defaults = 'single',
+ values = { 'single', 'double' },
desc = [=[
Tells Vim what to do with characters with East Asian Width Class
Ambiguous (such as Euro, Registered Sign, Copyright Sign, Greek
@@ -144,7 +153,6 @@ return {
set to one of CJK locales. See Unicode Standard Annex #11
(https://www.unicode.org/reports/tr11).
]=],
- expand_cb = 'expand_set_ambiwidth',
full_name = 'ambiwidth',
redraw = { 'all_windows', 'ui_option' },
scope = { 'global' },
@@ -155,7 +163,7 @@ return {
{
abbreviation = 'arab',
cb = 'did_set_arabic',
- defaults = { if_true = false },
+ defaults = false,
desc = [=[
This option can be set to start editing Arabic text.
Setting this option will:
@@ -180,7 +188,7 @@ return {
},
{
abbreviation = 'arshape',
- defaults = { if_true = true },
+ defaults = true,
desc = [=[
When on and 'termbidi' is off, the required visual character
corrections that need to take place for displaying the Arabic language
@@ -205,7 +213,7 @@ return {
{
abbreviation = 'acd',
cb = 'did_set_autochdir',
- defaults = { if_true = false },
+ defaults = false,
desc = [=[
When on, Vim will change the current working directory whenever you
open a file, switch buffers, delete a buffer or open/close a window.
@@ -222,7 +230,7 @@ return {
},
{
abbreviation = 'ai',
- defaults = { if_true = true },
+ defaults = true,
desc = [=[
Copy indent from current line when starting a new line (typing <CR>
in Insert mode or when using the "o" or "O" command). If you do not
@@ -244,7 +252,7 @@ return {
},
{
abbreviation = 'ar',
- defaults = { if_true = true },
+ defaults = true,
desc = [=[
When a file has been detected to have been changed outside of Vim and
it has not been changed inside of Vim, automatically read it again.
@@ -264,7 +272,7 @@ return {
},
{
abbreviation = 'aw',
- defaults = { if_true = false },
+ defaults = false,
desc = [=[
Write the contents of the file, if it has been modified, on each
`:next`, `:rewind`, `:last`, `:first`, `:previous`, `:stop`,
@@ -289,7 +297,7 @@ return {
},
{
abbreviation = 'awa',
- defaults = { if_true = false },
+ defaults = false,
desc = [=[
Like 'autowrite', but also used for commands ":edit", ":enew", ":quit",
":qall", ":exit", ":xit", ":recover" and closing the Vim window.
@@ -305,7 +313,8 @@ return {
{
abbreviation = 'bg',
cb = 'did_set_background',
- defaults = { if_true = 'dark' },
+ defaults = 'dark',
+ values = { 'light', 'dark' },
desc = [=[
When set to "dark" or "light", adjusts the default color groups for
that background type. The |TUI| or other UI sets this on startup
@@ -330,7 +339,6 @@ return {
will change. To use other settings, place ":highlight" commands AFTER
the setting of the 'background' option.
]=],
- expand_cb = 'expand_set_background',
full_name = 'background',
scope = { 'global' },
short_desc = N_('"dark" or "light", used for highlight colors'),
@@ -340,7 +348,8 @@ return {
{
abbreviation = 'bs',
cb = 'did_set_backspace',
- defaults = { if_true = 'indent,eol,start' },
+ defaults = 'indent,eol,start',
+ values = { 'indent', 'eol', 'start', 'nostop' },
deny_duplicates = true,
desc = [=[
Influences the working of <BS>, <Del>, CTRL-W and CTRL-U in Insert
@@ -357,7 +366,6 @@ return {
When the value is empty, Vi compatible backspacing is used, none of
the ways mentioned for the items above are possible.
]=],
- expand_cb = 'expand_set_backspace',
full_name = 'backspace',
list = 'onecomma',
scope = { 'global' },
@@ -367,7 +375,7 @@ return {
},
{
abbreviation = 'bk',
- defaults = { if_true = false },
+ defaults = false,
desc = [=[
Make a backup before overwriting a file. Leave it around after the
file has been successfully written. If you do not want to keep the
@@ -390,6 +398,8 @@ return {
abbreviation = 'bkc',
cb = 'did_set_backupcopy',
defaults = { condition = 'UNIX', if_false = 'auto', if_true = 'auto' },
+ values = { 'yes', 'auto', 'no', 'breaksymlink', 'breakhardlink' },
+ flags = true,
deny_duplicates = true,
desc = [=[
When writing a file and a backup is made, this option tells how it's
@@ -455,17 +465,17 @@ return {
the system may refuse to do this. In that case the "auto" value will
again not rename the file.
]=],
- expand_cb = 'expand_set_backupcopy',
full_name = 'backupcopy',
list = 'onecomma',
scope = { 'global', 'buf' },
short_desc = N_("make backup as a copy, don't rename the file"),
type = 'string',
varname = 'p_bkc',
+ flags_varname = 'bkc_flags',
},
{
abbreviation = 'bdir',
- defaults = { if_true = '' },
+ defaults = '',
deny_duplicates = true,
desc = [=[
List of directories for the backup file, separated with commas.
@@ -521,7 +531,7 @@ return {
{
abbreviation = 'bex',
cb = 'did_set_backupext_or_patchmode',
- defaults = { if_true = '~' },
+ defaults = '~',
desc = [=[
String which is appended to a file name to make the name of the
backup file. The default is quite unusual, because this avoids
@@ -585,8 +595,30 @@ return {
},
{
abbreviation = 'bo',
- cb = 'did_set_belloff',
- defaults = { if_true = 'all' },
+ defaults = 'all',
+ values = {
+ 'all',
+ 'backspace',
+ 'cursor',
+ 'complete',
+ 'copy',
+ 'ctrlg',
+ 'error',
+ 'esc',
+ 'ex',
+ 'hangul',
+ 'insertmode',
+ 'lang',
+ 'mess',
+ 'showmatch',
+ 'operator',
+ 'register',
+ 'shell',
+ 'spell',
+ 'term',
+ 'wildmode',
+ },
+ flags = true,
deny_duplicates = true,
desc = [=[
Specifies for which events the bell will not be rung. It is a comma-
@@ -626,18 +658,18 @@ return {
indicate that an error occurred. It can be silenced by adding the
"error" keyword.
]=],
- expand_cb = 'expand_set_belloff',
full_name = 'belloff',
list = 'comma',
scope = { 'global' },
short_desc = N_('do not ring the bell for these reasons'),
type = 'string',
varname = 'p_bo',
+ flags_varname = 'bo_flags',
},
{
abbreviation = 'bin',
cb = 'did_set_binary',
- defaults = { if_true = false },
+ defaults = false,
desc = [=[
This option should be set before editing a binary file. You can also
use the |-b| Vim argument. When this option is switched on a few
@@ -675,7 +707,7 @@ return {
},
{
cb = 'did_set_eof_eol_fixeol_bomb',
- defaults = { if_true = false },
+ defaults = false,
desc = [=[
When writing a file and the following conditions are met, a BOM (Byte
Order Mark) is prepended to the file:
@@ -708,6 +740,7 @@ return {
if_true = ' \t!@*-+;:,./?',
doc = '" ^I!@*-+;:,./?"',
},
+ flags = true,
desc = [=[
This option lets you choose which characters might cause a line
break if 'linebreak' is on. Only works for ASCII characters.
@@ -722,7 +755,7 @@ return {
},
{
abbreviation = 'bri',
- defaults = { if_true = false },
+ defaults = false,
desc = [=[
Every wrapped line will continue visually indented (same amount of
space as the beginning of that line), thus preserving horizontal blocks
@@ -737,7 +770,9 @@ return {
{
abbreviation = 'briopt',
cb = 'did_set_breakindentopt',
- defaults = { if_true = '' },
+ defaults = '',
+ -- Keep this in sync with briopt_check().
+ values = { 'shift:', 'min:', 'sbr', 'list:', 'column:' },
deny_duplicates = true,
desc = [=[
Settings for 'breakindent'. It can consist of the following optional
@@ -768,7 +803,6 @@ return {
added for the 'showbreak' setting.
(default: off)
]=],
- expand_cb = 'expand_set_breakindentopt',
full_name = 'breakindentopt',
list = 'onecomma',
redraw = { 'current_buffer' },
@@ -799,7 +833,8 @@ return {
{
abbreviation = 'bh',
cb = 'did_set_bufhidden',
- defaults = { if_true = '' },
+ defaults = '',
+ values = { '', 'hide', 'unload', 'delete', 'wipe' },
desc = [=[
This option specifies what happens when a buffer is no longer
displayed in a window:
@@ -821,7 +856,6 @@ return {
This option is used together with 'buftype' and 'swapfile' to specify
special kinds of buffers. See |special-buffers|.
]=],
- expand_cb = 'expand_set_bufhidden',
full_name = 'bufhidden',
noglob = true,
scope = { 'buf' },
@@ -832,7 +866,7 @@ return {
{
abbreviation = 'bl',
cb = 'did_set_buflisted',
- defaults = { if_true = true },
+ defaults = true,
desc = [=[
When this option is set, the buffer shows up in the buffer list. If
it is reset it is not used for ":bnext", "ls", the Buffers menu, etc.
@@ -851,7 +885,17 @@ return {
{
abbreviation = 'bt',
cb = 'did_set_buftype',
- defaults = { if_true = '' },
+ defaults = '',
+ values = {
+ '',
+ 'acwrite',
+ 'help',
+ 'nofile',
+ 'nowrite',
+ 'quickfix',
+ 'terminal',
+ 'prompt',
+ },
desc = [=[
The value of this option specifies the type of a buffer:
<empty> normal buffer
@@ -898,7 +942,6 @@ return {
without saving. For writing there must be matching |BufWriteCmd|,
|FileWriteCmd| or |FileAppendCmd| autocommands.
]=],
- expand_cb = 'expand_set_buftype',
full_name = 'buftype',
noglob = true,
scope = { 'buf' },
@@ -909,8 +952,9 @@ return {
},
{
abbreviation = 'cmp',
- cb = 'did_set_casemap',
- defaults = { if_true = 'internal,keepascii' },
+ defaults = 'internal,keepascii',
+ values = { 'internal', 'keepascii' },
+ flags = true,
deny_duplicates = true,
desc = [=[
Specifies details about changing the case of letters. It may contain
@@ -923,17 +967,17 @@ return {
case mapping, the current locale is not effective.
This probably only matters for Turkish.
]=],
- expand_cb = 'expand_set_casemap',
full_name = 'casemap',
list = 'onecomma',
scope = { 'global' },
short_desc = N_('specifies how case of letters is changed'),
type = 'string',
varname = 'p_cmp',
+ flags_varname = 'cmp_flags',
},
{
abbreviation = 'cdh',
- defaults = { if_true = false },
+ defaults = false,
desc = [=[
When on, |:cd|, |:tcd| and |:lcd| without an argument changes the
current working directory to the |$HOME| directory like in Unix.
@@ -1007,7 +1051,7 @@ return {
varname = 'p_cedit',
},
{
- defaults = { if_true = 0 },
+ defaults = 0,
desc = [=[
|channel| connected to the buffer, or 0 if no channel is connected.
In a |:terminal| buffer this is the terminal channel.
@@ -1024,7 +1068,7 @@ return {
{
abbreviation = 'ccv',
cb = 'did_set_optexpr',
- defaults = { if_true = '' },
+ defaults = '',
desc = [=[
An expression that is used for character encoding conversion. It is
evaluated when a file that is to be read or has been written has a
@@ -1080,7 +1124,7 @@ return {
},
{
abbreviation = 'cin',
- defaults = { if_true = false },
+ defaults = false,
desc = [=[
Enables automatic C program indenting. See 'cinkeys' to set the keys
that trigger reindenting in insert mode and 'cinoptions' to set your
@@ -1101,7 +1145,7 @@ return {
},
{
abbreviation = 'cink',
- defaults = { if_true = '0{,0},0),0],:,0#,!^F,o,O,e' },
+ defaults = '0{,0},0),0],:,0#,!^F,o,O,e',
deny_duplicates = true,
desc = [=[
A list of keys that, when typed in Insert mode, cause reindenting of
@@ -1120,7 +1164,7 @@ return {
{
abbreviation = 'cino',
cb = 'did_set_cinoptions',
- defaults = { if_true = '' },
+ defaults = '',
deny_duplicates = true,
desc = [=[
The 'cinoptions' affect the way 'cindent' reindents lines in a C
@@ -1136,7 +1180,7 @@ return {
},
{
abbreviation = 'cinsd',
- defaults = { if_true = 'public,protected,private' },
+ defaults = 'public,protected,private',
deny_duplicates = true,
desc = [=[
Keywords that are interpreted as a C++ scope declaration by |cino-g|.
@@ -1154,7 +1198,7 @@ return {
},
{
abbreviation = 'cinw',
- defaults = { if_true = 'if,else,while,do,for,switch' },
+ defaults = 'if,else,while,do,for,switch',
deny_duplicates = true,
desc = [=[
These keywords start an extra indent in the next line when
@@ -1173,8 +1217,9 @@ return {
},
{
abbreviation = 'cb',
- cb = 'did_set_clipboard',
- defaults = { if_true = '' },
+ defaults = '',
+ values = { 'unnamed', 'unnamedplus' },
+ flags = true,
desc = [=[
This option is a list of comma-separated names.
These names are recognized:
@@ -1200,18 +1245,18 @@ return {
"*". See |clipboard|.
]=],
deny_duplicates = true,
- expand_cb = 'expand_set_clipboard',
full_name = 'clipboard',
list = 'onecomma',
scope = { 'global' },
short_desc = N_('use the clipboard as the unnamed register'),
type = 'string',
varname = 'p_cb',
+ flags_varname = 'cb_flags',
},
{
abbreviation = 'ch',
cb = 'did_set_cmdheight',
- defaults = { if_true = 1 },
+ defaults = 1,
desc = [=[
Number of screen lines to use for the command-line. Helps avoiding
|hit-enter| prompts.
@@ -1236,7 +1281,7 @@ return {
},
{
abbreviation = 'cwh',
- defaults = { if_true = 7 },
+ defaults = 7,
desc = [=[
Number of screen lines to use for the command-line window. |cmdwin|
]=],
@@ -1249,7 +1294,7 @@ return {
{
abbreviation = 'cc',
cb = 'did_set_colorcolumn',
- defaults = { if_true = '' },
+ defaults = '',
deny_duplicates = true,
desc = [=[
'colorcolumn' is a comma-separated list of screen columns that are
@@ -1304,7 +1349,7 @@ return {
{
abbreviation = 'com',
cb = 'did_set_comments',
- defaults = { if_true = 's1:/*,mb:*,ex:*/,://,b:#,:%,:XCOMM,n:>,fb:-,fb:•' },
+ defaults = 's1:/*,mb:*,ex:*/,://,b:#,:%,:XCOMM,n:>,fb:-,fb:•',
deny_duplicates = true,
desc = [=[
A comma-separated list of strings that can start a comment line. See
@@ -1322,7 +1367,7 @@ return {
{
abbreviation = 'cms',
cb = 'did_set_commentstring',
- defaults = { if_true = '' },
+ defaults = '',
desc = [=[
A template for a comment. The "%s" in the value is replaced with the
comment text, and should be padded with a space when possible.
@@ -1337,7 +1382,7 @@ return {
},
{
abbreviation = 'cp',
- defaults = { if_true = false },
+ defaults = false,
full_name = 'compatible',
scope = { 'global' },
short_desc = N_('No description'),
@@ -1347,7 +1392,8 @@ return {
{
abbreviation = 'cpt',
cb = 'did_set_complete',
- defaults = { if_true = '.,w,b,u,t' },
+ defaults = '.,w,b,u,t',
+ values = { '.', 'w', 'b', 'u', 'k', 'kspell', 's', 'i', 'd', ']', 't', 'U', 'f' },
deny_duplicates = true,
desc = [=[
This option specifies how keyword completion |ins-completion| works
@@ -1383,7 +1429,6 @@ return {
based expansion (e.g., dictionary |i_CTRL-X_CTRL-K|, included patterns
|i_CTRL-X_CTRL-I|, tags |i_CTRL-X_CTRL-]| and normal expansions).
]=],
- expand_cb = 'expand_set_complete',
full_name = 'complete',
list = 'onecomma',
scope = { 'buf' },
@@ -1395,7 +1440,7 @@ return {
{
abbreviation = 'cfu',
cb = 'did_set_completefunc',
- defaults = { if_true = '' },
+ defaults = '',
desc = [=[
This option specifies a function to be used for Insert mode completion
with CTRL-X CTRL-U. |i_CTRL-X_CTRL-U|
@@ -1417,7 +1462,8 @@ return {
{
abbreviation = 'cia',
cb = 'did_set_completeitemalign',
- defaults = { if_true = 'abbr,kind,menu' },
+ defaults = 'abbr,kind,menu',
+ flags = true,
deny_duplicates = true,
desc = [=[
A comma-separated list of |complete-items| that controls the alignment
@@ -1437,7 +1483,20 @@ return {
{
abbreviation = 'cot',
cb = 'did_set_completeopt',
- defaults = { if_true = 'menu,preview' },
+ defaults = 'menu,preview',
+ values = {
+ 'menu',
+ 'menuone',
+ 'longest',
+ 'preview',
+ 'popup',
+ 'noinsert',
+ 'noselect',
+ 'fuzzy',
+ 'nosort',
+ 'preinsert',
+ },
+ flags = true,
deny_duplicates = true,
desc = [=[
A comma-separated list of options for Insert mode completion
@@ -1469,9 +1528,9 @@ return {
a match from the menu. Only works in combination with
"menu" or "menuone". No effect if "longest" is present.
- noselect Do not select a match in the menu, force the user to
- select one from the menu. Only works in combination with
- "menu" or "menuone".
+ noselect Same as "noinsert", except that no menu item is
+ pre-selected. If both "noinsert" and "noselect" are
+ present, "noselect" has precedence.
fuzzy Enable |fuzzy-matching| for completion candidates. This
allows for more flexible and intuitive matching, where
@@ -1480,19 +1539,30 @@ return {
difference how completion candidates are reduced from the
list of alternatives, but not how the candidates are
collected (using different completion types).
+
+ nosort Disable sorting of completion candidates based on fuzzy
+ scores when "fuzzy" is enabled. Candidates will appear
+ in their original order.
+
+ preinsert
+ Preinsert the portion of the first candidate word that is
+ not part of the current completion leader and using the
+ |hl-ComplMatchIns| highlight group. Does not work when
+ "fuzzy" is also included.
]=],
- expand_cb = 'expand_set_completeopt',
full_name = 'completeopt',
list = 'onecomma',
scope = { 'global', 'buf' },
short_desc = N_('options for Insert mode completion'),
type = 'string',
varname = 'p_cot',
+ flags_varname = 'cot_flags',
},
{
abbreviation = 'csl',
cb = 'did_set_completeslash',
- defaults = { if_true = '' },
+ defaults = '',
+ values = { '', 'slash', 'backslash' },
desc = [=[
only modifiable in MS-Windows
When this option is set it overrules 'shellslash' for completion:
@@ -1507,7 +1577,6 @@ return {
command line completion the global value is used.
]=],
enable_if = 'BACKSLASH_IN_FILENAME',
- expand_cb = 'expand_set_completeslash',
full_name = 'completeslash',
scope = { 'buf' },
type = 'string',
@@ -1516,7 +1585,7 @@ return {
{
abbreviation = 'cocu',
cb = 'did_set_concealcursor',
- defaults = { if_true = '' },
+ defaults = '',
desc = [=[
Sets the modes in which text in the cursor line can also be concealed.
When the current mode is listed then concealing happens just like in
@@ -1544,7 +1613,7 @@ return {
},
{
abbreviation = 'cole',
- defaults = { if_true = 0 },
+ defaults = 0,
desc = [=[
Determine how text with the "conceal" syntax attribute |:syn-conceal|
is shown:
@@ -1573,7 +1642,7 @@ return {
},
{
abbreviation = 'cf',
- defaults = { if_true = false },
+ defaults = false,
desc = [=[
When 'confirm' is on, certain operations that would normally
fail because of unsaved changes to a buffer, e.g. ":q" and ":e",
@@ -1592,7 +1661,7 @@ return {
},
{
abbreviation = 'ci',
- defaults = { if_true = false },
+ defaults = false,
desc = [=[
Copy the structure of the existing lines indent when autoindenting a
new line. Normally the new indent is reconstructed by a series of
@@ -1613,7 +1682,7 @@ return {
{
abbreviation = 'cpo',
cb = 'did_set_cpoptions',
- defaults = { if_true = macros('CPO_VIM', 'string') },
+ defaults = macros('CPO_VIM', 'string'),
desc = [=[
A sequence of single character flags. When a character is present
this indicates Vi-compatible behavior. This is used for things where
@@ -1855,7 +1924,7 @@ return {
},
{
abbreviation = 'crb',
- defaults = { if_true = false },
+ defaults = false,
desc = [=[
When this option is set, as the cursor in the current
window moves other cursorbound windows (windows that also have
@@ -1872,7 +1941,7 @@ return {
},
{
abbreviation = 'cuc',
- defaults = { if_true = false },
+ defaults = false,
desc = [=[
Highlight the screen column of the cursor with CursorColumn
|hl-CursorColumn|. Useful to align text. Will make screen redrawing
@@ -1891,7 +1960,7 @@ return {
},
{
abbreviation = 'cul',
- defaults = { if_true = false },
+ defaults = false,
desc = [=[
Highlight the text line of the cursor with CursorLine |hl-CursorLine|.
Useful to easily spot the cursor. Will make screen redrawing slower.
@@ -1907,7 +1976,14 @@ return {
{
abbreviation = 'culopt',
cb = 'did_set_cursorlineopt',
- defaults = { if_true = 'both' },
+ defaults = 'both',
+ -- Keep this in sync with fill_culopt_flags().
+ values = { 'line', 'screenline', 'number', 'both' },
+ flags = {
+ Line = 0x01,
+ Screenline = 0x02,
+ Number = 0x04,
+ },
deny_duplicates = true,
desc = [=[
Comma-separated list of settings for how 'cursorline' is displayed.
@@ -1924,7 +2000,6 @@ return {
"line" and "screenline" cannot be used together.
]=],
- expand_cb = 'expand_set_cursorlineopt',
full_name = 'cursorlineopt',
list = 'onecomma',
redraw = { 'current_window', 'highlight_only' },
@@ -1933,8 +2008,8 @@ return {
type = 'string',
},
{
- cb = 'did_set_debug',
- defaults = { if_true = '' },
+ defaults = '',
+ values = { 'msg', 'throw', 'beep' },
desc = [=[
These values can be used:
msg Error messages that would otherwise be omitted will be given
@@ -1947,8 +2022,9 @@ return {
"msg" and "throw" are useful for debugging 'foldexpr', 'formatexpr' or
'indentexpr'.
]=],
- expand_cb = 'expand_set_debug',
+ -- TODO(lewis6991): bug, values currently cannot be combined
full_name = 'debug',
+ list = 'comma',
scope = { 'global' },
short_desc = N_('to "msg" to see all error messages'),
type = 'string',
@@ -1956,7 +2032,7 @@ return {
},
{
abbreviation = 'def',
- defaults = { if_true = '' },
+ defaults = '',
desc = [=[
Pattern to be used to find a macro definition. It is a search
pattern, just like for the "/" command. This option is used for the
@@ -1986,7 +2062,7 @@ return {
},
{
abbreviation = 'deco',
- defaults = { if_true = false },
+ defaults = false,
desc = [=[
If editing Unicode and this option is set, backspace and Normal mode
"x" delete each combining character on its own. When it is off (the
@@ -2006,7 +2082,7 @@ return {
},
{
abbreviation = 'dict',
- defaults = { if_true = '' },
+ defaults = '',
deny_duplicates = true,
desc = [=[
List of file names, separated by commas, that are used to lookup words
@@ -2043,7 +2119,7 @@ return {
},
{
cb = 'did_set_diff',
- defaults = { if_true = false },
+ defaults = false,
desc = [=[
Join the current window in the group of windows that shows differences
between files. See |diff-mode|.
@@ -2058,7 +2134,7 @@ return {
{
abbreviation = 'dex',
cb = 'did_set_optexpr',
- defaults = { if_true = '' },
+ defaults = '',
desc = [=[
Expression which is evaluated to obtain a diff file (either ed-style
or unified-style) from two versions of a file. See |diff-diffexpr|.
@@ -2076,17 +2152,46 @@ return {
{
abbreviation = 'dip',
cb = 'did_set_diffopt',
- defaults = { if_true = 'internal,filler,closeoff' },
+ defaults = 'internal,filler,closeoff',
+ -- Keep this in sync with diffopt_changed().
+ values = {
+ 'filler',
+ 'context:',
+ 'iblank',
+ 'icase',
+ 'iwhite',
+ 'iwhiteall',
+ 'iwhiteeol',
+ 'horizontal',
+ 'vertical',
+ 'closeoff',
+ 'hiddenoff',
+ 'foldcolumn:',
+ 'followwrap',
+ 'internal',
+ 'indent-heuristic',
+ { 'algorithm:', { 'myers', 'minimal', 'patience', 'histogram' } },
+ 'linematch:',
+ },
deny_duplicates = true,
desc = [=[
Option settings for diff mode. It can consist of the following items.
All are optional. Items must be separated by a comma.
- filler Show filler lines, to keep the text
- synchronized with a window that has inserted
- lines at the same position. Mostly useful
- when windows are side-by-side and 'scrollbind'
- is set.
+ algorithm:{text} Use the specified diff algorithm with the
+ internal diff engine. Currently supported
+ algorithms are:
+ myers the default algorithm
+ minimal spend extra time to generate the
+ smallest possible diff
+ patience patience diff algorithm
+ histogram histogram diff algorithm
+
+ closeoff When a window is closed where 'diff' is set
+ and there is only one window remaining in the
+ same tab page with 'diff' set, execute
+ `:diffoff` in that window. This undoes a
+ `:diffsplit` command.
context:{n} Use a context of {n} lines between a change
and a fold that contains unchanged lines.
@@ -2097,6 +2202,23 @@ return {
value (999999) to disable folding completely.
See |fold-diff|.
+ filler Show filler lines, to keep the text
+ synchronized with a window that has inserted
+ lines at the same position. Mostly useful
+ when windows are side-by-side and 'scrollbind'
+ is set.
+
+ foldcolumn:{n} Set the 'foldcolumn' option to {n} when
+ starting diff mode. Without this 2 is used.
+
+ followwrap Follow the 'wrap' option and leave as it is.
+
+ horizontal Start diff mode with horizontal splits (unless
+ explicitly specified otherwise).
+
+ hiddenoff Do not use diff mode for a buffer when it
+ becomes hidden.
+
iblank Ignore changes where lines are all blank. Adds
the "-B" flag to the "diff" command if
'diffexpr' is empty. Check the documentation
@@ -2110,6 +2232,17 @@ return {
are considered the same. Adds the "-i" flag
to the "diff" command if 'diffexpr' is empty.
+ indent-heuristic
+ Use the indent heuristic for the internal
+ diff library.
+
+ internal Use the internal diff library. This is
+ ignored when 'diffexpr' is set. *E960*
+ When running out of memory when writing a
+ buffer this item will be ignored for diffs
+ involving that buffer. Set the 'verbose'
+ option to see when this happens.
+
iwhite Ignore changes in amount of white space. Adds
the "-b" flag to the "diff" command if
'diffexpr' is empty. Check the documentation
@@ -2129,56 +2262,19 @@ return {
of the "diff" command for what this does
exactly.
- horizontal Start diff mode with horizontal splits (unless
- explicitly specified otherwise).
+ linematch:{n} Align and mark changes between the most
+ similar lines between the buffers. When the
+ total number of lines in the diff hunk exceeds
+ {n}, the lines will not be aligned because for
+ very large diff hunks there will be a
+ noticeable lag. A reasonable setting is
+ "linematch:60", as this will enable alignment
+ for a 2 buffer diff hunk of 30 lines each,
+ or a 3 buffer diff hunk of 20 lines each.
vertical Start diff mode with vertical splits (unless
explicitly specified otherwise).
- closeoff When a window is closed where 'diff' is set
- and there is only one window remaining in the
- same tab page with 'diff' set, execute
- `:diffoff` in that window. This undoes a
- `:diffsplit` command.
-
- hiddenoff Do not use diff mode for a buffer when it
- becomes hidden.
-
- foldcolumn:{n} Set the 'foldcolumn' option to {n} when
- starting diff mode. Without this 2 is used.
-
- followwrap Follow the 'wrap' option and leave as it is.
-
- internal Use the internal diff library. This is
- ignored when 'diffexpr' is set. *E960*
- When running out of memory when writing a
- buffer this item will be ignored for diffs
- involving that buffer. Set the 'verbose'
- option to see when this happens.
-
- indent-heuristic
- Use the indent heuristic for the internal
- diff library.
-
- linematch:{n} Enable a second stage diff on each generated
- hunk in order to align lines. When the total
- number of lines in a hunk exceeds {n}, the
- second stage diff will not be performed as
- very large hunks can cause noticeable lag. A
- recommended setting is "linematch:60", as this
- will enable alignment for a 2 buffer diff with
- hunks of up to 30 lines each, or a 3 buffer
- diff with hunks of up to 20 lines each.
-
- algorithm:{text} Use the specified diff algorithm with the
- internal diff engine. Currently supported
- algorithms are:
- myers the default algorithm
- minimal spend extra time to generate the
- smallest possible diff
- patience patience diff algorithm
- histogram histogram diff algorithm
-
Examples: >vim
set diffopt=internal,filler,context:4
set diffopt=
@@ -2197,7 +2293,7 @@ return {
},
{
abbreviation = 'dg',
- defaults = { if_true = false },
+ defaults = false,
desc = [=[
Enable the entering of digraphs in Insert mode with {char1} <BS>
{char2}. See |digraphs|.
@@ -2210,7 +2306,7 @@ return {
},
{
abbreviation = 'dir',
- defaults = { if_true = '' },
+ defaults = '',
deny_duplicates = true,
desc = [=[
List of directory names for the swap file, separated with commas.
@@ -2268,7 +2364,9 @@ return {
{
abbreviation = 'dy',
cb = 'did_set_display',
- defaults = { if_true = 'lastline' },
+ defaults = 'lastline',
+ values = { 'lastline', 'truncate', 'uhex', 'msgsep' },
+ flags = true,
deny_duplicates = true,
desc = [=[
Change the way text is displayed. This is a comma-separated list of
@@ -2289,7 +2387,6 @@ return {
The "@" character can be changed by setting the "lastline" item in
'fillchars'. The character is highlighted with |hl-NonText|.
]=],
- expand_cb = 'expand_set_display',
full_name = 'display',
list = 'onecomma',
redraw = { 'all_windows' },
@@ -2297,18 +2394,18 @@ return {
short_desc = N_('list of flags for how to display text'),
type = 'string',
varname = 'p_dy',
+ flags_varname = 'dy_flags',