nixeovim/modules/vim/options.nix

1909 lines
52 KiB
Nix
Raw Normal View History

2024-05-13 14:30:59 +03:00
{ lib }:
let
inherit (builtins) mapAttrs;
mkVimOptOption =
key:
{ type
, default
, description ? ""
, extraHelp ? [ ]
, apply ? null
}:
lib.mkOption {
type = lib.types.nullOr type;
inherit apply;
default = null;
defaultText = lib.literalExpression (builtins.toJSON default);
description = lib.concatLines (
[ description "" ]
++ map (help: "`:help ${help}") ([ key ] ++ extraHelp)
);
};
2024-05-15 00:14:28 +03:00
sharedGlobalOrWindow = with lib; with types; {
fillchars = {
type = (listOf (enum [
2024-05-13 14:30:59 +03:00
"stl"
"stlnc"
"wbr"
"horiz"
"horizup"
"horizdown"
"vert"
"vertleft"
"vertright"
"verthoriz"
"fold"
"foldopen"
"foldclose"
"foldsep"
"diff"
"msgsep"
"eob"
"lastline"
]));
default = [ ];
2024-05-13 14:30:59 +03:00
description = ''
Characters to fill the statuslines, vertical separators and special lines in the window.
'';
};
2024-05-15 00:14:28 +03:00
};
sharedGlobalOrBuffer = with lib; with types; {
autoread = {
type = bool;
2024-05-15 00:14:28 +03:00
description = ''
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|
'';
};
backupcopy = {
type = (listOf (enum [ "yes" "no" "auto" "breaksymlink" "breakhardlink" ]));
2024-05-15 00:14:28 +03:00
description = ''
When writing a file and a backup is made, this option tells how it's
done. This is a comma-separated list of words.
'';
};
2024-05-13 14:30:59 +03:00
formatprg = {
type = str;
default = "";
2024-05-13 14:30:59 +03:00
description = ''
The name of an external program that will be used to format the lines
selected with the |gq| operator. The program must take the input on
stdin and produce the output on stdout.
'';
};
grepprg = {
type = str;
default = ''
2024-05-13 14:30:59 +03:00
default "grep -n ",
Unix: "grep -n $* /dev/null"
'';
};
include = {
type = str;
default = ''^\s*#\s*include'';
2024-05-13 14:30:59 +03:00
description = ''
Pattern to be used to find an include command.
'';
};
keywordprg = {
type = str;
default = ''
2024-05-13 14:30:59 +03:00
Windows: ":help"
otherwise: ":Man"
'';
description = ''
Program to use for the |K| command.
'';
};
lispwords = {
type = (listOf str);
default = is very long;
2024-05-13 14:30:59 +03:00
description = ''
list of words that influence the Lisp indenting when
enabled with the |'lisp'| option.
'';
};
makeencoding = {
type = str;
default = "";
2024-05-15 00:14:28 +03:00
description = ''
Encoding used for reading the output of external commands. When empty,
encoding is not converted.
This is used for `:make`, `:lmake`, `:grep`, `:lgrep`, `:grepadd`,
`:lgrepadd`, `:cfile`, `:cgetfile`, `:caddfile`, `:lfile`, `:lgetfile`,
and `:laddfile`.
2024-05-15 00:14:28 +03:00
'';
};
};
2024-05-13 14:30:59 +03:00
2024-05-15 00:14:28 +03:00
global = with lib; with types; sharedGlobalOrWindow // sharedGlobalOrBuffer // {
allowrevins = {
type = bool;
2024-05-13 14:30:59 +03:00
description = ''
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
2024-05-13 14:30:59 +03:00
'';
};
2024-05-15 00:14:28 +03:00
ambiwidth = {
type = (enum [ "single" "double" ]);
2024-05-13 14:30:59 +03:00
description = ''
Tells Vim what to do with characters with East Asian Width Class
Ambiguous (such as Euro, Registered Sign, Copyright Sign, Greek
letters, Cyrillic letters).
2024-05-13 14:30:59 +03:00
'';
};
2024-05-15 00:14:28 +03:00
autochdir = {
type = bool;
2024-05-13 14:30:59 +03:00
description = ''
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.
2024-05-13 14:30:59 +03:00
'';
};
2024-05-15 00:14:28 +03:00
arabicshape = {
type = bool;
default = false;
2024-05-13 14:30:59 +03:00
description = ''
2024-05-15 00:14:28 +03:00
When on and 'termbidi' is off, the required visual character
corrections that need to take place for displaying the Arabic language
take effect.
2024-05-13 14:30:59 +03:00
'';
};
autowrite = {
type = bool;
2024-05-13 14:30:59 +03:00
description = ''
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.
2024-05-13 14:30:59 +03:00
'';
};
autowriteall = {
type = bool;
2024-05-13 14:30:59 +03:00
description = ''
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.
2024-05-13 14:30:59 +03:00
'';
};
background = {
type = str;
2024-05-13 14:30:59 +03:00
description = ''
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.
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.
2024-05-13 14:30:59 +03:00
'';
};
backspace = {
type = (listOf (enum [ "indent" "eol" "start" "nostop" ]));
2024-05-13 14:30:59 +03:00
description = ''
Influences the working of <BS>, <Del>, 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:
2024-05-13 14:30:59 +03:00
'';
};
backup = {
type = bool;
2024-05-13 14:30:59 +03:00
description = ''
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.
'';
extraHelp = [ "backup-table" ];
2024-05-13 14:30:59 +03:00
};
backupdir = {
type = (listOf (either str path));
2024-05-13 14:30:59 +03:00
description = ''
List of directories for the backup file, separated with commas.
2024-05-13 14:30:59 +03:00
'';
};
backupext = {
type = str;
2024-05-13 14:30:59 +03:00
description = ''
str which is appended to a file name to make the name of the
2024-05-13 14:30:59 +03:00
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.
2024-05-13 14:30:59 +03:00
'';
};
backupskip = {
type = (listOf (either str path));
2024-05-13 14:30:59 +03:00
description = ''
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.
2024-05-13 14:30:59 +03:00
'';
};
belloff = {
type = (listOf (enum [
2024-05-13 14:30:59 +03:00
"all"
"backspace"
"cursor"
"complete"
"copy"
"ctrlg"
"error"
"esc"
"hangul"
"lang"
"mess"
"showmatch"
"operator"
"register"
"shell"
"spell"
"willmode"
]));
description = ''
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 <BS> or <Del> and deleting results in an error.
cursor | Fail to move around using the cursor keys or
| <PageUp>/<PageDown> 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 <C-G> in Insert mode.
error | Other Error occurred (e.g. try to join last line)
| (mostly used in |Normal-mode| or |Cmdline-mode|).
esc | hitting <Esc> 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 <C-R> 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).
2024-05-13 14:30:59 +03:00
'';
};
breakat = {
type = str;
2024-05-13 14:30:59 +03:00
description = ''
This option lets you choose which characters might cause a line
break if 'linebreak' is on. Only works for ASCII characters.
2024-05-13 14:30:59 +03:00
'';
};
browsedir = {
type = (either path (enum [ "last" "buffer" "current" ]));
2024-05-13 14:30:59 +03:00
description = ''
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
2024-05-13 14:30:59 +03:00
'';
};
casemap = {
type = (listOf (enum [ "internal" "keepascii" ]));
2024-05-13 14:30:59 +03:00
description = ''
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.
2024-05-13 14:30:59 +03:00
'';
};
cedit = {
type = str;
2024-05-13 14:30:59 +03:00
description = ''
The key used in Command-line Mode to open the command-line window.
Only non-printable keys are allowed.
2024-05-13 14:30:59 +03:00
'';
};
charconvert = {
type = str;
default = "";
2024-05-15 00:14:28 +03:00
description = ''
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.
2024-05-15 00:14:28 +03:00
'';
};
clipboard = {
type = (listOf (enum [ "unnamed" "unnamedplus" ]));
2024-05-13 14:30:59 +03:00
description = ''
This option is a list of comma-separated names.
2024-05-13 14:30:59 +03:00
'';
};
cmdheight = {
type = number;
2024-05-13 14:30:59 +03:00
description = ''
Number of screen lines to use for the command-line. Helps avoiding |hit-enter| prompts.
2024-05-13 14:30:59 +03:00
'';
};
cmdwinheight = {
type = number;
2024-05-13 14:30:59 +03:00
description = ''
Number of screen lines to use for the command-line window.
'';
extraHelp = [ "cmdwin" ];
2024-05-13 14:30:59 +03:00
};
completeopt = {
type = (listOf (enum [
2024-05-13 14:30:59 +03:00
"menu"
"menuone"
"longest"
"preview"
"noinsert"
"noselect"
]));
description = ''
A comma-separated list of options for Insert mode completion |ins-completion|.
2024-05-13 14:30:59 +03:00
'';
};
confirm = {
type = bool;
2024-05-13 14:30:59 +03:00
description = ''
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.
2024-05-13 14:30:59 +03:00
'';
};
cpoptions = {
type = str;
2024-05-13 14:30:59 +03:00
default = true;
description = ''
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.
2024-05-13 14:30:59 +03:00
'';
};
debug = {
type = (listOf (enum [ "msg" "throw" "beep" ]));
2024-05-13 14:30:59 +03:00
description = ''
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'.
2024-05-13 14:30:59 +03:00
'';
};
define = {
type = str;
2024-05-13 14:30:59 +03:00
description = ''
Pattern to be used to find a macro definition.
2024-05-13 14:30:59 +03:00
'';
};
delcombine = {
type = bool;
2024-05-13 14:30:59 +03:00
description = ''
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
default) the character along with its combining characters are
deleted.
2024-05-13 14:30:59 +03:00
'';
};
dictionary = {
type = (listOf (either str path));
2024-05-13 14:30:59 +03:00
description = ''
List of file names, separated by commas, that are used to lookup words
for keyword completion commands |i_CTRL-X_CTRL-K|. Each file should
contain a list of words. This can be one word per line, or several
words per line, separated by non-keyword characters (white space is
preferred). Maximum line length is 510 bytes.
2024-05-13 14:30:59 +03:00
'';
};
diffexpr = {
type = str;
2024-05-13 14:30:59 +03:00
description = ''
Expression which is evaluated to obtain a diff file (either ed-style
or unified-style) from two versions of a file.
2024-05-13 14:30:59 +03:00
'';
extraHelp = [ "diff-diffexpr" ];
2024-05-13 14:30:59 +03:00
};
diffopt = {
type = (listOf str);
2024-05-13 14:30:59 +03:00
description = ''
Option settings for diff mode.
2024-05-13 14:30:59 +03:00
'';
};
digraph = {
type = bool;
2024-05-13 14:30:59 +03:00
description = ''
Enable the entering of digraphs in Insert mode with {char1} <BS> {char2}.
2024-05-13 14:30:59 +03:00
'';
extraHelp = [ "digraphs" ];
2024-05-13 14:30:59 +03:00
};
directory = {
type = (listOf (either str path));
2024-05-13 14:30:59 +03:00
description = ''
List of directory names for the swap file, separated with commas.
2024-05-13 14:30:59 +03:00
'';
};
display = {
type = (listOf (enum [ "lastline" "truncate" "uhex" "msgsep" ]));
2024-05-13 14:30:59 +03:00
description = ''
Change the way text is displayed.
2024-05-13 14:30:59 +03:00
'';
};
eadirection = {
type = (enum [ "ver" "hor" "both" ]);
2024-05-13 14:30:59 +03:00
description = ''
Tells when the 'equalalways' option applies:
2024-05-13 14:30:59 +03:00
'';
};
emoji = {
type = bool;
2024-05-13 14:30:59 +03:00
description = ''
When on all Unicode emoji characters are considered to be full width.
This excludes "text emoji" characters, which are normally displayed as
single width.
2024-05-13 14:30:59 +03:00
'';
};
equalalways = {
type = bool;
2024-05-13 14:30:59 +03:00
description = ''
When on, all the windows are automatically made the same size after
splitting or closing a window. This also happens the moment the
option is switched on. When off, splitting a window will reduce the
size of the current window and leave the other windows the same.
2024-05-13 14:30:59 +03:00
'';
};
equalprg = {
type = str;
2024-05-13 14:30:59 +03:00
description = ''
External program to use for "=" command. When this option is empty
the internal formatting functions are used; either 'lisp', 'cindent'
or 'indentexpr'.
2024-05-13 14:30:59 +03:00
'';
};
errorbells = {
type = bool;
default = false;
2024-05-13 14:30:59 +03:00
description = ''
Ring the bell (beep or screen flash) for error messages. This only
makes a difference for error messages, the bell will be used always
for a lot of errors without a message
2024-05-13 14:30:59 +03:00
'';
};
errorfile = {
type = str;
default = "errors.err";
2024-05-13 14:30:59 +03:00
description = ''
Name of the errorfile for the QuickFix mode.
2024-05-13 14:30:59 +03:00
'';
extraHelp = [ "cf" ];
2024-05-13 14:30:59 +03:00
};
errorformat = {
type = str;
2024-05-13 14:30:59 +03:00
description = ''
Scanf-like description of the format for the lines in the error file
2024-05-13 14:30:59 +03:00
'';
};
eventignore = {
type = (listOf str);
default = [ ];
2024-05-13 14:30:59 +03:00
description = ''
A list of autocommand event names, which are to be ignored.
When set to "all" or when "all" is one of the items, all autocommand
events are ignored, autocommands will not be executed.
2024-05-13 14:30:59 +03:00
'';
};
exrc = {
type = bool;
default = false;
2024-05-13 14:30:59 +03:00
description = ''
Automatically execute .nvim.lua, .nvimrc, and .exrc files in the
current directory, if the file is in the |trust| list. Use |:trust| to
manage trusted files.
2024-05-13 14:30:59 +03:00
'';
extraHelp = [ ":trust" ];
2024-05-13 14:30:59 +03:00
};
fileencodings = {
type = (listOf str);
default = ''["ucs-bom" "utf-8" "default" "latin1"]'';
2024-05-13 14:30:59 +03:00
description = ''
This is a list of character encodings considered when starting to edit
an existing file.
2024-05-13 14:30:59 +03:00
'';
};
fileformats = {
type = (listOf (enum [ "dos" "unix" "mac" ]));
default = ''
2024-05-13 14:30:59 +03:00
Windows default: ["dos" "unix"],
Unix default: ["unix" "dos"]
'';
description = ''
This gives the end-of-line (<EOL>) formats that will be tried when
starting to edit a new buffer and when reading a file into an existing
buffer
2024-05-13 14:30:59 +03:00
'';
};
fileignorecase = {
type = bool;
default = ''
2024-05-13 14:30:59 +03:00
`true` for systems where case in file names is normally ignored"
'';
description = ''
When set case is ignored when using file names and directories.
2024-05-13 14:30:59 +03:00
'';
};
foldclose = {
type = str;
default = "";
2024-05-13 14:30:59 +03:00
description = ''
When set to "all", a fold is closed when the cursor isn't in it and
its level is higher than 'foldlevel'. Useful if you want folds to
automatically close when moving out of them.
2024-05-13 14:30:59 +03:00
'';
};
foldlevelstart = {
type = number;
default = -1;
2024-05-13 14:30:59 +03:00
description = ''
Sets 'foldlevel' when starting to edit another buffer in a window.
Useful to always start editing with all folds closed (value zero),
some folds closed (one) or no folds closed (99).
When the value is negative, it is not used.
2024-05-13 14:30:59 +03:00
'';
extraHelp = [ "foldlevel" ];
2024-05-13 14:30:59 +03:00
};
foldopen = {
type = (listOf (enum [
2024-05-13 14:30:59 +03:00
"all"
"block"
"hor"
"insert"
"jump"
"mark"
"percent"
"quickfix"
"search"
"tag"
"undo"
]));
default = ''
2024-05-13 14:30:59 +03:00
[
"block"
"hor"
"mark"
"percent"
"quickfix"
"search"
"tag"
"undo"
]
'';
description = ''
Specifies for which type of commands folds will be opened, if the
command moves the cursor into a closed fold. It is a comma-separated
list of items.
2024-05-13 14:30:59 +03:00
'';
};
fsync = {
type = bool;
default = true;
2024-05-13 14:30:59 +03:00
description = ''
When on, the OS function fsync() will be called after saving a file
(|:write|, |writefile()|, ), |swap-file|, |undo-persistence| and |shada-file|.
This flushes the file to disk, ensuring that it is safely written.
Slow on some systems: writing buffers, quitting Nvim, and other
operations may sometimes take a few seconds.
2024-05-13 14:30:59 +03:00
'';
};
gdefault = {
type = bool;
default = false;
2024-05-13 14:30:59 +03:00
description = ''
When on, the ":substitute" flag 'g' is default on. This means that
all matches in a line are substituted instead of one. When a 'g' flag
is given to a ":substitute" command, this will toggle the substitution
of all or one match. See |complex-change|.
2024-05-13 14:30:59 +03:00
'';
};
grepformat = {
type = str;
default = ''%f:%l:%m,%f:%l%m,%f %l%m'';
2024-05-13 14:30:59 +03:00
description = ''
Format to recognize for the ":grep" command output.
2024-05-13 14:30:59 +03:00
'';
extraHelp = [ "errorformat" ];
2024-05-13 14:30:59 +03:00
};
guicursor = {
type = str;
default = "n-v-c-sm:block,i-ci-ve:ver25,r-cr-o:hor20";
2024-05-13 14:30:59 +03:00
description = ''
Configures the cursor style for each mode. Works in the GUI and many
terminals. See |tui-cursor-shape|.
To disable cursor-styling, reset the option
2024-05-13 14:30:59 +03:00
'';
};
guifont = {
type = (listOf str);
default = [ ];
2024-05-13 14:30:59 +03:00
description = ''
This is a list of fonts which will be used for the GUI version of Vim.
In its simplest form the value is just one font name. When
the font cannot be found you will get an error message. To try other
font names a list can be specified, font names separated with commas.
The first valid font is used.
2024-05-13 14:30:59 +03:00
'';
};
guifontwide = {
type = (listOf str);
default = [ ];
2024-05-13 14:30:59 +03:00
description = ''
list of fonts to be used for double-width characters.
The first font that can be loaded is used.
2024-05-13 14:30:59 +03:00
'';
};
guioptions = {
type = str;
default = "egmrLT";
2024-05-13 14:30:59 +03:00
description = ''
This option only has an effect in the GUI version of Vim. It is a
sequence of letters which describes what components and options of the
GUI should be used.
2024-05-13 14:30:59 +03:00
'';
};
guitablabel = {
type = str;
default = "";
2024-05-13 14:30:59 +03:00
description = ''
When non-empty describes the text to use in a label of the GUI tab
pages line. When empty and when the result is empty Vim will use a
default label.
2024-05-13 14:30:59 +03:00
'';
extraHelp = [ "setting-guitablabel" ];
2024-05-13 14:30:59 +03:00
};
guitabtooltip = {
type = str;
default = "";
2024-05-13 14:30:59 +03:00
description = ''
When non-empty describes the text to use in a tooltip for the GUI tab
pages line. When empty Vim will use a default tooltip.
2024-05-13 14:30:59 +03:00
'';
};
helpfile = {
type = (either str path);
default = ''
2024-05-13 14:30:59 +03:00
default (MS-Windows) "$VIMRUNTIME\doc\help.txt"
(others) "$VIMRUNTIME/doc/help.txt"
2024-05-13 14:30:59 +03:00
'';
};
helpheight = {
type = number;
default = 20;
2024-05-13 14:30:59 +03:00
description = ''
Minimal initial height of the help window when it is opened with the ":help" command.
2024-05-13 14:30:59 +03:00
'';
};
helplang = {
type = (listOf str);
default = messages language or empty;
2024-05-13 14:30:59 +03:00
description = ''
list of languages. Vim will use the first language
for which the desired help can be found.
2024-05-13 14:30:59 +03:00
'';
};
hidden = {
type = bool;
default = true;
2024-05-13 14:30:59 +03:00
description = ''
When off a buffer is unloaded (including loss of undo information)
when it is abandoned. When on a buffer becomes hidden when it is
abandoned. A buffer displayed in another window does not become
hidden, of course.
2024-05-13 14:30:59 +03:00
'';
extraHelp = [
"abadon"
"bufhidden"
];
2024-05-13 14:30:59 +03:00
};
history = {
type = number;
default = 10000;
2024-05-13 14:30:59 +03:00
description = ''
A history of ":" commands, and a history of previous search patterns
is remembered. This option decides how many entries may be stored in
each of these histories
The maximum is 10000.
2024-05-13 14:30:59 +03:00
'';
extraHelp = [ "cmdline-editing" ];
2024-05-13 14:30:59 +03:00
};
hlsearch = {
type = bool;
default = true;
2024-05-13 14:30:59 +03:00
description = ''
When there is a previous search pattern, highlight all its matches.
2024-05-13 14:30:59 +03:00
'';
extraHelp = [
"incsearch"
"match"
];
2024-05-13 14:30:59 +03:00
};
icon = {
type = bool;
default = false;
2024-05-13 14:30:59 +03:00
description = ''
When on, the icon text of the window will be set to the value of
'iconstr' (if it is not empty), or to the name of the file
2024-05-13 14:30:59 +03:00
currently being edited. Only the last part of the name is used.
Overridden by the 'iconstr' option.
2024-05-13 14:30:59 +03:00
Only works if the terminal supports setting window icons.
2024-05-13 14:30:59 +03:00
'';
extraHelp = [ "iconstring" ];
2024-05-13 14:30:59 +03:00
};
iconstring = {
type = str;
default = "";
2024-05-13 14:30:59 +03:00
description = ''
When this option is not empty, it will be used for the icon text of the window.
2024-05-13 14:30:59 +03:00
'';
};
ignorecase = {
type = bool;
default = false;
2024-05-13 14:30:59 +03:00
description = ''
Ignore case in search patterns. Also used when searching in the tags file.
Also see 'smartcase' and 'tagcase'.
2024-05-13 14:30:59 +03:00
'';
};
imcmdline = {
type = bool;
default = false;
2024-05-13 14:30:59 +03:00
description = ''
When set the Input Method is always on when starting to edit a command
line, unless entering a search pattern.
2024-05-13 14:30:59 +03:00
'';
extraHelp = [ "imsearch" ];
2024-05-13 14:30:59 +03:00
};
imdisable = {
type = bool;
default = ''
false
true for some systems (SGI)
'';
2024-05-13 14:30:59 +03:00
description = ''
When set the Input Method is never used. This is useful to disable
the IM when it doesn't work properly.
2024-05-13 14:30:59 +03:00
'';
};
inccommand = {
type = (enum [ "nosplit" "split" ]);
default = "nosplit";
2024-05-13 14:30:59 +03:00
description = ''
When nonempty, shows the effects of |:substitute|, |:smagic|,
|:snomagic| and user commands with the |:command-preview| flag as you
type.
2024-05-13 14:30:59 +03:00
'';
};
incsearch = {
type = bool;
default = true;
2024-05-13 14:30:59 +03:00
description = ''
While typing a search command, show where the pattern, as it was typed
so far, matches. The matched str is highlighted. If the pattern
2024-05-13 14:30:59 +03:00
is invalid or not found, nothing is shown.
2024-05-13 14:30:59 +03:00
'';
};
isfname = {
type = str;
default = ''
2024-05-13 14:30:59 +03:00
Windows: "@,48-57,/,\,.,-,_,+,,,#,$,%,{,},[,],:,@-@,!,~,="
otherwise: "@,48-57,/,.,-,_,+,,,#,$,%,~,="
'';
};
isident = {
type = str;
default = ''
2024-05-13 14:30:59 +03:00
Windows: "@,48-57,_,128-167,224-235"
otherwise: "@,48-57,_,192-255"
'';
description = ''
The characters given by this option are included in identifiers.
Identifiers are used in recognizing environment variables and after a
match of the 'define' option.
2024-05-13 14:30:59 +03:00
'';
};
isprint = {
type = str;
default = "@,161-255";
2024-05-13 14:30:59 +03:00
description = ''
The characters given by this option are displayed directly on the
screen. It is also used for "\p" in a |pattern|.
2024-05-13 14:30:59 +03:00
'';
extraHelp = [ "pattern" ];
2024-05-13 14:30:59 +03:00
};
jumpoptions = {
type = str;
default = "";
description = ''
2024-05-13 14:30:59 +03:00
List of words that change the behavior of the |jumplist|
2024-05-13 14:30:59 +03:00
'';
extraHelp = [ "jumplist" ];
2024-05-13 14:30:59 +03:00
};
joinspaces = {
type = bool;
default = false;
2024-05-13 14:30:59 +03:00
description = ''
Insert two spaces after a '.', '?' and '!' with a join command.
Otherwise only one space is inserted.
2024-05-13 14:30:59 +03:00
'';
};
keymodel = {
type = (listOf str);
default = [ ];
2024-05-13 14:30:59 +03:00
description = ''
List of comma-separated words, which enable special things that keys can do.
2024-05-13 14:30:59 +03:00
'';
};
langmap = {
type = (listOf str);
default = [ ];
2024-05-13 14:30:59 +03:00
description = ''
This option allows switching your keyboard into a special language
mode. When you are typing text in Insert mode the characters are
inserted directly. When in Normal mode the 'langmap' option takes
care of translating these special characters to the original meaning
of the key. This means you don't have to change the keyboard mode to
be able to execute Normal mode commands.
2024-05-13 14:30:59 +03:00
'';
};
langmenu = {
type = str;
default = "";
2024-05-13 14:30:59 +03:00
description = ''
Language to use for menu translation.
2024-05-13 14:30:59 +03:00
'';
};
langremap = {
type = bool;
default = false;
2024-05-13 14:30:59 +03:00
description = ''
When off, setting 'langmap' does not apply to characters resulting from
a mapping. If setting 'langmap' disables some of your mappings, make
sure this option is off.
2024-05-13 14:30:59 +03:00
'';
};
laststatus = {
type = number;
default = 2;
2024-05-13 14:30:59 +03:00
description = ''
The value of this option influences when the last window will have a
status line:
- 0: never
- 1: only if there are at least two windows
- 2: always
- 3: always and ONLY the last window
2024-05-13 14:30:59 +03:00
'';
};
lazyredraw = {
type = bool;
default = false;
2024-05-13 14:30:59 +03:00
description = ''
When this option is set, the screen will not be redrawn while
executing macros, registers and other commands that have not been
typed. Also, updating the window title is postponed. To force an
update use |:redraw|.
2024-05-13 14:30:59 +03:00
'';
extraHelp = [ ":redraw" ];
2024-05-13 14:30:59 +03:00
};
linespace = {
type = number;
default = 0;
2024-05-13 14:30:59 +03:00
description = ''
Number of pixel lines inserted between characters. Useful if the font
uses the full character cell height, making lines touch each other.
When non-zero there is room for underlining.
2024-05-13 14:30:59 +03:00
'';
};
loadplugins = {
type = bool;
default = true;
2024-05-13 14:30:59 +03:00
description = ''
When on the plugin scripts are loaded when starting up |load-plugins|.
This option can be reset in your |vimrc| file to disable the loading
of plugins.
2024-05-13 14:30:59 +03:00
'';
};
magic = {
type = bool;
default = true;
2024-05-13 14:30:59 +03:00
description = ''
Changes the special characters that can be used in search patterns.
See |pattern|.
WARNING: Switching this option off most likely breaks plugins! That
is because many patterns assume it's on and will fail when it's off.
2024-05-13 14:30:59 +03:00
'';
};
makeef = {
type = (either str path);
default = "";
2024-05-13 14:30:59 +03:00
description = ''
Name of the errorfile for the |:make| command (see |:make_makeprg|)
and the |:grep| command.
When it is empty, an internally generated temp file will be used.
When "##" is included, it is replaced by a number to make the name
unique.
2024-05-13 14:30:59 +03:00
'';
};
};
2024-05-15 00:14:28 +03:00
window = with lib; with types; sharedGlobalOrWindow // {
arabic = {
type = bool;
default = false;
2024-05-15 00:14:28 +03:00
description = ''
This option can be set to start editing Arabic text.
2024-05-15 00:14:28 +03:00
'';
};
breakindent = {
type = bool;
default = false;
2024-05-15 00:14:28 +03:00
description = ''
Every wrapped line will continue visually indented (same amount of
space as the beginning of that line), thus preserving horizontal blocks
of text.
2024-05-15 00:14:28 +03:00
'';
};
breakindentopt = {
type = commas;
default = [ ];
2024-05-15 00:14:28 +03:00
description = ''
Settings for 'breakindent
2024-05-15 00:14:28 +03:00
'';
};
colorcolumn = {
type = commas;
default = [ ];
2024-05-15 00:14:28 +03:00
description = ''
'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.
'';
};
2024-05-15 00:14:28 +03:00
concealcursor = {
type = str;
default = "";
description = ''
Sets the modes in which text in the cursor line can also be concealed.
2024-05-15 00:14:28 +03:00
'';
};
2024-05-13 14:30:59 +03:00
conceallevel = {
type = number;
default = 0;
description = ''
Determine how text with the "conceal" syntax attribute |:syn-conceal|
is shown
'';
extraHelp = [ "syn-conceal" ];
};
cursorbind = {
type = bool;
default = false;
description = ''
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.
'';
};
foldcolumn = {
type = str;
default = "0";
2024-05-13 14:30:59 +03:00
description = ''
When and how to draw the foldcolumn. Valid values are:
"auto": resize to the minimum amount of folds to display.
"auto:[1-9]": resize to accommodate multiple folds up to the selected level
"0": to disable foldcolumn
"[1-9]": to display a fixed number of columns
2024-05-13 14:30:59 +03:00
'';
extraHelp = [ "folding" ];
2024-05-13 14:30:59 +03:00
};
foldenable = {
type = bool;
default = false;
2024-05-13 14:30:59 +03:00
description = ''
When off, all folds are open. This option can be used to quickly
switch between showing all text unfolded and viewing the text with
folds (including manually opened or closed folds). It can be toggled
with the |zi| command. The 'foldcolumn' will remain blank when
'foldenable' is off.
2024-05-13 14:30:59 +03:00
'';
extraHelp = [ "folding" ];
2024-05-13 14:30:59 +03:00
};
foldexpr = {
type = str;
default = "0";
2024-05-13 14:30:59 +03:00
description = ''
The expression used for when 'foldmethod' is "expr". It is evaluated
for each line to obtain its fold level.
2024-05-13 14:30:59 +03:00
'';
extraHelp = [ "fold-expr" ];
2024-05-13 14:30:59 +03:00
};
foldignore = {
type = str;
default = "#";
2024-05-13 14:30:59 +03:00
description = ''
Used only when 'foldmethod' is "indent". Lines starting with
characters in 'foldignore' will get their fold level from surrounding
lines. White space is skipped before checking for this character.
2024-05-13 14:30:59 +03:00
'';
extraHelp = [ "fold-indent" ];
2024-05-13 14:30:59 +03:00
};
foldlevel = {
type = number;
default = 0;
2024-05-13 14:30:59 +03:00
description = ''
Sets the fold level: Folds with a higher level will be closed.
Setting this option to zero will close all folds. Higher numbers will
close fewer folds.
This option is set by commands like |zm|, |zM| and |zR|.
2024-05-13 14:30:59 +03:00
'';
extraHelp = [ "fold-foldlevel" ];
2024-05-13 14:30:59 +03:00
};
foldmarker = {
type = (listOf str);
2024-05-13 14:30:59 +03:00
apply = x: assert (x == null || builtins.length x == 2 || abort "`foldmarker` must contain start and end markers in the list"); x;
default = ''["{{{" "}}}"]'';
2024-05-13 14:30:59 +03:00
description = ''
The start and end marker used when 'foldmethod' is "marker".
2024-05-13 14:30:59 +03:00
'';
};
foldmethod = {
type = (enum [ "manual" "indent" "expr" "marker" "syntax" "diff" ]);
default = "manual";
2024-05-13 14:30:59 +03:00
description = ''
The kind of folding used for the current window.
'';
extraHelp = [
"fold-manual"
"fold-indent"
"fold-expr"
"fold-marker"
"fold-syntax"
"fold-diff"
];
2024-05-13 14:30:59 +03:00
};
foldminlines = {
type = number;
default = 1;
2024-05-13 14:30:59 +03:00
description = ''
Sets the number of screen lines above which a fold can be displayed
closed. Also for manually closed folds.
2024-05-13 14:30:59 +03:00
'';
};
foldnestmax = {
type = number;
default = 20;
2024-05-13 14:30:59 +03:00
description = ''
Sets the maximum nesting of folds for the "indent" and "syntax"
methods. This avoids that too many folds will be created. Using more
than 20 doesn't work, because the internal limit is 20.
2024-05-13 14:30:59 +03:00
'';
};
foldtext = {
type = str;
default = "foldtext()";
2024-05-13 14:30:59 +03:00
description = ''
An expression which is used to specify the text displayed for a closed fold.
2024-05-13 14:30:59 +03:00
'';
extraHelp = [ "fold-foldtext" ];
2024-05-13 14:30:59 +03:00
};
linebreak = {
type = bool;
default = false;
2024-05-13 14:30:59 +03:00
description = ''
If on, Vim will wrap long lines at a character in 'breakat' rather
than at the last character that fits on the screen. Unlike
'wrapmargin' and 'textwidth', this does not insert <EOL>s in the file,
it only affects the way the file is displayed, not its contents.
2024-05-13 14:30:59 +03:00
'';
};
list = {
type = bool;
default = false;
2024-05-13 14:30:59 +03:00
description = ''
List mode: By default, show tabs as ">", trailing spaces as "-", and
non-breakable space characters as "+". Useful to see the difference
between tabs and spaces and for trailing blanks. Further changed by
the 'listchars' option.
2024-05-13 14:30:59 +03:00
'';
extraHelp = [ "listchars" ];
2024-05-13 14:30:59 +03:00
};
listchars = {
2024-05-13 14:30:59 +03:00
type = submodule {
options =
let
inherit (builtins) strLength;
mkListcharsOption = k: { description, min ? 1, max ? 1 }: mkVimOptOption k {
type = lib.types.str;
2024-05-13 14:30:59 +03:00
apply = x:
assert (
(strLength x >= min && strLength x <= max)
2024-05-15 00:14:28 +03:00
|| abort ''
2024-05-13 14:30:59 +03:00
The number of characters ${x} does not correspond to the boundaries
(min: ${tostr min}; max: ${tostr max})
2024-05-13 14:30:59 +03:00
''
);
x;
inherit description;
};
in
(mapAttrs mkListcharsOption {
eol = {
2024-05-13 14:30:59 +03:00
description = ''
Character to show at the end of each line. When
omitted, there is no extra character at the end of the
line.
'';
};
tab = {
2024-05-13 14:30:59 +03:00
description = ''
Two or three characters to be used to show a tab.
The third character is optional.
'';
max = 3;
};
space = {
2024-05-13 14:30:59 +03:00
description = ''
Character to show for a space. When omitted, spaces are left blank.
'';
};
multispace = {
2024-05-13 14:30:59 +03:00
description = ''
One or more characters to use cyclically to show for
multiple consecutive spaces. Overrides the "space"
setting, except for single spaces.
'';
max = 99;
};
lead = {
2024-05-13 14:30:59 +03:00
description = ''
Character to show for leading spaces. When omitted,
leading spaces are blank. Overrides the "space" and
"multispace" settings for leading spaces.
2024-05-13 14:30:59 +03:00
'';
};
leadmultispace = {
2024-05-13 14:30:59 +03:00
description = ''
Like the |lcs-multispace| value, but for leading
spaces only. Also overrides |lcs-lead| for leading
multiple spaces.
'';
max = 99;
};
trail = {
2024-05-13 14:30:59 +03:00
description = ''
Character to show for trailing spaces. When omitted,
trailing spaces are blank. Overrides the "space" and
"multispace" settings for trailing spaces.
'';
};
extends = {
2024-05-13 14:30:59 +03:00
description = ''
Character to show in the last column, when 'wrap' is
off and the line continues beyond the right of the
screen.
'';
};
precedes = {
2024-05-13 14:30:59 +03:00
description = ''
Character to show in the first visible column of the
physical line, when there is text preceding the
character visible in the first column.
'';
};
conceal = {
2024-05-13 14:30:59 +03:00
description = ''
Character to show in place of concealed text, when
'conceallevel' is set to 1. A space when omitted.
'';
};
nbsp = {
2024-05-13 14:30:59 +03:00
description = ''
Character to show for a non-breakable space character
(0xA0 (160 decimal) and U+202F).
'';
};
});
2024-05-13 14:30:59 +03:00
};
};
};
2024-05-15 00:14:28 +03:00
buffer = with lib; with types; sharedGlobalOrBuffer // {
autoindent = {
type = bool;
default = true;
2024-05-15 00:14:28 +03:00
description = ''
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
type anything on the new line except <BS> or CTRL-D and then type
<Esc>, CTRL-O or <CR>, the indent is deleted again.
2024-05-15 00:14:28 +03:00
'';
};
binary = {
type = bool;
default = false;
2024-05-15 00:14:28 +03:00
description = ''
This option should be set before editing a binary file. You can also
use the |-b| Vim argument.
'';
};
bomb = {
type = bool;
default = false;
2024-05-15 00:14:28 +03:00
description = ''
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.
2024-05-15 00:14:28 +03:00
'';
};
bufhidden = {
type = (enum [ "" "hide" "unload" "delete" "wipe" ]);
default = "";
2024-05-15 00:14:28 +03:00
description = ''
This option specifies what happens when a buffer is no longer
displayed in a window
2024-05-15 00:14:28 +03:00
'';
};
buflisted = {
type = bool;
default = true;
2024-05-15 00:14:28 +03:00
description = ''
When this option is set, the buffer shows up in the buffer list.
2024-05-15 00:14:28 +03:00
'';
};
buftype = {
type = (enum [ "" "acwrite" "help" "nofile" "nowrite" "quickfix" "terminal" "prompt" ]);
default = "";
2024-05-15 00:14:28 +03:00
description = ''
This option is used together with 'bufhidden' and 'swapfile' to
specify special kinds of buffers.
2024-05-15 00:14:28 +03:00
'';
extraHelp = [ "special-buffers" ];
2024-05-15 00:14:28 +03:00
};
cindent = {
type = bool;
default = false;
2024-05-15 00:14:28 +03:00
description = ''
Enables automatic C program indenting.
2024-05-15 00:14:28 +03:00
'';
};
cinkeys = {
type = str;
default = "0{,0},0),0],:,0#,!^F,o,O,e";
2024-05-15 00:14:28 +03:00
description = ''
A list of keys that, when typed in Insert mode, cause reindenting of
the current line.
2024-05-15 00:14:28 +03:00
'';
};
cinoptions = {
type = str;
default = "";
2024-05-15 00:14:28 +03:00
description = ''
The 'cinoptions' affect the way 'cindent' reindents lines in a C
program.
'';
extraHelp = [ "cinoptions-values" ];
2024-05-15 00:14:28 +03:00
};
cinwords = {
type = commas;
default = ''["if" "else" "while" "do" "for" "switch"]'';
2024-05-15 00:14:28 +03:00
descrpition = ''
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 {}).
2024-05-15 00:14:28 +03:00
'';
};
cinscopedecls = {
type = commas;
default = ''["public" "protected" "private"]'';
2024-05-15 00:14:28 +03:00
descrpition = ''
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"
2024-05-15 00:14:28 +03:00
'';
};
comments = {
type = commas;
default = ''
2024-05-15 00:14:28 +03:00
[
"s1/*"
"mb:8"
"ex:*/"
"://"
"b:#"
":%"
":XCOMM"
"n:>"
"fb:-"
]
'';
description = ''
list of strs that can start a comment line.
'';
extraHelp = [ "format-comments" ];
};
commentstring = {
type = str;
default = "";
description = ''
A template for a comment. The "%s" in the value is replaced with the
comment text. Currently only used to add markers for folding, see
|fold-marker|.
'';
extraHelp = [ "fold-marker" ];
};
complete = {
type = commas;
default = ''["." "w" "b" "u" "t"]'';
description = ''
This option specifies how keyword completion |ins-completion| works
when CTRL-P or CTRL-N are used.
'';
extraHelp = [ "ins-completion" ];
};
2024-05-15 00:14:28 +03:00
completefunc = {
type = str;
default = "";
description = ''
This option specifies a function to be used for Insert mode completion
with CTRL-X CTRL-U.
2024-05-15 00:14:28 +03:00
'';
extraHelp = [
"complete-functions"
"i_CTRL-X_CTRL-U"
];
2024-05-15 00:14:28 +03:00
};
2024-05-13 14:30:59 +03:00
copyindent = {
type = bool;
default = false;
description = ''
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.
'';
extraHelp = [
"expandtab"
"preverseindent"
];
};
expandtab = {
type = bool;
default = false;
2024-05-13 14:30:59 +03:00
description = ''
In Insert mode: Use the appropriate number of spaces to insert a
<Tab>. Spaces are used in indents with the '>' and '<' commands and
when 'autoindent' is on. To insert a real tab when 'expandtab' is
on, use CTRL-V<Tab>. See also |:retab| and |ins-expandtab|.
'';
};
fileencoding = {
type = str;
default = "";
2024-05-13 14:30:59 +03:00
description = ''
File-content encoding for the current buffer. Conversion is done with
iconv() or as specified with 'charconvert'.
When 'fileencoding' is not UTF-8, conversion will be done when
writing the file. For reading see below.
When 'fileencoding' is empty, the file will be saved with UTF-8
encoding (no conversion when reading or writing a file).
2024-05-13 14:30:59 +03:00
'';
};
fileformat = {
type = (enum [ "dos" "unix" "mac" ]);
default = ''
2024-05-13 14:30:59 +03:00
Windows default: "dos",
Unix default: "unix"
'';
description = ''
This gives the <EOL> of the current buffer, which is used for
reading/writing the buffer from/to a file:
- dos <CR><NL>
- unix <NL>
- mac <CR>
When "dos" is used, CTRL-Z at the end of a file is ignored.
'';
};
filetype = {
type = str;
2024-05-13 14:30:59 +03:00
description = ''
When this option is set, the FileType autocommand event is triggered.
Otherwise this option does not always reflect the current file type.
This option is normally set when the file type is detected. To enable
this use the ":filetype on" command. |:filetype|
When a dot appears in the value then this separates two filetype names.
2024-05-13 14:30:59 +03:00
'';
extraHelp = [ ":filetype" ];
2024-05-13 14:30:59 +03:00
};
fixendofline = {
type = bool;
default = true;
2024-05-13 14:30:59 +03:00
description = ''
When writing a file and this option is on, <EOL> at the end of file
will be restored if missing. Turn this option off if you want to
preserve the situation from the original file.
When the 'binary' option is set the value of this option doesn't
matter.
2024-05-13 14:30:59 +03:00
'';
extraHelp = [
"binary"
"endofline"
"eol-and-eof"
];
2024-05-13 14:30:59 +03:00
};
formatexpr = {
type = str;
default = "";
2024-05-13 14:30:59 +03:00
description = ''
Expression which is evaluated to format a range of lines for the |gq|
operator or automatic formatting (see 'formatoptions'). When this
option is empty 'formatprg' is used.
2024-05-13 14:30:59 +03:00
'';
};
formatlistpat = {
type = str;
default = ''^\s*\d\+[\]:.)}\t ]\s*'';
2024-05-13 14:30:59 +03:00
description = ''
A pattern that is used to recognize a list header. This is used for
the "n" flag in 'formatoptions'.
The default recognizes a number, followed by an optional punctuation
2024-05-13 14:30:59 +03:00
'';
extraHelp = [ "formatoptions" ];
2024-05-13 14:30:59 +03:00
};
formatoptions = {
type = str;
default = "tcqj";
2024-05-13 14:30:59 +03:00
description = ''
This is a sequence of letters which describes how automatic
formatting is to be done.
2024-05-13 14:30:59 +03:00
'';
extraHelp = [ "fo-table" ];
2024-05-13 14:30:59 +03:00
};
iminsert = {
type = number;
default = 0;
2024-05-13 14:30:59 +03:00
description = ''
Specifies whether :lmap or an Input Method (IM) is to be used in
Insert mode. Valid values:
- 0 :lmap is off and IM is off
- 1 :lmap is ON and IM is off
- 2 :lmap is off and IM is ON
2024-05-13 14:30:59 +03:00
'';
};
imsearch = {
type = number;
default = -1;
2024-05-13 14:30:59 +03:00
description = ''
Specifies whether :lmap or an Input Method (IM) is to be used when
entering a search pattern. Valid values:
- -1 the value of 'iminsert' is used, makes it look like
'iminsert' is also used when typing a search pattern
- 0 :lmap is off and IM is off
- 1 :lmap is ON and IM is off
- 2 :lmap is off and IM is ON
2024-05-13 14:30:59 +03:00
'';
};
includexpr = {
type = str;
default = "";
2024-05-13 14:30:59 +03:00
description = ''
Expression to be used to transform the str found with the 'include'
2024-05-13 14:30:59 +03:00
option to a file name.
2024-05-13 14:30:59 +03:00
'';
};
indentexpr = {
type = str;
default = "";
2024-05-13 14:30:59 +03:00
description = ''
Expression which is evaluated to obtain the proper indent for a line.
It is used when a new line is created, for the |=| operator and
in Insert mode as specified with the 'indentkeys' option.
2024-05-13 14:30:59 +03:00
'';
};
indentkeys = {
type = str;
default = "0{,0},0),0],:,0#,!^F,o,O,e";
2024-05-13 14:30:59 +03:00
description = ''
A list of keys that, when typed in Insert mode, cause reindenting of
the current line.
2024-05-13 14:30:59 +03:00
'';
};
infercase = {
type = bool;
default = false;
2024-05-13 14:30:59 +03:00
description = ''
When doing keyword completion in insert mode |ins-completion|, and
'ignorecase' is also on, the case of the match is adjusted depending
on the typed text. If the typed text contains a lowercase letter
where the match has an upper case letter, the completed part is made
lowercase.
2024-05-13 14:30:59 +03:00
'';
};
iskeyward = {
type = str;
default = "@,48-57,_,192-255";
2024-05-13 14:30:59 +03:00
description = ''
Keywords are used in searching and recognizing with many commands:
"w", "*", "[i", etc. It is also used for "\k" in a |pattern|.
2024-05-13 14:30:59 +03:00
'';
extraHelp = [ "pattern" ];
2024-05-13 14:30:59 +03:00
};
keymap = {
type = str;
default = "";
2024-05-13 14:30:59 +03:00
description = ''
Name of a keyboard mapping.
2024-05-13 14:30:59 +03:00
'';
extraHelp = [ "mbyte-keymap" ];
2024-05-13 14:30:59 +03:00
};
lisp = {
type = bool;
default = false;
2024-05-13 14:30:59 +03:00
description = ''
Lisp mode: When <Enter> is typed in insert mode set the indent for
the next line to Lisp standards (well, sort of). Also happens with
"cc" or "S".
2024-05-13 14:30:59 +03:00
'';
};
lispoptions = {
type = (listOf str);
default = [ ];
2024-05-13 14:30:59 +03:00
description = ''
list of items that influence the Lisp indenting when
enabled with the |'lisp'| option. Currently only one item is
supported:
- expr:1 use 'indentexpr' for Lisp indenting when it is set
- expr:0 do not use 'indentexpr' for Lisp indenting (default)
'';
};
};
in
mapAttrs (_: mapAttrs mkVimOptOption) {
2024-05-13 14:30:59 +03:00
inherit global window buffer;
}