mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-12-19 02:11:20 +00:00
rc: bindings to vim.opt
This commit is contained in:
parent
ae3fd99447
commit
22d08b431a
2 changed files with 55 additions and 2 deletions
|
|
@ -5,7 +5,7 @@
|
|||
}: let
|
||||
inherit (lib.options) mkOption literalMD literalExpression;
|
||||
inherit (lib.strings) optionalString;
|
||||
inherit (lib.types) str bool int enum attrsOf lines listOf either path submodule anything;
|
||||
inherit (lib.types) str bool int enum attrsOf lines listOf either path submodule anything nullOr;
|
||||
inherit (lib.nvim.types) dagOf;
|
||||
inherit (lib.nvim.lua) listToLuaTable;
|
||||
|
||||
|
|
@ -278,6 +278,46 @@ in {
|
|||
'';
|
||||
};
|
||||
|
||||
opt = mkOption {
|
||||
default = {};
|
||||
type = attrsOf (submodule {
|
||||
options = {
|
||||
append = mkOption {
|
||||
type = nullOr (listOf anything);
|
||||
default = null;
|
||||
description = "Values to append";
|
||||
};
|
||||
|
||||
prepend = mkOption {
|
||||
type = nullOr (listOf anything);
|
||||
default = null;
|
||||
description = "Values to prepend";
|
||||
};
|
||||
|
||||
remove = mkOption {
|
||||
type = nullOr (listOf anything);
|
||||
default = null;
|
||||
description = "Values to remove";
|
||||
};
|
||||
};
|
||||
});
|
||||
|
||||
example = literalExpression ''
|
||||
{
|
||||
runtimepath.append = ["~/.config/nvim"];
|
||||
formatoptions.append = ["n"];
|
||||
formatoptions.remove = ["o"];
|
||||
}
|
||||
'';
|
||||
description = ''
|
||||
Wrapper of the lua `vim.opt` interface. Makes interacting with list and
|
||||
map-style option more convenient.
|
||||
|
||||
If you're looking to set an option normally, instead of add/remove from
|
||||
a list/map type option, see {option}`vim.options` instead.
|
||||
'';
|
||||
};
|
||||
|
||||
pluginRC = mkOption {
|
||||
type = either (dagOf lines) str;
|
||||
default = {};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue