mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-10 17:24:32 +02:00
plugins/mini: init + test
This commit is contained in:
parent
a2ef858ea5
commit
895998b5a7
3 changed files with 129 additions and 0 deletions
|
@ -87,6 +87,7 @@
|
||||||
./utils/intellitab.nix
|
./utils/intellitab.nix
|
||||||
./utils/lastplace.nix
|
./utils/lastplace.nix
|
||||||
./utils/mark-radar.nix
|
./utils/mark-radar.nix
|
||||||
|
./utils/mini.nix
|
||||||
./utils/neorg.nix
|
./utils/neorg.nix
|
||||||
./utils/notify.nix
|
./utils/notify.nix
|
||||||
./utils/netman.nix
|
./utils/netman.nix
|
||||||
|
|
48
plugins/utils/mini.nix
Normal file
48
plugins/utils/mini.nix
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib; let
|
||||||
|
cfg = config.plugins.mini;
|
||||||
|
helpers = import ../helpers.nix {inherit lib;};
|
||||||
|
in {
|
||||||
|
options.plugins.mini = {
|
||||||
|
enable = mkEnableOption "mini.nvim";
|
||||||
|
|
||||||
|
package = helpers.mkPackageOption "mini.nvim" pkgs.vimPlugins.mini-nvim;
|
||||||
|
|
||||||
|
modules = mkOption {
|
||||||
|
type = with types; attrsOf attrs;
|
||||||
|
default = {};
|
||||||
|
description = ''
|
||||||
|
Enable and configure the mini modules.
|
||||||
|
The keys are the names of the modules (without the `mini.` prefix).
|
||||||
|
The value is an attrs of configuration options for the module.
|
||||||
|
Leave the attrs empty to use the module's default configuration.
|
||||||
|
'';
|
||||||
|
example = {
|
||||||
|
ai = {
|
||||||
|
n_lines = 50;
|
||||||
|
search_method = "cover_or_next";
|
||||||
|
};
|
||||||
|
surrounds = {};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
extraPlugins = [cfg.package];
|
||||||
|
|
||||||
|
extraConfigLua =
|
||||||
|
concatLines
|
||||||
|
(
|
||||||
|
mapAttrsToList
|
||||||
|
(
|
||||||
|
name: config: "require('mini.${name}').setup(${helpers.toLuaObject config})"
|
||||||
|
)
|
||||||
|
cfg.modules
|
||||||
|
);
|
||||||
|
};
|
||||||
|
}
|
80
tests/test-sources/plugins/utils/mini.nix
Normal file
80
tests/test-sources/plugins/utils/mini.nix
Normal file
|
@ -0,0 +1,80 @@
|
||||||
|
{
|
||||||
|
empty = {
|
||||||
|
plugins.mini.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
allOfficialModules = {
|
||||||
|
plugins.mini = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
modules = {
|
||||||
|
ai = {
|
||||||
|
custom_textobjects = null;
|
||||||
|
mappings = {
|
||||||
|
around = "a";
|
||||||
|
inside = "i";
|
||||||
|
around_next = "an";
|
||||||
|
inside_next = "in";
|
||||||
|
around_last = "al";
|
||||||
|
inside_last = "il";
|
||||||
|
goto_left = "g[";
|
||||||
|
goto_right = "g]";
|
||||||
|
};
|
||||||
|
n_lines = 50;
|
||||||
|
search_method = "cover_or_next";
|
||||||
|
silent = false;
|
||||||
|
};
|
||||||
|
animate = {};
|
||||||
|
base16 = {
|
||||||
|
palette = {
|
||||||
|
base00 = "#123456";
|
||||||
|
base01 = "#123456";
|
||||||
|
base02 = "#123456";
|
||||||
|
base03 = "#123456";
|
||||||
|
base04 = "#123456";
|
||||||
|
base05 = "#123456";
|
||||||
|
base06 = "#123456";
|
||||||
|
base07 = "#123456";
|
||||||
|
base08 = "#123456";
|
||||||
|
base09 = "#123456";
|
||||||
|
base0A = "#123456";
|
||||||
|
base0B = "#123456";
|
||||||
|
base0C = "#123456";
|
||||||
|
base0D = "#123456";
|
||||||
|
base0E = "#123456";
|
||||||
|
base0F = "#123456";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
basics = {};
|
||||||
|
bracketed = {};
|
||||||
|
bufremove = {};
|
||||||
|
colors = {};
|
||||||
|
comment = {};
|
||||||
|
completion = {};
|
||||||
|
cursorword = {};
|
||||||
|
doc = {};
|
||||||
|
fuzzy = {};
|
||||||
|
hipatterns = {};
|
||||||
|
hues = {
|
||||||
|
background = "#351721";
|
||||||
|
foreground = "#cdc4c6";
|
||||||
|
};
|
||||||
|
indentscope = {};
|
||||||
|
jump = {};
|
||||||
|
jump2d = {};
|
||||||
|
map = {};
|
||||||
|
misc = {};
|
||||||
|
move = {};
|
||||||
|
pairs = {};
|
||||||
|
sessions = {};
|
||||||
|
splitjoin = {};
|
||||||
|
starter = {};
|
||||||
|
statusline = {};
|
||||||
|
surround = {};
|
||||||
|
tabline = {};
|
||||||
|
test = {};
|
||||||
|
trailspace = {};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue