plugins/utils: normalize plugin defaults

This commit is contained in:
Matt Sturgeon 2024-06-11 16:54:57 +01:00
parent b10a391bd0
commit 6ab2a39e6a
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299
53 changed files with 1434 additions and 1221 deletions

View file

@ -74,7 +74,7 @@ with lib;
attrs
]
)
"[]"
[ ]
''
A list of files or directories to bookmark.
The list can contain two kinds of types.
@ -91,7 +91,7 @@ with lib;
(listOf str)
]
)
"[]"
[ ]
''
A list of commands to execute on selection.
Leading colons are optional.
@ -132,7 +132,7 @@ with lib;
NOTE: This option is affected by `session_delete_buffers`.
'';
session_before_save = helpers.defaultNullOpts.mkListOf types.str "[]" ''
session_before_save = helpers.defaultNullOpts.mkListOf types.str [ ] ''
This is a list of commands to be executed before saving a session.
Example: `["silent! tabdo NERDTreeClose"]`
@ -181,7 +181,7 @@ with lib;
Affects `change_to_dir` and `change_to_vcs_root`.
'';
skiplist = helpers.defaultNullOpts.mkListOf types.str "[]" ''
skiplist = helpers.defaultNullOpts.mkListOf types.str [ ] ''
A list of Vim regular expressions that is used to filter recently used files.
See `|pattern.txt|` for what patterns can be used.
@ -227,7 +227,7 @@ with lib;
The number of spaces used for left padding.
'';
skiplist_server = helpers.defaultNullOpts.mkListOf (with helpers.nixvimTypes; maybeRaw str) "[]" ''
skiplist_server = helpers.defaultNullOpts.mkListOf (with helpers.nixvimTypes; maybeRaw str) [ ] ''
Do not create the startify buffer, if this is a Vim server instance with a name contained in
this list.
@ -255,7 +255,7 @@ with lib;
- don't filter through the bookmark list
'';
session_remove_lines = helpers.defaultNullOpts.mkListOf types.str "[]" ''
session_remove_lines = helpers.defaultNullOpts.mkListOf types.str [ ] ''
Lines matching any of the patterns in this list, will be removed from the session file.
Example:
@ -272,7 +272,7 @@ with lib;
probably get problems when trying to load it.
'';
session_savevars = helpers.defaultNullOpts.mkListOf types.str "[]" ''
session_savevars = helpers.defaultNullOpts.mkListOf types.str [ ] ''
Include a list of variables in here which you would like Startify to save into the session file
in addition to what Vim normally saves into the session file.
@ -286,7 +286,7 @@ with lib;
```
'';
session_savecmds = helpers.defaultNullOpts.mkListOf types.str "[]" ''
session_savecmds = helpers.defaultNullOpts.mkListOf types.str [ ] ''
Include a list of cmdline commands which Vim will run upon loading the session.
Example:
@ -307,59 +307,69 @@ with lib;
alphabetically.
'';
custom_indices =
helpers.defaultNullOpts.mkNullable (with helpers.nixvimTypes; maybeRaw (listOf str)) "[]"
''
Use any list of strings as indices instead of increasing numbers. If there are more startify
entries than actual items in the custom list, the remaining entries will be filled using the
default numbering scheme starting from 0.
custom_indices = helpers.defaultNullOpts.mkListOf' {
type = types.str;
pluginDefault = [ ];
description = ''
Use any list of strings as indices instead of increasing numbers. If there are more startify
entries than actual items in the custom list, the remaining entries will be filled using the
default numbering scheme starting from 0.
Thus you can create your own indexing scheme that fits your keyboard layout.
You don't want to leave the home row, do you?!
Thus you can create your own indexing scheme that fits your keyboard layout.
You don't want to leave the home row, do you?!
'';
example = [
"f"
"g"
"h"
];
};
Example:
```nix
["f" "g" "h"]
```
'';
custom_header = helpers.defaultNullOpts.mkListOf' {
type = types.str;
description = ''
Define your own header.
custom_header =
helpers.mkNullOrOption (with helpers.nixvimTypes; maybeRaw (listOf (maybeRaw str)))
''
Define your own header.
This option takes a `list of strings`, whereas each string will be put on its own line.
If it is a simple `string`, it should evaluate to a list of strings.
'';
example = [
""
" "
" "
" "
" "
" "
" "
];
};
This option takes a `list of strings`, whereas each string will be put on its own line.
If it is a simple `string`, it should evaluate to a list of strings.
custom_header_quotes = helpers.defaultNullOpts.mkListOf' {
type = with types; listOf str;
pluginDefault = [ ];
description = ''
If you don't set `custom_header`, the internal cowsay implementation with
predefined random quotes will be used.
Example:
```nix
[
""
" "
" "
" "
" "
" "
" "
]
```
'';
custom_header_quotes = helpers.defaultNullOpts.mkListOf (with types; listOf str) "[]" ''
Example:
```nix
To use your own quotes, set this option to a list of quotes. Each quote is
either another list or a `|Funcref|` (see `|expr-lambda|`) that returns a list.
'';
example = [
[ "quote #1" ]
[
["quote #1"]
["quote #2" "using" "three lines"]
"quote #2"
"using"
"three lines"
]
```
'';
];
};
custom_footer =
helpers.mkNullOrOption (with helpers.nixvimTypes; maybeRaw (listOf (maybeRaw str)))
''
Same as the custom header, but shown at the bottom of the startify buffer.
'';
custom_footer = helpers.defaultNullOpts.mkListOf' {
type = types.str;
description = ''
Same as the custom header, but shown at the bottom of the startify buffer.
'';
};
disable_at_vimenter = helpers.defaultNullOpts.mkBool false ''
Don't run Startify at Vim startup.