add more options
This commit is contained in:
parent
3d64ef464a
commit
90341cf26d
|
@ -1,8 +1,7 @@
|
||||||
{ lib }:
|
{ lib }:
|
||||||
|
|
||||||
let
|
let
|
||||||
shared = with lib; with types; {
|
sharedGlobalOrWindow = with lib; with types; {
|
||||||
# global or window
|
|
||||||
fillchars = mkOption {
|
fillchars = mkOption {
|
||||||
type = nullOr (listOf (enum [
|
type = nullOr (listOf (enum [
|
||||||
"stl"
|
"stl"
|
||||||
|
@ -32,8 +31,34 @@ let
|
||||||
`:help fillchars`
|
`:help fillchars`
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
sharedGlobalOrBuffer = with lib; with types; {
|
||||||
|
autoread = mkOption {
|
||||||
|
type = nullOr bool;
|
||||||
|
default = null;
|
||||||
|
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|
|
||||||
|
|
||||||
|
`:help autoread`
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
backupcopy = mkOption {
|
||||||
|
type = nullOr (listOf (enum [ "yes" "no" "auto" "breaksymlink" "breakhardlink" ]));
|
||||||
|
default = null;
|
||||||
|
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.
|
||||||
|
|
||||||
|
`:help backupcopy`
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
# global or buffer
|
|
||||||
formatprg = mkOption {
|
formatprg = mkOption {
|
||||||
type = nullOr string;
|
type = nullOr string;
|
||||||
default = null;
|
default = null;
|
||||||
|
@ -47,7 +72,6 @@ let
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
# global or buffer
|
|
||||||
grepprg = mkOption {
|
grepprg = mkOption {
|
||||||
type = nullOr string;
|
type = nullOr string;
|
||||||
default = null;
|
default = null;
|
||||||
|
@ -59,7 +83,6 @@ let
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
# global or buffer
|
|
||||||
include = mkOption {
|
include = mkOption {
|
||||||
type = nullOr string;
|
type = nullOr string;
|
||||||
default = null;
|
default = null;
|
||||||
|
@ -71,7 +94,6 @@ let
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
# global or buffer
|
|
||||||
keywordprg = mkOption {
|
keywordprg = mkOption {
|
||||||
type = nullOr string;
|
type = nullOr string;
|
||||||
default = null;
|
default = null;
|
||||||
|
@ -86,7 +108,6 @@ let
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
# global or buffer
|
|
||||||
lispwords = mkOption {
|
lispwords = mkOption {
|
||||||
type = nullOr (listOf string);
|
type = nullOr (listOf string);
|
||||||
default = null;
|
default = null;
|
||||||
|
@ -98,11 +119,24 @@ let
|
||||||
`:help lispwords`
|
`:help lispwords`
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
makeencoding = mkOption {
|
||||||
|
type = nullOr string;
|
||||||
|
default = null;
|
||||||
|
defaultText = "";
|
||||||
|
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`.
|
||||||
|
|
||||||
|
`:help makeencoding`
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
global = with lib; with types; {
|
global = with lib; with types; sharedGlobalOrWindow // sharedGlobalOrBuffer // {
|
||||||
inherit (shared) fillchars formatprg grepprg include keywordprg lispwords;
|
|
||||||
|
|
||||||
allowrevins = mkOption {
|
allowrevins = mkOption {
|
||||||
type = nullOr bool;
|
type = nullOr bool;
|
||||||
default = null;
|
default = null;
|
||||||
|
@ -114,6 +148,7 @@ let
|
||||||
`:help allowrevins`
|
`:help allowrevins`
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
ambiwidth = mkOption {
|
ambiwidth = mkOption {
|
||||||
type = nullOr (enum [ "single" "double" ]);
|
type = nullOr (enum [ "single" "double" ]);
|
||||||
default = null;
|
default = null;
|
||||||
|
@ -125,6 +160,7 @@ let
|
||||||
`:help ambiwidth`
|
`:help ambiwidth`
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
autochdir = mkOption {
|
autochdir = mkOption {
|
||||||
type = nullOr bool;
|
type = nullOr bool;
|
||||||
default = null;
|
default = null;
|
||||||
|
@ -139,19 +175,17 @@ let
|
||||||
`:help autochdir`
|
`:help autochdir`
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
# TODO: arabic, arabicshape
|
|
||||||
# TODO: autoindent
|
arabicshape = mkOption {
|
||||||
autoread = mkOption {
|
|
||||||
type = nullOr bool;
|
type = nullOr bool;
|
||||||
default = null;
|
default = null;
|
||||||
|
defaultText = literalExpression "false";
|
||||||
description = ''
|
description = ''
|
||||||
When a file has been detected to have been changed outside of Vim and
|
When on and 'termbidi' is off, the required visual character
|
||||||
it has not been changed inside of Vim, automatically read it again.
|
corrections that need to take place for displaying the Arabic language
|
||||||
When the file has been deleted this is not done, so you have the text
|
take effect.
|
||||||
from before it was deleted. When it appears again then it is read.
|
|
||||||
|timestamp|
|
|
||||||
|
|
||||||
`:help autoread`
|
`:help arabicshape`
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -233,17 +267,6 @@ let
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
backupcopy = mkOption {
|
|
||||||
type = nullOr (listOf (enum [ "yes" "no" "auto" "breaksymlink" "breakhardlink" ]));
|
|
||||||
default = null;
|
|
||||||
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.
|
|
||||||
|
|
||||||
`:help backupcopy`
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
backupdir = mkOption {
|
backupdir = mkOption {
|
||||||
type = nullOr (listOf (either string path));
|
type = nullOr (listOf (either string path));
|
||||||
default = null;
|
default = null;
|
||||||
|
@ -341,9 +364,6 @@ let
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
# TODO: binary
|
|
||||||
# TODO: bomb
|
|
||||||
|
|
||||||
breakat = mkOption {
|
breakat = mkOption {
|
||||||
type = nullOr string;
|
type = nullOr string;
|
||||||
default = null;
|
default = null;
|
||||||
|
@ -354,7 +374,6 @@ let
|
||||||
`:help breakat`
|
`:help breakat`
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
# TODO: breakindent, breakindentopt
|
|
||||||
|
|
||||||
browsedir = mkOption {
|
browsedir = mkOption {
|
||||||
type = nullOr (either path (enum [ "last" "buffer" "current" ]));
|
type = nullOr (either path (enum [ "last" "buffer" "current" ]));
|
||||||
|
@ -370,8 +389,6 @@ let
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
# TODO: bufhidden, buflisted, buftype
|
|
||||||
|
|
||||||
casemap = mkOption {
|
casemap = mkOption {
|
||||||
type = nullOr (listOf (enum [ "internal" "keepascii" ]));
|
type = nullOr (listOf (enum [ "internal" "keepascii" ]));
|
||||||
default = null;
|
default = null;
|
||||||
|
@ -399,6 +416,19 @@ let
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
charconvert = mkOption {
|
||||||
|
type = nullOr string;
|
||||||
|
default = null;
|
||||||
|
defaultText = "";
|
||||||
|
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.
|
||||||
|
|
||||||
|
`:help charconvert`
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
clipboard = mkOption {
|
clipboard = mkOption {
|
||||||
type = nullOr (listOf (enum [ "unnamed" "unnamedplus" ]));
|
type = nullOr (listOf (enum [ "unnamed" "unnamedplus" ]));
|
||||||
default = null;
|
default = null;
|
||||||
|
@ -1289,8 +1319,54 @@ let
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
window = with lib; with types; {
|
window = with lib; with types; sharedGlobalOrWindow // {
|
||||||
inherit (shared) fillchars;
|
arabic = mkOption {
|
||||||
|
type = nullOr bool;
|
||||||
|
default = null;
|
||||||
|
defaultText = literalExpression "false";
|
||||||
|
description = ''
|
||||||
|
This option can be set to start editing Arabic text.
|
||||||
|
|
||||||
|
`:help arabic`
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
breakindent = mkOption {
|
||||||
|
type = nullOr bool;
|
||||||
|
default = null;
|
||||||
|
defaultText = literalExpression "false";
|
||||||
|
description = ''
|
||||||
|
Every wrapped line will continue visually indented (same amount of
|
||||||
|
space as the beginning of that line), thus preserving horizontal blocks
|
||||||
|
of text.
|
||||||
|
|
||||||
|
`:help breakindent`
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
breakindentopt = mkOption {
|
||||||
|
type = nullOr commas;
|
||||||
|
default = null;
|
||||||
|
defaultText = literalExpression "[]";
|
||||||
|
description = ''
|
||||||
|
Settings for 'breakindent
|
||||||
|
|
||||||
|
`:help breakindentopt`
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
colorcolumn = mkOption {
|
||||||
|
type = nullOr commas;
|
||||||
|
default = null;
|
||||||
|
defaultText = literalExpression "[]";
|
||||||
|
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.
|
||||||
|
|
||||||
|
`:help colorcolumn`
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
foldcolumn = mkOption {
|
foldcolumn = mkOption {
|
||||||
type = nullOr string;
|
type = nullOr string;
|
||||||
|
@ -1594,8 +1670,170 @@ let
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
buffer = with lib; with types; {
|
buffer = with lib; with types; sharedGlobalOrBuffer // {
|
||||||
inherit (shared) formatprg grepprg include keywordprg lispwords;
|
autoindent = mkOption {
|
||||||
|
type = nullOr bool;
|
||||||
|
default = null;
|
||||||
|
defaultText = literalExpression "true";
|
||||||
|
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.
|
||||||
|
|
||||||
|
`:help autoindent`
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
binary = mkOption {
|
||||||
|
type = nullOr bool;
|
||||||
|
default = null;
|
||||||
|
defaultText = literalExpression "false";
|
||||||
|
description = ''
|
||||||
|
This option should be set before editing a binary file. You can also
|
||||||
|
use the |-b| Vim argument.
|
||||||
|
|
||||||
|
`:help binary`
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
bomb = mkOption {
|
||||||
|
type = nullOr bool;
|
||||||
|
default = null;
|
||||||
|
defaultText = literalExpression "false";
|
||||||
|
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.
|
||||||
|
|
||||||
|
`:help bomb`
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
bufhidden = mkOption {
|
||||||
|
type = nullOr (enum [ "" "hide" "unload" "delete" "wipe" ]);
|
||||||
|
default = null;
|
||||||
|
defaultText = "";
|
||||||
|
description = ''
|
||||||
|
This option specifies what happens when a buffer is no longer
|
||||||
|
displayed in a window
|
||||||
|
|
||||||
|
`:help bufhidden`
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
buflisted = mkOption {
|
||||||
|
type = nullOr bool;
|
||||||
|
default = null;
|
||||||
|
defaultText = literalExpression "true";
|
||||||
|
description = ''
|
||||||
|
When this option is set, the buffer shows up in the buffer list.
|
||||||
|
|
||||||
|
`:help buflisted`
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
buftype = mkOption {
|
||||||
|
type = nullOr (enum [ "" "acwrite" "help" "nofile" "nowrite" "quickfix" "terminal" "prompt" ]);
|
||||||
|
default = null;
|
||||||
|
defaultText = "";
|
||||||
|
description = ''
|
||||||
|
This option is used together with 'bufhidden' and 'swapfile' to
|
||||||
|
specify special kinds of buffers.
|
||||||
|
|
||||||
|
`:help buftype`
|
||||||
|
`:help special-buffers`
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
cindent = mkOption {
|
||||||
|
type = nullOr bool;
|
||||||
|
default = null;
|
||||||
|
defaultText = literalExpression "false";
|
||||||
|
description = ''
|
||||||
|
Enables automatic C program indenting.
|
||||||
|
|
||||||
|
`:help cindent`
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
cinkeys = mkOption {
|
||||||
|
type = nullOr string;
|
||||||
|
default = null;
|
||||||
|
defaultText = "0{,0},0),0],:,0#,!^F,o,O,e";
|
||||||
|
description = ''
|
||||||
|
A list of keys that, when typed in Insert mode, cause reindenting of
|
||||||
|
the current line.
|
||||||
|
|
||||||
|
`:help cinkeys`
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
cinoptions = mkOption {
|
||||||
|
type = nullOr string;
|
||||||
|
default = null;
|
||||||
|
defaultText = "";
|
||||||
|
description = ''
|
||||||
|
The 'cinoptions' affect the way 'cindent' reindents lines in a C
|
||||||
|
program.
|
||||||
|
|
||||||
|
`:help cinoptions`
|
||||||
|
`:help cinoptions-values`
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
cinwords = mkOption {
|
||||||
|
type = nullOr commas;
|
||||||
|
default = null;
|
||||||
|
defaultText = literalExpression ''["if" "else" "while" "do" "for" "switch"]'';
|
||||||
|
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 {}).
|
||||||
|
|
||||||
|
`:help cinwords`
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
cinscopedecls = mkOption {
|
||||||
|
type = nullOr commas;
|
||||||
|
default = null;
|
||||||
|
defaultText = literalExpression ''["public" "protected" "private"]'';
|
||||||
|
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"
|
||||||
|
|
||||||
|
`:help cinscopedecls`
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
comments = mkOption {
|
||||||
|
type = nullOr commas;
|
||||||
|
default = null;
|
||||||
|
defaultText = literalExpression ''
|
||||||
|
[
|
||||||
|
"s1/*"
|
||||||
|
"mb:8"
|
||||||
|
"ex:*/"
|
||||||
|
"://"
|
||||||
|
"b:#"
|
||||||
|
":%"
|
||||||
|
":XCOMM"
|
||||||
|
"n:>"
|
||||||
|
"fb:-"
|
||||||
|
]
|
||||||
|
'';
|
||||||
|
description = ''
|
||||||
|
list of strings that can start a comment line.
|
||||||
|
|
||||||
|
`:help comments`
|
||||||
|
`:help format-comments`
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
expandtab = mkOption {
|
expandtab = mkOption {
|
||||||
type = nullOr bool;
|
type = nullOr bool;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user