From 6fa17da39b270bf230764859a9537124b18d3ed5 Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Fri, 4 Aug 2023 21:26:53 +0100 Subject: docs(options): take ownership of options.txt (#24528) * docs(options): take ownership of options.txt - `src/nvim/options.lua` is now the source of truth - generate runtime/lua/vim/_meta/options.lua * fixup! zeer comments * fixup! zeer comments (2) * fixup! re-enable luacheck * fixup! regen --- runtime/lua/vim/_meta/options.lua | 7908 +++++++++++++++++++++++++++++++++++++ 1 file changed, 7908 insertions(+) create mode 100644 runtime/lua/vim/_meta/options.lua (limited to 'runtime/lua/vim/_meta/options.lua') diff --git a/runtime/lua/vim/_meta/options.lua b/runtime/lua/vim/_meta/options.lua new file mode 100644 index 0000000000..94e26742e6 --- /dev/null +++ b/runtime/lua/vim/_meta/options.lua @@ -0,0 +1,7908 @@ +--- @meta +-- THIS FILE IS GENERATED +-- DO NOT EDIT +error('Cannot require a meta file') + +---@class vim.bo +---@field [integer] vim.bo +vim.bo = vim.bo + +---@class vim.wo +---@field [integer] vim.wo +vim.wo = vim.wo + +--- Allow CTRL-_ in Insert and Command-line mode. This is default off, to +--- avoid that users that accidentally type CTRL-_ instead of SHIFT-_ get +--- into reverse Insert mode, and don't know how to get out. See +--- 'revins'. +--- +--- @type boolean +vim.o.allowrevins = false +vim.o.ari = vim.o.allowrevins +vim.go.allowrevins = vim.o.allowrevins +vim.go.ari = vim.go.allowrevins + +--- Tells Vim what to do with characters with East Asian Width Class +--- Ambiguous (such as Euro, Registered Sign, Copyright Sign, Greek +--- letters, Cyrillic letters). +--- +--- There are currently two possible values: +--- "single": Use the same width as characters in US-ASCII. This is +--- expected by most users. +--- "double": Use twice the width of ASCII characters. +--- *E834* *E835* +--- The value "double" cannot be used if 'listchars' or 'fillchars' +--- contains a character that would be double width. These errors may +--- also be given when calling setcellwidths(). +--- +--- The values are overruled for characters specified with +--- `setcellwidths()`. +--- +--- There are a number of CJK fonts for which the width of glyphs for +--- those characters are solely based on how many octets they take in +--- legacy/traditional CJK encodings. In those encodings, Euro, +--- Registered sign, Greek/Cyrillic letters are represented by two octets, +--- therefore those fonts have "wide" glyphs for them. This is also +--- true of some line drawing characters used to make tables in text +--- file. Therefore, when a CJK font is used for GUI Vim or +--- Vim is running inside a terminal (emulators) that uses a CJK font +--- (or Vim is run inside an xterm invoked with "-cjkwidth" option.), +--- this option should be set to "double" to match the width perceived +--- by Vim with the width of glyphs in the font. Perhaps it also has +--- to be set to "double" under CJK MS-Windows when the system locale is +--- set to one of CJK locales. See Unicode Standard Annex #11 +--- (https://www.unicode.org/reports/tr11). +--- +--- @type string +vim.o.ambiwidth = "single" +vim.o.ambw = vim.o.ambiwidth +vim.go.ambiwidth = vim.o.ambiwidth +vim.go.ambw = vim.go.ambiwidth + +--- This option can be set to start editing Arabic text. +--- Setting this option will: +--- - Set the 'rightleft' option, unless 'termbidi' is set. +--- - Set the 'arabicshape' option, unless 'termbidi' is set. +--- - Set the 'keymap' option to "arabic"; in Insert mode CTRL-^ toggles +--- between typing English and Arabic key mapping. +--- - Set the 'delcombine' option +--- +--- Resetting this option will: +--- - Reset the 'rightleft' option. +--- - Disable the use of 'keymap' (without changing its value). +--- Note that 'arabicshape' and 'delcombine' are not reset (it is a global +--- option). +--- Also see `arabic.txt`. +--- +--- @type boolean +vim.o.arabic = false +vim.o.arab = vim.o.arabic +vim.wo.arabic = vim.o.arabic +vim.wo.arab = vim.wo.arabic + +--- When on and 'termbidi' is off, the required visual character +--- corrections that need to take place for displaying the Arabic language +--- take effect. Shaping, in essence, gets enabled; the term is a broad +--- one which encompasses: +--- a) the changing/morphing of characters based on their location +--- within a word (initial, medial, final and stand-alone). +--- b) the enabling of the ability to compose characters +--- c) the enabling of the required combining of some characters +--- When disabled the display shows each character's true stand-alone +--- form. +--- Arabic is a complex language which requires other settings, for +--- further details see `arabic.txt`. +--- +--- @type boolean +vim.o.arabicshape = true +vim.o.arshape = vim.o.arabicshape +vim.go.arabicshape = vim.o.arabicshape +vim.go.arshape = vim.go.arabicshape + +--- When on, Vim will change the current working directory whenever you +--- open a file, switch buffers, delete a buffer or open/close a window. +--- It will change to the directory containing the file which was opened +--- or selected. When a buffer has no name it also has no directory, thus +--- the current directory won't change when navigating to it. +--- Note: When this option is on some plugins may not work. +--- +--- @type boolean +vim.o.autochdir = false +vim.o.acd = vim.o.autochdir +vim.go.autochdir = vim.o.autochdir +vim.go.acd = vim.go.autochdir + +--- Copy indent from current line when starting a new line (typing +--- in Insert mode or when using the "o" or "O" command). If you do not +--- type anything on the new line except or CTRL-D and then type +--- , CTRL-O or , the indent is deleted again. Moving the cursor +--- to another line has the same effect, unless the 'I' flag is included +--- in 'cpoptions'. +--- When autoindent is on, formatting (with the "gq" command or when you +--- reach 'textwidth' in Insert mode) uses the indentation of the first +--- line. +--- When 'smartindent' or 'cindent' is on the indent is changed in +--- a different way. +--- +--- @type boolean +vim.o.autoindent = true +vim.o.ai = vim.o.autoindent +vim.bo.autoindent = vim.o.autoindent +vim.bo.ai = vim.bo.autoindent + +--- 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. +--- When the file has been deleted this is not done, so you have the text +--- from before it was deleted. When it appears again then it is read. +--- `timestamp` +--- If this option has a local value, use this command to switch back to +--- using the global value: +--- ``` +--- :set autoread< +--- ``` +--- +--- @type boolean +vim.o.autoread = true +vim.o.ar = vim.o.autoread +vim.bo.autoread = vim.o.autoread +vim.bo.ar = vim.bo.autoread +vim.go.autoread = vim.o.autoread +vim.go.ar = vim.go.autoread + +--- Write the contents of the file, if it has been modified, on each +--- `:next`, `:rewind`, `:last`, `:first`, `:previous`, `:stop`, +--- `:suspend`, `:tag`, `:!`, `:make`, CTRL-] and CTRL-^ command; and when +--- a `:buffer`, CTRL-O, CTRL-I, '{A-Z0-9}, or `{A-Z0-9} command takes one +--- to another file. +--- A buffer is not written if it becomes hidden, e.g. when 'bufhidden' is +--- set to "hide" and `:next` is used. +--- Note that for some commands the 'autowrite' option is not used, see +--- 'autowriteall' for that. +--- Some buffers will not be written, specifically when 'buftype' is +--- "nowrite", "nofile", "terminal" or "prompt". +--- USE WITH CARE: If you make temporary changes to a buffer that you +--- don't want to be saved this option may cause it to be saved anyway. +--- Renaming the buffer with ":file {name}" may help avoid this. +--- +--- @type boolean +vim.o.autowrite = false +vim.o.aw = vim.o.autowrite +vim.go.autowrite = vim.o.autowrite +vim.go.aw = vim.go.autowrite + +--- Like 'autowrite', but also used for commands ":edit", ":enew", ":quit", +--- ":qall", ":exit", ":xit", ":recover" and closing the Vim window. +--- Setting this option also implies that Vim behaves like 'autowrite' has +--- been set. +--- +--- @type boolean +vim.o.autowriteall = false +vim.o.awa = vim.o.autowriteall +vim.go.autowriteall = vim.o.autowriteall +vim.go.awa = vim.go.autowriteall + +--- When set to "dark" or "light", adjusts the default color groups for +--- that background type. The `TUI` or other UI sets this on startup +--- (triggering `OptionSet`) if it can detect the background color. +--- +--- This option does NOT change the background color, it tells Nvim what +--- the "inherited" (terminal/GUI) background looks like. +--- See `:hi-normal` if you want to set the background color explicitly. +--- *g:colors_name* +--- When a color scheme is loaded (the "g:colors_name" variable is set) +--- setting 'background' will cause the color scheme to be reloaded. If +--- the color scheme adjusts to the value of 'background' this will work. +--- However, if the color scheme sets 'background' itself the effect may +--- be undone. First delete the "g:colors_name" variable when needed. +--- +--- Normally this option would be set in the vimrc file. Possibly +--- depending on the terminal name. Example: +--- ``` +--- :if $TERM ==# "xterm" +--- : set background=dark +--- :endif +--- ``` +--- When this option is set, the default settings for the highlight groups +--- will change. To use other settings, place ":highlight" commands AFTER +--- the setting of the 'background' option. +--- This option is also used in the "$VIMRUNTIME/syntax/syntax.vim" file +--- to select the colors for syntax highlighting. After changing this +--- option, you must load syntax.vim again to see the result. This can be +--- done with ":syntax on". +--- +--- @type string +vim.o.background = "dark" +vim.o.bg = vim.o.background +vim.go.background = vim.o.background +vim.go.bg = vim.go.background + +--- Influences the working of , , CTRL-W and CTRL-U in Insert +--- mode. This is a list of items, separated by commas. Each item allows +--- a way to backspace over something: +--- value effect ~ +--- indent allow backspacing over autoindent +--- eol allow backspacing over line breaks (join lines) +--- start allow backspacing over the start of insert; CTRL-W and CTRL-U +--- stop once at the start of insert. +--- nostop like start, except CTRL-W and CTRL-U do not stop at the start of +--- insert. +--- +--- When the value is empty, Vi compatible backspacing is used, none of +--- the ways mentioned for the items above are possible. +--- +--- @type string +vim.o.backspace = "indent,eol,start" +vim.o.bs = vim.o.backspace +vim.go.backspace = vim.o.backspace +vim.go.bs = vim.go.backspace + +--- 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 +--- backup file, but you do want a backup while the file is being +--- written, reset this option and set the 'writebackup' option (this is +--- the default). If you do not want a backup file at all reset both +--- options (use this if your file system is almost full). See the +--- `backup-table` for more explanations. +--- When the 'backupskip' pattern matches, a backup is not made anyway. +--- When 'patchmode' is set, the backup may be renamed to become the +--- oldest version of a file. +--- +--- @type boolean +vim.o.backup = false +vim.o.bk = vim.o.backup +vim.go.backup = vim.o.backup +vim.go.bk = vim.go.backup + +--- When writing a file and a backup is made, this option tells how it's +--- done. This is a comma-separated list of words. +--- +--- The main values are: +--- "yes" make a copy of the file and overwrite the original one +--- "no" rename the file and write a new one +--- "auto" one of the previous, what works best +--- +--- Extra values that can be combined with the ones above are: +--- "breaksymlink" always break symlinks when writing +--- "breakhardlink" always break hardlinks when writing +--- +--- Making a copy and overwriting the original file: +--- - Takes extra time to copy the file. +--- + When the file has special attributes, is a (hard/symbolic) link or +--- has a resource fork, all this is preserved. +--- - When the file is a link the backup will have the name of the link, +--- not of the real file. +--- +--- Renaming the file and writing a new one: +--- + It's fast. +--- - Sometimes not all attributes of the file can be copied to the new +--- file. +--- - When the file is a link the new file will not be a link. +--- +--- The "auto" value is the middle way: When Vim sees that renaming the +--- file is possible without side effects (the attributes can be passed on +--- and the file is not a link) that is used. When problems are expected, +--- a copy will be made. +--- +--- The "breaksymlink" and "breakhardlink" values can be used in +--- combination with any of "yes", "no" and "auto". When included, they +--- force Vim to always break either symbolic or hard links by doing +--- exactly what the "no" option does, renaming the original file to +--- become the backup and writing a new file in its place. This can be +--- useful for example in source trees where all the files are symbolic or +--- hard links and any changes should stay in the local source tree, not +--- be propagated back to the original source. +--- *crontab* +--- One situation where "no" and "auto" will cause problems: A program +--- that opens a file, invokes Vim to edit that file, and then tests if +--- the open file was changed (through the file descriptor) will check the +--- backup file instead of the newly created file. "crontab -e" is an +--- example. +--- +--- When a copy is made, the original file is truncated and then filled +--- with the new text. This means that protection bits, owner and +--- symbolic links of the original file are unmodified. The backup file, +--- however, is a new file, owned by the user who edited the file. The +--- group of the backup is set to the group of the original file. If this +--- fails, the protection bits for the group are made the same as for +--- others. +--- +--- When the file is renamed, this is the other way around: The backup has +--- the same attributes of the original file, and the newly written file +--- is owned by the current user. When the file was a (hard/symbolic) +--- link, the new file will not! That's why the "auto" value doesn't +--- rename when the file is a link. The owner and group of the newly +--- written file will be set to the same ones as the original file, but +--- the system may refuse to do this. In that case the "auto" value will +--- again not rename the file. +--- +--- @type string +vim.o.backupcopy = "auto" +vim.o.bkc = vim.o.backupcopy +vim.bo.backupcopy = vim.o.backupcopy +vim.bo.bkc = vim.bo.backupcopy +vim.go.backupcopy = vim.o.backupcopy +vim.go.bkc = vim.go.backupcopy + +--- List of directories for the backup file, separated with commas. +--- - The backup file will be created in the first directory in the list +--- where this is possible. If none of the directories exist Nvim will +--- attempt to create the last directory in the list. +--- - Empty means that no backup file will be created ('patchmode' is +--- impossible!). Writing may fail because of this. +--- - A directory "." means to put the backup file in the same directory +--- as the edited file. +--- - A directory starting with "./" (or ".\" for MS-Windows) means to put +--- the backup file relative to where the edited file is. The leading +--- "." is replaced with the path name of the edited file. +--- ("." inside a directory name has no special meaning). +--- - Spaces after the comma are ignored, other spaces are considered part +--- of the directory name. To have a space at the start of a directory +--- name, precede it with a backslash. +--- - To include a comma in a directory name precede it with a backslash. +--- - A directory name may end in an '/'. +--- - For Unix and Win32, if a directory ends in two path separators "//", +--- the swap file name will be built from the complete path to the file +--- with all path separators changed to percent '%' signs. This will +--- ensure file name uniqueness in the backup directory. +--- On Win32, it is also possible to end with "\\". However, When a +--- separating comma is following, you must use "//", since "\\" will +--- include the comma in the file name. Therefore it is recommended to +--- use '//', instead of '\\'. +--- - Environment variables are expanded `:set_env`. +--- - Careful with '\' characters, type one before a space, type two to +--- get one in the option (see `option-backslash`), for example: +--- ``` +--- :set bdir=c:\\tmp,\ dir\\,with\\,commas,\\\ dir\ with\ spaces +--- ``` +--- See also 'backup' and 'writebackup' options. +--- If you want to hide your backup files on Unix, consider this value: +--- ``` +--- :set backupdir=./.backup,~/.backup,.,/tmp +--- ``` +--- You must create a ".backup" directory in each directory and in your +--- home directory for this to work properly. +--- 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. +--- This option cannot be set from a `modeline` or in the `sandbox`, for +--- security reasons. +--- +--- @type string +vim.o.backupdir = ".,$XDG_STATE_HOME/nvim/backup//" +vim.o.bdir = vim.o.backupdir +vim.go.backupdir = vim.o.backupdir +vim.go.bdir = vim.go.backupdir + +--- String which is appended to a file name to make the name of the +--- backup file. The default is quite unusual, because this avoids +--- accidentally overwriting existing files with a backup file. You might +--- prefer using ".bak", but make sure that you don't have files with +--- ".bak" that you want to keep. +--- Only normal file name characters can be used; `/\*?[|<>` are illegal. +--- +--- If you like to keep a lot of backups, you could use a BufWritePre +--- autocommand to change 'backupext' just before writing the file to +--- include a timestamp. +--- ``` +--- :au BufWritePre * let &bex = '-' .. strftime("%Y%b%d%X") .. '~' +--- ``` +--- Use 'backupdir' to put the backup in a different directory. +--- +--- @type string +vim.o.backupext = "~" +vim.o.bex = vim.o.backupext +vim.go.backupext = vim.o.backupext +vim.go.bex = vim.go.backupext + +--- A list of file patterns. When one of the patterns matches with the +--- name of the file which is written, no backup file is created. Both +--- the specified file name and the full path name of the file are used. +--- The pattern is used like with `:autocmd`, see `autocmd-pattern`. +--- Watch out for special characters, see `option-backslash`. +--- When $TMPDIR, $TMP or $TEMP is not defined, it is not used for the +--- default value. "/tmp/*" is only used for Unix. +--- +--- WARNING: Not having a backup file means that when Vim fails to write +--- your buffer correctly and then, for whatever reason, Vim exits, you +--- lose both the original file and what you were writing. Only disable +--- backups if you don't care about losing the file. +--- +--- Note that environment variables are not expanded. If you want to use +--- $HOME you must expand it explicitly, e.g.: +--- ``` +--- :let &backupskip = escape(expand('$HOME'), '\') .. '/tmp/*' +--- +--- ``` +--- Note that the default also makes sure that "crontab -e" works (when a +--- backup would be made by renaming the original file crontab won't see +--- the newly created file). Also see 'backupcopy' and `crontab`. +--- +--- @type string +vim.o.backupskip = "/tmp/*" +vim.o.bsk = vim.o.backupskip +vim.go.backupskip = vim.o.backupskip +vim.go.bsk = vim.go.backupskip + +--- Specifies for which events the bell will not be rung. It is a comma- +--- separated list of items. For each item that is present, the bell +--- will be silenced. This is most useful to specify specific events in +--- insert mode to be silenced. +--- +--- item meaning when present ~ +--- all All events. +--- backspace When hitting or and deleting results in an +--- error. +--- cursor Fail to move around using the cursor keys or +--- / in `Insert-mode`. +--- complete Error occurred when using `i_CTRL-X_CTRL-K` or +--- `i_CTRL-X_CTRL-T`. +--- copy Cannot copy char from insert mode using `i_CTRL-Y` or +--- `i_CTRL-E`. +--- ctrlg Unknown Char after in Insert mode. +--- error Other Error occurred (e.g. try to join last line) +--- (mostly used in `Normal-mode` or `Cmdline-mode`). +--- esc hitting in `Normal-mode`. +--- hangul Ignored. +--- lang Calling the beep module for Lua/Mzscheme/TCL. +--- mess No output available for `g<`. +--- showmatch Error occurred for 'showmatch' function. +--- operator Empty region error `cpo-E`. +--- register Unknown register after in `Insert-mode`. +--- shell Bell from shell output `:!`. +--- spell Error happened on spell suggest. +--- wildmode More matches in `cmdline-completion` available +--- (depends on the 'wildmode' setting). +--- +--- This is most useful to fine tune when in Insert mode the bell should +--- be rung. For Normal mode and Ex commands, the bell is often rung to +--- indicate that an error occurred. It can be silenced by adding the +--- "error" keyword. +--- +--- @type string +vim.o.belloff = "all" +vim.o.bo = vim.o.belloff +vim.go.belloff = vim.o.belloff +vim.go.bo = vim.go.belloff + +--- 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 +--- options will be changed (also when it already was on): +--- 'textwidth' will be set to 0 +--- 'wrapmargin' will be set to 0 +--- 'modeline' will be off +--- 'expandtab' will be off +--- Also, 'fileformat' and 'fileformats' options will not be used, the +--- file is read and written like 'fileformat' was "unix" (a single +--- separates lines). +--- The 'fileencoding' and 'fileencodings' options will not be used, the +--- file is read without conversion. +--- NOTE: When you start editing a(nother) file while the 'bin' option is +--- on, settings from autocommands may change the settings again (e.g., +--- 'textwidth'), causing trouble when editing. You might want to set +--- 'bin' again when the file has been loaded. +--- The previous values of these options are remembered and restored when +--- 'bin' is switched from on to off. Each buffer has its own set of +--- saved option values. +--- To edit a file with 'binary' set you can use the `++bin` argument. +--- This avoids you have to do ":set bin", which would have effect for all +--- files you edit. +--- When writing a file the for the last line is only written if +--- there was one in the original file (normally Vim appends an to +--- the last line if there is none; this would make the file longer). See +--- the 'endofline' option. +--- +--- @type boolean +vim.o.binary = false +vim.o.bin = vim.o.binary +vim.bo.binary = vim.o.binary +vim.bo.bin = vim.bo.binary + +--- When writing a file and the following conditions are met, a BOM (Byte +--- Order Mark) is prepended to the file: +--- - this option is on +--- - the 'binary' option is off +--- - 'fileencoding' is "utf-8", "ucs-2", "ucs-4" or one of the little/big +--- endian variants. +--- Some applications use the BOM to recognize the encoding of the file. +--- Often used for UCS-2 files on MS-Windows. For other applications it +--- causes trouble, for example: "cat file1 file2" makes the BOM of file2 +--- appear halfway through the resulting file. Gcc doesn't accept a BOM. +--- When Vim reads a file and 'fileencodings' starts with "ucs-bom", a +--- check for the presence of the BOM is done and 'bomb' set accordingly. +--- Unless 'binary' is set, it is removed from the first line, so that you +--- don't see it when editing. When you don't change the options, the BOM +--- will be restored when writing the file. +--- +--- @type boolean +vim.o.bomb = false +vim.bo.bomb = vim.o.bomb + +--- This option lets you choose which characters might cause a line +--- break if 'linebreak' is on. Only works for ASCII characters. +--- +--- @type string +vim.o.breakat = " \t!@*-+;:,./?" +vim.o.brk = vim.o.breakat +vim.go.breakat = vim.o.breakat +vim.go.brk = vim.go.breakat + +--- Every wrapped line will continue visually indented (same amount of +--- space as the beginning of that line), thus preserving horizontal blocks +--- of text. +--- +--- @type boolean +vim.o.breakindent = false +vim.o.bri = vim.o.breakindent +vim.wo.breakindent = vim.o.breakindent +vim.wo.bri = vim.wo.breakindent + +--- Settings for 'breakindent'. It can consist of the following optional +--- items and must be separated by a comma: +--- min:{n} Minimum text width that will be kept after +--- applying 'breakindent', even if the resulting +--- text should normally be narrower. This prevents +--- text indented almost to the right window border +--- occupying lot of vertical space when broken. +--- (default: 20) +--- shift:{n} After applying 'breakindent', the wrapped line's +--- beginning will be shifted by the given number of +--- characters. It permits dynamic French paragraph +--- indentation (negative) or emphasizing the line +--- continuation (positive). +--- (default: 0) +--- sbr Display the 'showbreak' value before applying the +--- additional indent. +--- (default: off) +--- list:{n} Adds an additional indent for lines that match a +--- numbered or bulleted list (using the +--- 'formatlistpat' setting). +--- list:-1 Uses the length of a match with 'formatlistpat' +--- for indentation. +--- (default: 0) +--- column:{n} Indent at column {n}. Will overrule the other +--- sub-options. Note: an additional indent may be +--- added for the 'showbreak' setting. +--- (default: off) +--- +--- @type string +vim.o.breakindentopt = "" +vim.o.briopt = vim.o.breakindentopt +vim.wo.breakindentopt = vim.o.breakindentopt +vim.wo.briopt = vim.wo.breakindentopt + +--- Which directory to use for the file browser: +--- last Use same directory as with last file browser, where a +--- file was opened or saved. +--- buffer Use the directory of the related buffer. +--- current Use the current directory. +--- {path} Use the specified directory +--- +--- @type string +vim.o.browsedir = "" +vim.o.bsdir = vim.o.browsedir +vim.go.browsedir = vim.o.browsedir +vim.go.bsdir = vim.go.browsedir + +--- This option specifies what happens when a buffer is no longer +--- displayed in a window: +--- follow the global 'hidden' option +--- hide hide the buffer (don't unload it), even if 'hidden' is +--- not set +--- unload unload the buffer, even if 'hidden' is set; the +--- `:hide` command will also unload the buffer +--- delete delete the buffer from the buffer list, even if +--- 'hidden' is set; the `:hide` command will also delete +--- the buffer, making it behave like `:bdelete` +--- wipe wipe the buffer from the buffer list, even if +--- 'hidden' is set; the `:hide` command will also wipe +--- out the buffer, making it behave like `:bwipeout` +--- +--- CAREFUL: when "unload", "delete" or "wipe" is used changes in a buffer +--- are lost without a warning. Also, these values may break autocommands +--- that switch between buffers temporarily. +--- This option is used together with 'buftype' and 'swapfile' to specify +--- special kinds of buffers. See `special-buffers`. +--- +--- @type string +vim.o.bufhidden = "" +vim.o.bh = vim.o.bufhidden +vim.bo.bufhidden = vim.o.bufhidden +vim.bo.bh = vim.bo.bufhidden + +--- 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. +--- This option is reset by Vim for buffers that are only used to remember +--- a file name or marks. Vim sets it when starting to edit a buffer. +--- But not when moving to a buffer with ":buffer". +--- +--- @type boolean +vim.o.buflisted = true +vim.o.bl = vim.o.buflisted +vim.bo.buflisted = vim.o.buflisted +vim.bo.bl = vim.bo.buflisted + +--- The value of this option specifies the type of a buffer: +--- normal buffer +--- acwrite buffer will always be written with `BufWriteCmd`s +--- help help buffer (do not set this manually) +--- nofile buffer is not related to a file, will not be written +--- nowrite buffer will not be written +--- quickfix list of errors `:cwindow` or locations `:lwindow` +--- terminal `terminal-emulator` buffer +--- prompt buffer where only the last line can be edited, meant +--- to be used by a plugin, see `prompt-buffer` +--- +--- This option is used together with 'bufhidden' and 'swapfile' to +--- specify special kinds of buffers. See `special-buffers`. +--- Also see `win_gettype()`, which returns the type of the window. +--- +--- Be careful with changing this option, it can have many side effects! +--- One such effect is that Vim will not check the timestamp of the file, +--- if the file is changed by another program this will not be noticed. +--- +--- A "quickfix" buffer is only used for the error list and the location +--- list. This value is set by the `:cwindow` and `:lwindow` commands and +--- you are not supposed to change it. +--- +--- "nofile" and "nowrite" buffers are similar: +--- both: The buffer is not to be written to disk, ":w" doesn't +--- work (":w filename" does work though). +--- both: The buffer is never considered to be `'modified'`. +--- There is no warning when the changes will be lost, for +--- example when you quit Vim. +--- both: A swap file is only created when using too much memory +--- (when 'swapfile' has been reset there is never a swap +--- file). +--- nofile only: The buffer name is fixed, it is not handled like a +--- file name. It is not modified in response to a `:cd` +--- command. +--- both: When using ":e bufname" and already editing "bufname" +--- the buffer is made empty and autocommands are +--- triggered as usual for `:edit`. +--- *E676* +--- "acwrite" implies that the buffer name is not related to a file, like +--- "nofile", but it will be written. Thus, in contrast to "nofile" and +--- "nowrite", ":w" does work and a modified buffer can't be abandoned +--- without saving. For writing there must be matching `BufWriteCmd|, +--- |FileWriteCmd` or `FileAppendCmd` autocommands. +--- +--- @type string +vim.o.buftype = "" +vim.o.bt = vim.o.buftype +vim.bo.buftype = vim.o.buftype +vim.bo.bt = vim.bo.buftype + +--- Specifies details about changing the case of letters. It may contain +--- these words, separated by a comma: +--- internal Use internal case mapping functions, the current +--- locale does not change the case mapping. When +--- "internal" is omitted, the towupper() and towlower() +--- system library functions are used when available. +--- keepascii For the ASCII characters (0x00 to 0x7f) use the US +--- case mapping, the current locale is not effective. +--- This probably only matters for Turkish. +--- +--- @type string +vim.o.casemap = "internal,keepascii" +vim.o.cmp = vim.o.casemap +vim.go.casemap = vim.o.casemap +vim.go.cmp = vim.go.casemap + +--- When on, `:cd`, `:tcd` and `:lcd` without an argument changes the +--- current working directory to the `$HOME` directory like in Unix. +--- When off, those commands just print the current directory name. +--- On Unix this option has no effect. +--- +--- @type boolean +vim.o.cdhome = false +vim.o.cdh = vim.o.cdhome +vim.go.cdhome = vim.o.cdhome +vim.go.cdh = vim.go.cdhome + +--- This is a list of directories which will be searched when using the +--- `:cd`, `:tcd` and `:lcd` commands, provided that the directory being +--- searched for has a relative path, not an absolute part starting with +--- "/", "./" or "../", the 'cdpath' option is not used then. +--- The 'cdpath' option's value has the same form and semantics as +--- `'path'`. Also see `file-searching`. +--- The default value is taken from $CDPATH, with a "," prepended to look +--- in the current directory first. +--- If the default value taken from $CDPATH is not what you want, include +--- a modified version of the following command in your vimrc file to +--- override it: +--- ``` +--- :let &cdpath = ',' .. substitute(substitute($CDPATH, '[, ]', '\\\0', 'g'), ':', ',', 'g') +--- ``` +--- This option cannot be set from a `modeline` or in the `sandbox`, for +--- security reasons. +--- (parts of 'cdpath' can be passed to the shell to expand file names). +--- +--- @type string +vim.o.cdpath = ",," +vim.o.cd = vim.o.cdpath +vim.go.cdpath = vim.o.cdpath +vim.go.cd = vim.go.cdpath + +--- The key used in Command-line Mode to open the command-line window. +--- Only non-printable keys are allowed. +--- The key can be specified as a single character, but it is difficult to +--- type. The preferred way is to use the <> notation. Examples: +--- ``` +--- :exe "set cedit=\\" +--- :exe "set cedit=\\" +--- ``` +--- `Nvi` also has this option, but it only uses the first character. +--- See `cmdwin`. +--- +--- @type string +vim.o.cedit = "\6" +vim.go.cedit = vim.o.cedit + +--- `channel` connected to the buffer, or 0 if no channel is connected. +--- In a `:terminal` buffer this is the terminal channel. +--- Read-only. +--- +--- @type integer +vim.o.channel = 0 +vim.bo.channel = vim.o.channel + +--- 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 +--- different encoding from what is desired. +--- 'charconvert' is not used when the internal iconv() function is +--- supported and is able to do the conversion. Using iconv() is +--- preferred, because it is much faster. +--- 'charconvert' is not used when reading stdin `--`, because there is no +--- file to convert from. You will have to save the text in a file first. +--- The expression must return zero, false or an empty string for success, +--- non-zero or true for failure. +--- See `encoding-names` for possible encoding names. +--- Additionally, names given in 'fileencodings' and 'fileencoding' are +--- used. +--- Conversion between "latin1", "unicode", "ucs-2", "ucs-4" and "utf-8" +--- is done internally by Vim, 'charconvert' is not used for this. +--- Also used for Unicode conversion. +--- Example: +--- ``` +--- set charconvert=CharConvert() +--- fun CharConvert() +--- system("recode " +--- \ .. v:charconvert_from .. ".." .. v:charconvert_to +--- \ .. " <" .. v:fname_in .. " >" .. v:fname_out) +--- return v:shell_error +--- endfun +--- ``` +--- The related Vim variables are: +--- v:charconvert_from name of the current encoding +--- v:charconvert_to name of the desired encoding +--- v:fname_in name of the input file +--- v:fname_out name of the output file +--- Note that v:fname_in and v:fname_out will never be the same. +--- This option cannot be set from a `modeline` or in the `sandbox`, for +--- security reasons. +--- +--- @type string +vim.o.charconvert = "" +vim.o.ccv = vim.o.charconvert +vim.go.charconvert = vim.o.charconvert +vim.go.ccv = vim.go.charconvert + +--- Enables automatic C program indenting. See 'cinkeys' to set the keys +--- that trigger reindenting in insert mode and 'cinoptions' to set your +--- preferred indent style. +--- If 'indentexpr' is not empty, it overrules 'cindent'. +--- If 'lisp' is not on and both 'indentexpr' and 'equalprg' are empty, +--- the "=" operator indents using this algorithm rather than calling an +--- external program. +--- See `C-indenting`. +--- When you don't like the way 'cindent' works, try the 'smartindent' +--- option or 'indentexpr'. +--- +--- @type boolean +vim.o.cindent = false +vim.o.cin = vim.o.cindent +vim.bo.cindent = vim.o.cindent +vim.bo.cin = vim.bo.cindent + +--- A list of keys that, when typed in Insert mode, cause reindenting of +--- the current line. Only used if 'cindent' is on and 'indentexpr' is +--- empty. +--- For the format of this option see `cinkeys-format`. +--- See `C-indenting`. +--- +--- @type string +vim.o.cinkeys = "0{,0},0),0],:,0#,!^F,o,O,e" +vim.o.cink = vim.o.cinkeys +vim.bo.cinkeys = vim.o.cinkeys +vim.bo.cink = vim.bo.cinkeys + +--- The 'cinoptions' affect the way 'cindent' reindents lines in a C +--- program. See `cinoptions-values` for the values of this option, and +--- `C-indenting` for info on C indenting in general. +--- +--- @type string +vim.o.cinoptions = "" +vim.o.cino = vim.o.cinoptions +vim.bo.cinoptions = vim.o.cinoptions +vim.bo.cino = vim.bo.cinoptions + +--- Keywords that are interpreted as a C++ scope declaration by `cino-g`. +--- Useful e.g. for working with the Qt framework that defines additional +--- scope declarations "signals", "public slots" and "private slots": +--- ``` +--- set cinscopedecls+=signals,public\ slots,private\ slots +--- ``` +--- +--- @type string +vim.o.cinscopedecls = "public,protected,private" +vim.o.cinsd = vim.o.cinscopedecls +vim.bo.cinscopedecls = vim.o.cinscopedecls +vim.bo.cinsd = vim.bo.cinscopedecls + +--- These keywords start an extra indent in the next line when +--- 'smartindent' or 'cindent' is set. For 'cindent' this is only done at +--- an appropriate place (inside {}). +--- Note that 'ignorecase' isn't used for 'cinwords'. If case doesn't +--- matter, include the keyword both the uppercase and lowercase: +--- "if,If,IF". +--- +--- @type string +vim.o.cinwords = "if,else,while,do,for,switch" +vim.o.cinw = vim.o.cinwords +vim.bo.cinwords = vim.o.cinwords +vim.bo.cinw = vim.bo.cinwords + +--- This option is a list of comma-separated names. +--- These names are recognized: +--- +--- *clipboard-unnamed* +--- unnamed When included, Vim will use the clipboard register "*" +--- for all yank, delete, change and put operations which +--- would normally go to the unnamed register. When a +--- register is explicitly specified, it will always be +--- used regardless of whether "unnamed" is in 'clipboard' +--- or not. The clipboard register can always be +--- explicitly accessed using the "* notation. Also see +--- `clipboard`. +--- +--- *clipboard-unnamedplus* +--- unnamedplus A variant of the "unnamed" flag which uses the +--- clipboard register "+" (`quoteplus`) instead of +--- register "*" for all yank, delete, change and put +--- operations which would normally go to the unnamed +--- register. When "unnamed" is also included to the +--- option, yank and delete operations (but not put) +--- will additionally copy the text into register +--- "*". See `clipboard`. +--- +--- @type string +vim.o.clipboard = "" +vim.o.cb = vim.o.clipboard +vim.go.clipboard = vim.o.clipboard +vim.go.cb = vim.go.clipboard + +--- Number of screen lines to use for the command-line. Helps avoiding +--- `hit-enter` prompts. +--- The value of this option is stored with the tab page, so that each tab +--- page can have a different value. +--- +--- When 'cmdheight' is zero, there is no command-line unless it is being +--- used. The command-line will cover the last line of the screen when +--- shown. +--- +--- WARNING: `cmdheight=0` is considered experimental. Expect some +--- unwanted behaviour. Some 'shortmess' flags and similar +--- mechanism might fail to take effect, causing unwanted hit-enter +--- prompts. Some informative messages, both from Nvim itself and +--- plugins, will not be displayed. +--- +--- @type integer +vim.o.cmdheight = 1 +vim.o.ch = vim.o.cmdheight +vim.go.cmdheight = vim.o.cmdheight +vim.go.ch = vim.go.cmdheight + +--- Number of screen lines to use for the command-line window. `cmdwin` +--- +--- @type integer +vim.o.cmdwinheight = 7 +vim.o.cwh = vim.o.cmdwinheight +vim.go.cmdwinheight = vim.o.cmdwinheight +vim.go.cwh = vim.go.cmdwinheight + +--- 'colorcolumn' is a comma-separated list of screen columns that are +--- highlighted with ColorColumn `hl-ColorColumn`. Useful to align +--- text. Will make screen redrawing slower. +--- The screen column can be an absolute number, or a number preceded with +--- '+' or '-', which is added to or subtracted from 'textwidth'. +--- ``` +--- +--- :set cc=+1 " highlight column after 'textwidth' +--- :set cc=+1,+2,+3 " highlight three columns after 'textwidth' +--- :hi ColorColumn ctermbg=lightgrey guibg=lightgrey +--- ``` +--- When 'textwidth' is zero then the items with '-' and '+' are not used. +--- A maximum of 256 columns are highlighted. +--- +--- @type string +vim.o.colorcolumn = "" +vim.o.cc = vim.o.colorcolumn +vim.wo.colorcolumn = vim.o.colorcolumn +vim.wo.cc = vim.wo.colorcolumn + +--- Number of columns of the screen. Normally this is set by the terminal +--- initialization and does not have to be set by hand. +--- When Vim is running in the GUI or in a resizable window, setting this +--- option will cause the window size to be changed. When you only want +--- to use the size for the GUI, put the command in your `ginit.vim` file. +--- When you set this option and Vim is unable to change the physical +--- number of columns of the display, the display may be messed up. For +--- the GUI it is always possible and Vim limits the number of columns to +--- what fits on the screen. You can use this command to get the widest +--- window possible: +--- ``` +--- :set columns=9999 +--- ``` +--- Minimum value is 12, maximum value is 10000. +--- +--- @type integer +vim.o.columns = 80 +vim.o.co = vim.o.columns +vim.go.columns = vim.o.columns +vim.go.co = vim.go.columns + +--- A comma-separated list of strings that can start a comment line. See +--- `format-comments`. See `option-backslash` about using backslashes to +--- insert a space. +--- +--- @type string +vim.o.comments = "s1:/*,mb:*,ex:*/,://,b:#,:%,:XCOMM,n:>,fb:-" +vim.o.com = vim.o.comments +vim.bo.comments = vim.o.comments +vim.bo.com = vim.bo.comments + +--- A template for a comment. The "%s" in the value is replaced with the +--- comment text. For example, C uses "/*%s*/". Currently only used to +--- add markers for folding, see `fold-marker`. +--- +--- @type string +vim.o.commentstring = "" +vim.o.cms = vim.o.commentstring +vim.bo.commentstring = vim.o.commentstring +vim.bo.cms = vim.bo.commentstring + +--- This option specifies how keyword completion `ins-completion` works +--- when CTRL-P or CTRL-N are used. It is also used for whole-line +--- completion `i_CTRL-X_CTRL-L`. It indicates the type of completion +--- and the places to scan. It is a comma-separated list of flags: +--- . scan the current buffer ('wrapscan' is ignored) +--- w scan buffers from other windows +--- b scan other loaded buffers that are in the buffer list +--- u scan the unloaded buffers that are in the buffer list +--- U scan the buffers that are not in the buffer list +--- k scan the files given with the 'dictionary' option +--- kspell use the currently active spell checking `spell` +--- k{dict} scan the file {dict}. Several "k" flags can be given, +--- patterns are valid too. For example: +--- ``` +--- :set cpt=k/usr/dict/*,k~/spanish +--- ``` +--- s scan the files given with the 'thesaurus' option +--- s{tsr} scan the file {tsr}. Several "s" flags can be given, patterns +--- are valid too. +--- i scan current and included files +--- d scan current and included files for defined name or macro +--- `i_CTRL-X_CTRL-D` +--- ] tag completion +--- t same as "]" +--- +--- Unloaded buffers are not loaded, thus their autocmds `:autocmd` are +--- not executed, this may lead to unexpected completions from some files +--- (gzipped files for example). Unloaded buffers are not scanned for +--- whole-line completion. +--- +--- As you can see, CTRL-N and CTRL-P can be used to do any 'iskeyword'- +--- 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). +--- +--- @type string +vim.o.complete = ".,w,b,u,t" +vim.o.cpt = vim.o.complete +vim.bo.complete = vim.o.complete +vim.bo.cpt = vim.bo.complete + +--- This option specifies a function to be used for Insert mode completion +--- with CTRL-X CTRL-U. `i_CTRL-X_CTRL-U` +--- See `complete-functions` for an explanation of how the function is +--- invoked and what it should return. The value can be the name of a +--- function, a `lambda` or a `Funcref`. See `option-value-function` for +--- more information. +--- This option cannot be set from a `modeline` or in the `sandbox`, for +--- security reasons. +--- +--- @type string +vim.o.completefunc = "" +vim.o.cfu = vim.o.completefunc +vim.bo.completefunc = vim.o.completefunc +vim.bo.cfu = vim.bo.completefunc + +--- A comma-separated list of options for Insert mode completion +--- `ins-completion`. The supported values are: +--- +--- menu Use a popup menu to show the possible completions. The +--- menu is only shown when there is more than one match and +--- sufficient colors are available. `ins-completion-menu` +--- +--- menuone Use the popup menu also when there is only one match. +--- Useful when there is additional information about the +--- match, e.g., what file it comes from. +--- +--- longest Only insert the longest common text of the matches. If +--- the menu is displayed you can use CTRL-L to add more +--- characters. Whether case is ignored depends on the kind +--- of completion. For buffer text the 'ignorecase' option is +--- used. +--- +--- preview Show extra information about the currently selected +--- completion in the preview window. Only works in +--- combination with "menu" or "menuone". +--- +--- noinsert Do not insert any text for a match until the user selects +--- 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". +--- +--- @type string +vim.o.completeopt = "menu,preview" +vim.o.cot = vim.o.completeopt +vim.go.completeopt = vim.o.completeopt +vim.go.cot = vim.go.completeopt + +--- only for MS-Windows +--- When this option is set it overrules 'shellslash' for completion: +--- - When this option is set to "slash", a forward slash is used for path +--- completion in insert mode. This is useful when editing HTML tag, or +--- Makefile with 'noshellslash' on MS-Windows. +--- - When this option is set to "backslash", backslash is used. This is +--- useful when editing a batch file with 'shellslash' set on MS-Windows. +--- - When this option is empty, same character is used as for +--- 'shellslash'. +--- For Insert mode completion the buffer-local value is used. For +--- command line completion the global value is used. +--- +--- @type string +vim.o.completeslash = "" +vim.o.csl = vim.o.completeslash +vim.bo.completeslash = vim.o.completeslash +vim.bo.csl = vim.bo.completeslash + +--- 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 +--- other lines. +--- n Normal mode +--- v Visual mode +--- i Insert mode +--- c Command line editing, for 'incsearch' +--- +--- 'v' applies to all lines in the Visual area, not only the cursor. +--- A useful value is "nc". This is used in help files. So long as you +--- are moving around text is concealed, but when starting to insert text +--- or selecting a Visual area the concealed text is displayed, so that +--- you can see what you are doing. +--- Keep in mind that the cursor position is not always where it's +--- displayed. E.g., when moving vertically it may change column. +--- +--- @type string +vim.o.concealcursor = "" +vim.o.cocu = vim.o.concealcursor +vim.wo.concealcursor = vim.o.concealcursor +vim.wo.cocu = vim.wo.concealcursor + +--- Determine how text with the "conceal" syntax attribute `:syn-conceal` +--- is shown: +--- +--- Value Effect ~ +--- 0 Text is shown normally +--- 1 Each block of concealed text is replaced with one +--- character. If the syntax item does not have a custom +--- replacement character defined (see `:syn-cchar`) the +--- character defined in 'listchars' is used. +--- It is highlighted with the "Conceal" highlight group. +--- 2 Concealed text is completely hidden unless it has a +--- custom replacement character defined (see +--- `:syn-cchar`). +--- 3 Concealed text is completely hidden. +--- +--- Note: in the cursor line concealed text is not hidden, so that you can +--- edit and copy the text. This can be changed with the 'concealcursor' +--- option. +--- +--- @type integer +vim.o.conceallevel = 0 +vim.o.cole = vim.o.conceallevel +vim.wo.conceallevel = vim.o.conceallevel +vim.wo.cole = vim.wo.conceallevel + +--- When 'confirm' is on, certain operations that would normally +--- fail because of unsaved changes to a buffer, e.g. ":q" and ":e", +--- instead raise a dialog asking if you wish to save the current +--- file(s). You can still use a ! to unconditionally `abandon` a buffer. +--- If 'confirm' is off you can still activate confirmation for one +--- command only (this is most useful in mappings) with the `:confirm` +--- command. +--- Also see the `confirm()` function and the 'v' flag in 'guioptions'. +--- +--- @type boolean +vim.o.confirm = false +vim.o.cf = vim.o.confirm +vim.go.confirm = vim.o.confirm +vim.go.cf = vim.go.confirm + +--- Copy the structure of the existing lines indent when autoindenting a +--- new line. Normally the new indent is reconstructed by a series of +--- tabs followed by spaces as required (unless `'expandtab'` is enabled, +--- in which case only spaces are used). Enabling this option makes the +--- new line copy whatever characters were used for indenting on the +--- existing line. 'expandtab' has no effect on these characters, a Tab +--- remains a Tab. If the new indent is greater than on the existing +--- line, the remaining space is filled in the normal manner. +--- See 'preserveindent'. +--- +--- @type boolean +vim.o.copyindent = false +vim.o.ci = vim.o.copyindent +vim.bo.copyindent = vim.o.copyindent +vim.bo.ci = vim.bo.copyindent + +--- A sequence of single character flags. When a character is present +--- this indicates Vi-compatible behavior. This is used for things where +--- not being Vi-compatible is mostly or sometimes preferred. +--- 'cpoptions' stands for "compatible-options". +--- Commas can be added for readability. +--- To avoid problems with flags that are added in the future, use the +--- "+=" and "-=" feature of ":set" `add-option-flags`. +--- +--- contains behavior ~ +--- *cpo-a* +--- a When included, a ":read" command with a file name +--- argument will set the alternate file name for the +--- current window. +--- *cpo-A* +--- A When included, a ":write" command with a file name +--- argument will set the alternate file name for the +--- current window. +--- *cpo-b* +--- b "\|" in a ":map" command is recognized as the end of +--- the map command. The '\' is included in the mapping, +--- the text after the '|' is interpreted as the next +--- command. Use a CTRL-V instead of a backslash to +--- include the '|' in the mapping. Applies to all +--- mapping, abbreviation, menu and autocmd commands. +--- See also `map_bar`. +--- *cpo-B* +--- B A backslash has no special meaning in mappings, +--- abbreviations, user commands and the "to" part of the +--- menu commands. Remove this flag to be able to use a +--- backslash like a CTRL-V. For example, the command +--- ":map X \\" results in X being mapped to: +--- 'B' included: "\^[" (^[ is a real ) +--- 'B' excluded: "" (5 characters) +--- *cpo-c* +--- c Searching continues at the end of any match at the +--- cursor position, but not further than the start of the +--- next line. When not present searching continues +--- one character from the cursor position. With 'c' +--- "abababababab" only gets three matches when repeating +--- "/abab", without 'c' there are five matches. +--- *cpo-C* +--- C Do not concatenate sourced lines that start with a +--- backslash. See `line-continuation`. +--- *cpo-d* +--- d Using "./" in the 'tags' option doesn't mean to use +--- the tags file relative to the current file, but the +--- tags file in the current directory. +--- *cpo-D* +--- D Can't use CTRL-K to enter a digraph after Normal mode +--- commands with a character argument, like `r`, `f` and +--- `t`. +--- *cpo-e* +--- e When executing a register with ":@r", always add a +--- to the last line, also when the register is not +--- linewise. If this flag is not present, the register +--- is not linewise and the last line does not end in a +--- , then the last line is put on the command-line +--- and can be edited before hitting . +--- *cpo-E* +--- E It is an error when using "y", "d", "c", "g~", "gu" or +--- "gU" on an Empty region. The operators only work when +--- at least one character is to be operated on. Example: +--- This makes "y0" fail in the first column. +--- *cpo-f* +--- f When included, a ":read" command with a file name +--- argument will set the file name for the current buffer, +--- if the current buffer doesn't have a file name yet. +--- *cpo-F* +--- F When included, a ":write" command with a file name +--- argument will set the file name for the current +--- buffer, if the current buffer doesn't have a file name +--- yet. Also see `cpo-P`. +--- *cpo-i* +--- i When included, interrupting the reading of a file will +--- leave it modified. +--- *cpo-I* +--- I When moving the cursor up or down just after inserting +--- indent for 'autoindent', do not delete the indent. +--- *cpo-J* +--- J A `sentence` has to be followed by two spaces after +--- the '.', '!' or '?'. A is not recognized as +--- white space. +--- *cpo-K* +--- K Don't wait for a key code to complete when it is +--- halfway through a mapping. This breaks mapping +--- when only part of the second has been +--- read. It enables cancelling the mapping by typing +--- . +--- *cpo-l* +--- l Backslash in a [] range in a search pattern is taken +--- literally, only "\]", "\^", "\-" and "\\" are special. +--- See `/[]` +--- 'l' included: "/[ \t]" finds , '\' and 't' +--- 'l' excluded: "/[ \t]" finds and +--- *cpo-L* +--- L When the 'list' option is set, 'wrapmargin', +--- 'textwidth', 'softtabstop' and Virtual Replace mode +--- (see `gR`) count a as two characters, instead of +--- the normal behavior of a . +--- *cpo-m* +--- m When included, a showmatch will always wait half a +--- second. When not included, a showmatch will wait half +--- a second or until a character is typed. `'showmatch'` +--- *cpo-M* +--- M When excluded, "%" matching will take backslashes into +--- account. Thus in "( \( )" and "\( ( \)" the outer +--- parenthesis match. When included "%" ignores +--- backslashes, which is Vi compatible. +--- *cpo-n* +--- n When included, the column used for 'number' and +--- 'relativenumber' will also be used for text of wrapped +--- lines. +--- *cpo-o* +--- o Line offset to search command is not remembered for +--- next search. +--- *cpo-O* +--- O Don't complain if a file is being overwritten, even +--- when it didn't exist when editing it. This is a +--- protection against a file unexpectedly created by +--- someone else. Vi didn't complain about this. +--- *cpo-p* +--- p Vi compatible Lisp indenting. When not present, a +--- slightly better algorithm is used. +--- *cpo-P* +--- P When included, a ":write" command that appends to a +--- file will set the file name for the current buffer, if +--- the current buffer doesn't have a file name yet and +--- the 'F' flag is also included `cpo-F`. +--- *cpo-q* +--- q When joining multiple lines leave the cursor at the +--- position where it would be when joining two lines. +--- *cpo-r* +--- r Redo ("." command) uses "/" to repeat a search +--- command, instead of the actually used search string. +--- *cpo-R* +--- R Remove marks from filtered lines. Without this flag +--- marks are kept like `:keepmarks` was used. +--- *cpo-s* +--- s Set buffer options when entering the buffer for the +--- first time. This is like it is in Vim version 3.0. +--- And it is the default. If not present the options are +--- set when the buffer is created. +--- *cpo-S* +--- S Set buffer options always when entering a buffer +--- (except 'readonly', 'fileformat', 'filetype' and +--- 'syntax'). This is the (most) Vi compatible setting. +--- The options are set to the values in the current +--- buffer. When you change an option and go to another +--- buffer, the value is copied. Effectively makes the +--- buffer options global to all buffers. +--- +--- 's' 'S' copy buffer options +--- no no when buffer created +--- yes no when buffer first entered (default) +--- X yes each time when buffer entered (vi comp.) +--- *cpo-t* +--- t Search pattern for the tag command is remembered for +--- "n" command. Otherwise Vim only puts the pattern in +--- the history for search pattern, but doesn't change the +--- last used search pattern. +--- *cpo-u* +--- u Undo is Vi compatible. See `undo-two-ways`. +--- *cpo-v* +--- v Backspaced characters remain visible on the screen in +--- Insert mode. Without this flag the characters are +--- erased from the screen right away. With this flag the +--- screen newly typed text overwrites backspaced +--- characters. +--- *cpo-W* +--- W Don't overwrite a readonly file. When omitted, ":w!" +--- overwrites a readonly file, if possible. +--- *cpo-x* +--- x on the command-line executes the command-line. +--- The default in Vim is to abandon the command-line, +--- because normally aborts a command. `c_` +--- *cpo-X* +--- X When using a count with "R" the replaced text is +--- deleted only once. Also when repeating "R" with "." +--- and a count. +--- *cpo-y* +--- y A yank command can be redone with ".". Think twice if +--- you really want to use this, it may break some +--- plugins, since most people expect "." to only repeat a +--- change. +--- *cpo-Z* +--- Z When using "w!" while the 'readonly' option is set, +--- don't reset 'readonly'. +--- *cpo-!* +--- ! When redoing a filter command, use the last used +--- external command, whatever it was. Otherwise the last +--- used -filter- command is used. +--- *cpo-$* +--- $ When making a change to one line, don't redisplay the +--- line, but put a '$' at the end of the changed text. +--- The changed text will be overwritten when you type the +--- new text. The line is redisplayed if you type any +--- command that moves the cursor from the insertion +--- point. +--- *cpo-%* +--- % Vi-compatible matching is done for the "%" command. +--- Does not recognize "#if", "#endif", etc. +--- Does not recognize "/*" and "*/". +--- Parens inside single and double quotes are also +--- counted, causing a string that contains a paren to +--- disturb the matching. For example, in a line like +--- "if (strcmp("foo(", s))" the first paren does not +--- match the last one. When this flag is not included, +--- parens inside single and double quotes are treated +--- specially. When matching a paren outside of quotes, +--- everything inside quotes is ignored. When matching a +--- paren inside quotes, it will find the matching one (if +--- there is one). This works very well for C programs. +--- This flag is also used for other features, such as +--- C-indenting. +--- *cpo-+* +--- + When included, a ":write file" command will reset the +--- 'modified' flag of the buffer, even though the buffer +--- itself may still be different from its file. +--- *cpo->* +--- > When appending to a register, put a line break before +--- the appended text. +--- *cpo-;* +--- ; When using `,` or `;` to repeat the last `t` search +--- and the cursor is right in front of the searched +--- character, the cursor won't move. When not included, +--- the cursor would skip over it and jump to the +--- following occurrence. +--- *cpo-_* +--- _ When using `cw` on a word, do not include the +--- whitespace following the word in the motion. +--- +--- @type string +vim.o.cpoptions = "aABceFs_" +vim.o.cpo = vim.o.cpoptions +vim.go.cpoptions = vim.o.cpoptions +vim.go.cpo = vim.go.cpoptions + +--- When this option is set, as the cursor in the current +--- window moves other cursorbound windows (windows that also have +--- this option set) move their cursors to the corresponding line and +--- column. This option is useful for viewing the +--- differences between two versions of a file (see 'diff'); in diff mode, +--- inserted and deleted lines (though not characters within a line) are +--- taken into account. +--- +--- @type boolean +vim.o.cursorbind = false +vim.o.crb = vim.o.cursorbind +vim.wo.cursorbind = vim.o.cursorbind +vim.wo.crb = vim.wo.cursorbind + +--- Highlight the screen column of the cursor with CursorColumn +--- `hl-CursorColumn`. Useful to align text. Will make screen redrawing +--- slower. +--- If you only want the highlighting in the current window you can use +--- these autocommands: +--- ``` +--- au WinLeave * set nocursorline nocursorcolumn +--- au WinEnter * set cursorline cursorcolumn +--- ``` +--- +--- @type boolean +vim.o.cursorcolumn = false +vim.o.cuc = vim.o.cursorcolumn +vim.wo.cursorcolumn = vim.o.cursorcolumn +vim.wo.cuc = vim.wo.cursorcolumn + +--- Highlight the text line of the cursor with CursorLine `hl-CursorLine`. +--- Useful to easily spot the cursor. Will make screen redrawing slower. +--- When Visual mode is active the highlighting isn't used to make it +--- easier to see the selected text. +--- +--- @type boolean +vim.o.cursorline = false +vim.o.cul = vim.o.cursorline +vim.wo.cursorline = vim.o.cursorline +vim.wo.cul = vim.wo.cursorline + +--- Comma-separated list of settings for how 'cursorline' is displayed. +--- Valid values: +--- "line" Highlight the text line of the cursor with +--- CursorLine `hl-CursorLine`. +--- "screenline" Highlight only the screen line of the cursor with +--- CursorLine `hl-CursorLine`. +--- "number" Highlight the line number of the cursor with +--- CursorLineNr `hl-CursorLineNr`. +--- +--- Special value: +--- "both" Alias for the values "line,number". +--- +--- "line" and "screenline" cannot be used together. +--- +--- @type string +vim.o.cursorlineopt = "both" +vim.o.culopt = vim.o.cursorlineopt +vim.wo.cursorlineopt = vim.o.cursorlineopt +vim.wo.culopt = vim.wo.cursorlineopt + +--- These values can be used: +--- msg Error messages that would otherwise be omitted will be given +--- anyway. +--- throw Error messages that would otherwise be omitted will be given +--- anyway and also throw an exception and set `v:errmsg`. +--- beep A message will be given when otherwise only a beep would be +--- produced. +--- The values can be combined, separated by a comma. +--- "msg" and "throw" are useful for debugging 'foldexpr', 'formatexpr' or +--- 'indentexpr'. +--- +--- @type string +vim.o.debug = "" +vim.go.debug = vim.o.debug + +--- 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 +--- commands like "[i" and "[d" `include-search`. The 'isident' option is +--- used to recognize the defined name after the match: +--- ``` +--- {match with 'define'}{non-ID chars}{defined name}{non-ID char} +--- ``` +--- See `option-backslash` about inserting backslashes to include a space +--- or backslash. +--- For C++ this value would be useful, to include const type declarations: +--- ``` +--- ^\(#\s*define\|[a-z]*\s*const\s*[a-z]*\) +--- ``` +--- You can also use "\ze" just before the name and continue the pattern +--- to check what is following. E.g. for Javascript, if a function is +--- defined with `func_name = function(args)`: +--- ``` +--- ^\s*\ze\i\+\s*=\s*function( +--- ``` +--- If the function is defined with `func_name : function() {...`: +--- ``` +--- ^\s*\ze\i\+\s*[:]\s*(*function\s*( +--- ``` +--- When using the ":set" command, you nee