mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 00:25:42 +02:00
misc: ensure all options have a description
This commit is contained in:
parent
3be9db71c2
commit
7a2d065cce
13 changed files with 127 additions and 43 deletions
|
@ -17,7 +17,20 @@ let
|
||||||
(listOf (
|
(listOf (
|
||||||
either str (submodule {
|
either str (submodule {
|
||||||
options = {
|
options = {
|
||||||
priority = mkOption { type = int; };
|
priority = mkOption {
|
||||||
|
type = ints.unsigned;
|
||||||
|
description = ''
|
||||||
|
Filename patterns can specify an optional priority to resolve cases when a file path
|
||||||
|
matches multiple patterns.
|
||||||
|
|
||||||
|
Higher priorities are matched first.
|
||||||
|
When omitted, the priority defaults to 0.
|
||||||
|
|
||||||
|
A pattern can contain environment variables of the form `"''${SOME_VAR}"` that will
|
||||||
|
be automatically expanded.
|
||||||
|
If the environment variable is not set, the pattern won't be matched.
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
))
|
))
|
||||||
|
|
|
@ -11,6 +11,7 @@ with lib;
|
||||||
keymaps = mkOption {
|
keymaps = mkOption {
|
||||||
type = types.listOf helpers.keymaps.mapOptionSubmodule;
|
type = types.listOf helpers.keymaps.mapOptionSubmodule;
|
||||||
default = [ ];
|
default = [ ];
|
||||||
|
description = "Nixvim keymaps.";
|
||||||
example = [
|
example = [
|
||||||
{
|
{
|
||||||
key = "<C-m>";
|
key = "<C-m>";
|
||||||
|
|
|
@ -39,6 +39,10 @@ with lib;
|
||||||
mapping = mkOption {
|
mapping = mkOption {
|
||||||
default = { };
|
default = { };
|
||||||
type = with helpers.nixvimTypes; maybeRaw (attrsOf strLua);
|
type = with helpers.nixvimTypes; maybeRaw (attrsOf strLua);
|
||||||
|
description = ''
|
||||||
|
cmp mappings declaration.
|
||||||
|
See `:h cmp-mapping` for more information.
|
||||||
|
'';
|
||||||
apply =
|
apply =
|
||||||
v:
|
v:
|
||||||
# Handle the raw case first
|
# Handle the raw case first
|
||||||
|
|
|
@ -69,9 +69,19 @@ with lib;
|
||||||
worktreeType = types.submodule {
|
worktreeType = types.submodule {
|
||||||
freeformType = with types; attrsOf anything;
|
freeformType = with types; attrsOf anything;
|
||||||
options = {
|
options = {
|
||||||
toplevel = mkOption { type = with helpers.nixvimTypes; maybeRaw str; };
|
toplevel = mkOption {
|
||||||
|
type = with helpers.nixvimTypes; maybeRaw str;
|
||||||
|
description = ''
|
||||||
|
Path to the top-level of the parent git repository.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
gitdir = mkOption { type = with helpers.nixvimTypes; maybeRaw str; };
|
gitdir = mkOption {
|
||||||
|
type = with helpers.nixvimTypes; maybeRaw str;
|
||||||
|
description = ''
|
||||||
|
Path to the git directory of the parent git repository (typically the `.git/` directory).
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
|
|
|
@ -80,6 +80,7 @@ in
|
||||||
mkOption {
|
mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
inherit default;
|
inherit default;
|
||||||
|
description = "Key shortcut";
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
|
|
@ -55,6 +55,13 @@ in
|
||||||
cmd = mkOption {
|
cmd = mkOption {
|
||||||
type = with types; nullOr (listOf str);
|
type = with types; nullOr (listOf str);
|
||||||
default = if (cfg.package or null) != null then cmd cfg else null;
|
default = if (cfg.package or null) != null then cmd cfg else null;
|
||||||
|
description = ''
|
||||||
|
A list where each entry corresponds to the blankspace delimited part of the command that
|
||||||
|
launches the server.
|
||||||
|
|
||||||
|
The first entry is the binary used to run the language server.
|
||||||
|
Additional entries are passed as arguments.
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
filetypes = helpers.mkNullOrOption (types.listOf types.str) ''
|
filetypes = helpers.mkNullOrOption (types.listOf types.str) ''
|
||||||
|
|
|
@ -71,18 +71,23 @@ in
|
||||||
|
|
||||||
fromVscode = mkOption {
|
fromVscode = mkOption {
|
||||||
default = [ ];
|
default = [ ];
|
||||||
example = ''
|
example = literalExpression ''
|
||||||
[
|
[
|
||||||
{}
|
{ }
|
||||||
{
|
{ paths = ./path/to/snippets; }
|
||||||
paths = ./path/to/snippets;
|
]'';
|
||||||
}
|
description = ''
|
||||||
]
|
List of custom vscode style snippets to load.
|
||||||
# generates:
|
|
||||||
#
|
For example,
|
||||||
# require("luasnip.loaders.from_vscode").lazy_load({})
|
```nix
|
||||||
# require("luasnip.loaders.from_vscode").lazy_load({['paths'] = {'/nix/store/.../path/to/snippets'}})
|
[ {} { paths = ./path/to/snippets; } ]
|
||||||
#
|
```
|
||||||
|
will generate the following lua:
|
||||||
|
```lua
|
||||||
|
require("luasnip.loaders.from_vscode").lazy_load({})
|
||||||
|
require("luasnip.loaders.from_vscode").lazy_load({['paths'] = {'/nix/store/.../path/to/snippets'}})
|
||||||
|
```
|
||||||
'';
|
'';
|
||||||
type = types.listOf loaderSubmodule;
|
type = types.listOf loaderSubmodule;
|
||||||
};
|
};
|
||||||
|
|
|
@ -55,6 +55,7 @@ in
|
||||||
|
|
||||||
active = mkOption {
|
active = mkOption {
|
||||||
default = null;
|
default = null;
|
||||||
|
description = "List of components for the active window.";
|
||||||
type = types.nullOr (
|
type = types.nullOr (
|
||||||
types.submodule {
|
types.submodule {
|
||||||
options =
|
options =
|
||||||
|
@ -72,6 +73,7 @@ in
|
||||||
|
|
||||||
inactive = mkOption {
|
inactive = mkOption {
|
||||||
default = null;
|
default = null;
|
||||||
|
description = "List of components for inactive windows.";
|
||||||
type = types.nullOr (
|
type = types.nullOr (
|
||||||
types.submodule {
|
types.submodule {
|
||||||
options =
|
options =
|
||||||
|
|
|
@ -41,7 +41,10 @@ helpers.neovim-plugin.mkNeovimPlugin config {
|
||||||
attrsOf (
|
attrsOf (
|
||||||
either str (submodule {
|
either str (submodule {
|
||||||
options = {
|
options = {
|
||||||
action = mkOption { type = types.str; };
|
action = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
description = "The telescope action to run.";
|
||||||
|
};
|
||||||
mode = helpers.keymaps.mkModeOption "n";
|
mode = helpers.keymaps.mkModeOption "n";
|
||||||
options = helpers.keymaps.mapConfigOptions;
|
options = helpers.keymaps.mapConfigOptions;
|
||||||
};
|
};
|
||||||
|
|
|
@ -112,6 +112,10 @@ in
|
||||||
mkOption {
|
mkOption {
|
||||||
type = types.listOf hydraType;
|
type = types.listOf hydraType;
|
||||||
default = [ ];
|
default = [ ];
|
||||||
|
description = ''
|
||||||
|
A list of hydra configurations.
|
||||||
|
See [here](https://github.com/nvimtools/hydra.nvim?tab=readme-ov-file#creating-a-new-hydra).
|
||||||
|
'';
|
||||||
example = [
|
example = [
|
||||||
{
|
{
|
||||||
name = "git";
|
name = "git";
|
||||||
|
|
|
@ -16,13 +16,26 @@ in
|
||||||
package = helpers.mkPluginPackageOption "nix-develop.nvim" pkgs.vimPlugins.nix-develop-nvim;
|
package = helpers.mkPluginPackageOption "nix-develop.nvim" pkgs.vimPlugins.nix-develop-nvim;
|
||||||
|
|
||||||
ignoredVariables = mkOption {
|
ignoredVariables = mkOption {
|
||||||
type = types.attrsOf types.bool;
|
type = with types; attrsOf bool;
|
||||||
default = { };
|
default = { };
|
||||||
|
description = "An attrs specifying the variables should be ignored.";
|
||||||
|
example = {
|
||||||
|
BASHOPTS = true;
|
||||||
|
HOME = true;
|
||||||
|
NIX_BUILD_TOP = true;
|
||||||
|
SHELL = true;
|
||||||
|
TMP = true;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
separatedVariables = mkOption {
|
separatedVariables = mkOption {
|
||||||
type = types.attrsOf types.str;
|
type = with types; attrsOf str;
|
||||||
default = { };
|
default = { };
|
||||||
|
description = "An attrs specifying the separator to use for particular environment variables.";
|
||||||
|
example = {
|
||||||
|
PATH = ":";
|
||||||
|
XDG_DATA_DIRS = ":";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -108,18 +108,22 @@ in
|
||||||
|
|
||||||
fileTypes = mkOption {
|
fileTypes = mkOption {
|
||||||
description = "Enable and/or configure highlighting for certain filetypes";
|
description = "Enable and/or configure highlighting for certain filetypes";
|
||||||
type = types.nullOr (
|
type =
|
||||||
types.listOf (
|
with types;
|
||||||
types.oneOf [
|
nullOr (
|
||||||
types.str
|
listOf (
|
||||||
(types.submodule {
|
either str (
|
||||||
options = {
|
types.submodule {
|
||||||
language = mkOption { type = types.str; };
|
options = {
|
||||||
} // colorizer-options;
|
language = mkOption {
|
||||||
})
|
type = types.str;
|
||||||
]
|
description = "The language this configuration should apply to.";
|
||||||
)
|
};
|
||||||
);
|
} // colorizer-options;
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
default = null;
|
default = null;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -69,12 +69,21 @@ with lib;
|
||||||
window =
|
window =
|
||||||
let
|
let
|
||||||
spacingOptions = types.submodule {
|
spacingOptions = types.submodule {
|
||||||
options = {
|
options =
|
||||||
top = mkOption { type = types.int; };
|
genAttrs
|
||||||
right = mkOption { type = types.int; };
|
[
|
||||||
bottom = mkOption { type = types.int; };
|
"top"
|
||||||
left = mkOption { type = types.int; };
|
"right"
|
||||||
};
|
"bottom"
|
||||||
|
"left"
|
||||||
|
]
|
||||||
|
(
|
||||||
|
n:
|
||||||
|
mkOption {
|
||||||
|
type = types.ints.unsigned;
|
||||||
|
description = "Spacing at the ${n}.";
|
||||||
|
}
|
||||||
|
);
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
@ -98,18 +107,26 @@ with lib;
|
||||||
let
|
let
|
||||||
rangeOption = types.submodule {
|
rangeOption = types.submodule {
|
||||||
options = {
|
options = {
|
||||||
min = mkOption { type = types.int; };
|
min = mkOption {
|
||||||
max = mkOption { type = types.int; };
|
type = types.int;
|
||||||
|
description = "Minimum size.";
|
||||||
|
};
|
||||||
|
max = mkOption {
|
||||||
|
type = types.int;
|
||||||
|
description = "Maximum size.";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
height =
|
height = helpers.defaultNullOpts.mkNullable rangeOption {
|
||||||
helpers.defaultNullOpts.mkNullable rangeOption "{min = 4; max = 25;}"
|
min = 4;
|
||||||
"min and max height of the columns";
|
max = 25;
|
||||||
width =
|
} "min and max height of the columns";
|
||||||
helpers.defaultNullOpts.mkNullable rangeOption "{min = 20; max = 50;}"
|
width = helpers.defaultNullOpts.mkNullable rangeOption {
|
||||||
"min and max width of the columns";
|
min = 20;
|
||||||
|
max = 50;
|
||||||
|
} "min and max width of the columns";
|
||||||
spacing = helpers.defaultNullOpts.mkInt 3 "spacing between columns";
|
spacing = helpers.defaultNullOpts.mkInt 3 "spacing between columns";
|
||||||
align = helpers.defaultNullOpts.mkEnumFirstDefault [
|
align = helpers.defaultNullOpts.mkEnumFirstDefault [
|
||||||
"left"
|
"left"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue