Merge branch 'main' into telescope-ext

This commit is contained in:
raf 2025-01-25 16:57:39 +03:00 committed by GitHub
commit 4b22740c9a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
142 changed files with 2956 additions and 34 deletions

View file

@ -27,6 +27,7 @@
"git"
"languages"
"lsp"
"mini"
"minimap"
"notes"
"projects"

View file

@ -55,8 +55,14 @@ in {
preventJunkFiles = mkOption {
type = bool;
default = false;
description = "Prevent swapfile and backupfile from being created";
default = true;
example = false;
description = ''
Prevent swapfile and backupfile from being created.
`false` is the default Neovim behaviour. If you wish to create
backup and swapfiles, set this option to `false`.
'';
};
bell = mkOption {

View file

@ -2,6 +2,7 @@
imports = [
./basic.nix
./debug.nix
./highlight.nix
./spellcheck.nix
];
}

View file

@ -0,0 +1,119 @@
{
config,
lib,
...
}: let
inherit (lib.options) mkOption;
inherit (lib.types) nullOr attrsOf listOf submodule bool ints str enum;
inherit (lib.strings) hasPrefix concatLines;
inherit (lib.attrsets) mapAttrsToList;
inherit (lib.nvim.dag) entryBetween;
inherit (lib.nvim.lua) toLuaObject;
inherit (lib.nvim.types) hexColor;
mkColorOption = target:
mkOption {
type = nullOr hexColor;
default = null;
example = "#ebdbb2";
description = ''
The ${target} color to use. Written as color name or hex "#RRGGBB".
'';
};
mkBoolOption = name:
mkOption {
type = nullOr bool;
default = null;
example = false;
description = "Whether to enable ${name}";
};
cfg = config.vim.highlight;
in {
options.vim.highlight = mkOption {
type = attrsOf (submodule {
# See :h nvim_set_hl
options = {
bg = mkColorOption "background";
fg = mkColorOption "foreground";
sp = mkColorOption "special";
blend = mkOption {
type = nullOr (ints.between 0 100);
default = null;
description = "Blend as an integer between 0 and 100";
};
bold = mkBoolOption "bold";
standout = mkBoolOption "standout";
underline = mkBoolOption "underline";
undercurl = mkBoolOption "undercurl";
underdouble = mkBoolOption "underdouble";
underdotted = mkBoolOption "underdotted";
underdashed = mkBoolOption "underdashed";
strikethrough = mkBoolOption "strikethrough";
italic = mkBoolOption "italic";
reverse = mkBoolOption "reverse";
nocombine = mkBoolOption "nocombine";
link = mkOption {
type = nullOr str;
default = null;
description = "The name of another highlight group to link to";
};
default = mkOption {
type = nullOr bool;
default = null;
description = "Don't override existing definition";
};
ctermfg = mkOption {
type = nullOr str;
default = null;
description = "The cterm foreground color to use";
};
ctermbg = mkOption {
type = nullOr str;
default = null;
description = "The cterm background color to use";
};
cterm = mkOption {
type = nullOr (listOf (enum [
"bold"
"underline"
"undercurl"
"underdouble"
"underdotted"
"underdashed"
"strikethrough"
"reverse"
"inverse"
"italic"
"standout"
"altfont"
"nocombine"
"NONE"
]));
default = null;
description = "The cterm arguments to use. See ':h highlight-args'";
};
force = mkBoolOption "force update";
};
});
default = {};
example = {
SignColumn = {
bg = "#282828";
};
};
description = "Custom highlights to apply";
};
config = {
vim.luaConfigRC.highlight = let
highlights =
mapAttrsToList (
name: value: ''vim.api.nvim_set_hl(0, ${toLuaObject name}, ${toLuaObject value})''
)
cfg;
in
entryBetween ["lazyConfigs" "pluginConfigs" "extraPluginConfigs"] ["theme"] (concatLines highlights);
};
}

View file

@ -187,17 +187,6 @@ in {
'';
}
];
vim.pluginRC.nix = ''
vim.api.nvim_create_autocmd("FileType", {
pattern = "nix",
callback = function(opts)
local bo = vim.bo[opts.buf]
bo.tabstop = 2
bo.shiftwidth = 2
bo.softtabstop = 2
end
})
'';
}
(mkIf cfg.treesitter.enable {

View file

@ -106,6 +106,24 @@
)
'';
};
ruff = {
package = pkgs.writeShellApplication {
name = "ruff";
runtimeInputs = [pkgs.ruff];
text = ''
ruff format -
'';
};
nullConfig = ''
table.insert(
ls_sources,
null_ls.builtins.formatting.ruff.with({
command = "${cfg.format.package}/bin/ruff",
})
)
'';
};
};
defaultDebugger = "debugpy";

View file

@ -8,10 +8,12 @@
inherit (lib.options) mkEnableOption mkOption;
inherit (lib.modules) mkIf mkMerge mkDefault;
inherit (lib.lists) isList;
inherit (lib.types) either listOf package str enum;
inherit (lib.types) bool either listOf package str enum;
inherit (lib.nvim.lua) expToLua;
inherit (lib.nvim.types) mkGrammarOption;
cfg = config.vim.languages.zig;
defaultServer = "zls";
servers = {
zls = {
@ -31,7 +33,35 @@
};
};
cfg = config.vim.languages.zig;
# TODO: dap.adapter.lldb is duplicated when enabling the
# vim.languages.clang.dap module. This does not cause
# breakage... but could be cleaner.
defaultDebugger = "lldb-vscode";
debuggers = {
lldb-vscode = {
package = pkgs.lldb;
dapConfig = ''
dap.adapters.lldb = {
type = 'executable',
command = '${cfg.dap.package}/bin/lldb-dap',
name = 'lldb'
}
dap.configurations.zig = {
{
name = 'Launch',
type = 'lldb',
request = 'launch',
program = function()
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
end,
cwd = "''${workspaceFolder}",
stopOnEntry = false,
args = {},
},
}
'';
};
};
in {
options.vim.languages.zig = {
enable = mkEnableOption "Zig language support";
@ -56,6 +86,26 @@ in {
default = pkgs.zls;
};
};
dap = {
enable = mkOption {
type = bool;
default = config.vim.languages.enableDAP;
description = "Enable Zig Debug Adapter";
};
debugger = mkOption {
type = enum (attrNames debuggers);
default = defaultDebugger;
description = "Zig debugger to use";
};
package = mkOption {
type = package;
default = debuggers.${cfg.dap.debugger}.package;
description = "Zig debugger package.";
};
};
};
config = mkIf cfg.enable (mkMerge [
@ -77,5 +127,12 @@ in {
globals.zig_fmt_autosave = mkDefault 0;
};
})
(mkIf cfg.dap.enable {
vim = {
debugger.nvim-dap.enable = true;
debugger.nvim-dap.sources.zig-debugger = debuggers.${cfg.dap.debugger}.dapConfig;
};
})
]);
}

View file

@ -4,6 +4,7 @@
...
}: let
inherit (lib.modules) mkIf;
inherit (lib.strings) optionalString;
inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.lua) toLuaObject;
@ -12,13 +13,29 @@ in {
config = mkIf (cfg.enable && cfg.lightbulb.enable) {
vim = {
startPlugins = ["nvim-lightbulb"];
pluginRC.lightbulb = entryAnywhere ''
vim.api.nvim_command('autocmd CursorHold,CursorHoldI * lua require\'nvim-lightbulb\'.update_lightbulb()')
-- Enable trouble diagnostics viewer
require'nvim-lightbulb'.setup(${toLuaObject cfg.lightbulb.setupOpts})
local nvim_lightbulb = require("nvim-lightbulb")
nvim_lightbulb.setup(${toLuaObject cfg.lightbulb.setupOpts})
${optionalString cfg.lightbulb.autocmd.enable ''
vim.api.nvim_create_autocmd(${toLuaObject cfg.lightbulb.autocmd.events}, {
pattern = ${toLuaObject cfg.lightbulb.autocmd.pattern},
callback = function()
nvim_lightbulb.update_lightbulb()
end,
})
''}
'';
};
warnings = [
# This could have been an assertion, but the chances of collision is very low and asserting here
# might be too dramatic. Let's only warn the user, *in case* this occurs and is not intended. No
# error will be thrown if 'lightbulb.setupOpts.autocmd.enable' has not been set by the user.
(mkIf (cfg.lightbulb.autocmd.enable -> (cfg.lightbulb.setupOpts.autocmd.enabled or false)) ''
Both 'vim.lsp.lightbulb.autocmd.enable' and 'vim.lsp.lightbulb.setupOpts.autocmd.enable' are set
simultaneously. This might have performance implications due to frequent updates. Please set only
one option to handle nvim-lightbulb autocmd.
'')
];
};
}

View file

@ -1,11 +1,29 @@
{lib, ...}: let
inherit (lib.options) mkEnableOption;
inherit (lib.nvim.types) mkPluginSetupOption;
inherit (lib.options) mkOption mkEnableOption;
inherit (lib.types) listOf str either;
inherit (lib.nvim.types) mkPluginSetupOption luaInline;
in {
options.vim.lsp = {
lightbulb = {
enable = mkEnableOption "Lightbulb for code actions. Requires an emoji font";
setupOpts = mkPluginSetupOption "nvim-lightbulb" {};
autocmd = {
enable = mkEnableOption "updating lightbulb glyph automatically" // {default = true;};
events = mkOption {
type = listOf str;
default = ["CursorHold" "CursorHoldI"];
description = "Events on which to update nvim-lightbulb glyphs";
};
pattern = mkOption {
type = either str luaInline;
default = "*";
description = ''
File patterns or buffer names to match, determining which files or buffers trigger
glyph updates.
'';
};
};
};
};
}

View file

@ -0,0 +1,13 @@
{
config,
lib,
...
}: let
inherit (lib.options) mkEnableOption;
inherit (lib.nvim.types) mkPluginSetupOption;
in {
options.vim.mini.ai = {
enable = mkEnableOption "mini.ai";
setupOpts = mkPluginSetupOption "mini.ai" {};
};
}

View file

@ -0,0 +1,19 @@
{
config,
lib,
...
}: let
inherit (lib.modules) mkIf;
inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.lua) toLuaObject;
cfg = config.vim.mini.ai;
in {
vim = mkIf cfg.enable {
startPlugins = ["mini-ai"];
pluginRC.mini-ai = entryAnywhere ''
require("mini.ai").setup(${toLuaObject cfg.setupOpts})
'';
};
}

View file

@ -0,0 +1,6 @@
{
imports = [
./ai.nix
./config.nix
];
}

View file

@ -0,0 +1,13 @@
{
config,
lib,
...
}: let
inherit (lib.options) mkEnableOption;
inherit (lib.nvim.types) mkPluginSetupOption;
in {
options.vim.mini.align = {
enable = mkEnableOption "mini.align";
setupOpts = mkPluginSetupOption "mini.align" {};
};
}

View file

@ -0,0 +1,19 @@
{
config,
lib,
...
}: let
inherit (lib.modules) mkIf;
inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.lua) toLuaObject;
cfg = config.vim.mini.align;
in {
vim = mkIf cfg.enable {
startPlugins = ["mini-align"];
pluginRC.mini-align = entryAnywhere ''
require("mini.align").setup(${toLuaObject cfg.setupOpts})
'';
};
}

View file

@ -0,0 +1,6 @@
{
imports = [
./align.nix
./config.nix
];
}

View file

@ -0,0 +1,13 @@
{
config,
lib,
...
}: let
inherit (lib.options) mkEnableOption;
inherit (lib.nvim.types) mkPluginSetupOption;
in {
options.vim.mini.animate = {
enable = mkEnableOption "mini.animate";
setupOpts = mkPluginSetupOption "mini.animate" {};
};
}

View file

@ -0,0 +1,19 @@
{
config,
lib,
...
}: let
inherit (lib.modules) mkIf;
inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.lua) toLuaObject;
cfg = config.vim.mini.animate;
in {
vim = mkIf cfg.enable {
startPlugins = ["mini-animate"];
pluginRC.mini-animate = entryAnywhere ''
require("mini.animate").setup(${toLuaObject cfg.setupOpts})
'';
};
}

View file

@ -0,0 +1,6 @@
{
imports = [
./animate.nix
./config.nix
];
}

View file

@ -0,0 +1,13 @@
{
config,
lib,
...
}: let
inherit (lib.options) mkEnableOption;
inherit (lib.nvim.types) mkPluginSetupOption;
in {
options.vim.mini.basics = {
enable = mkEnableOption "mini.basics";
setupOpts = mkPluginSetupOption "mini.basics" {};
};
}

View file

@ -0,0 +1,19 @@
{
config,
lib,
...
}: let
inherit (lib.modules) mkIf;
inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.lua) toLuaObject;
cfg = config.vim.mini.basics;
in {
vim = mkIf cfg.enable {
startPlugins = ["mini-basics"];
pluginRC.mini-basics = entryAnywhere ''
require("mini.basics").setup(${toLuaObject cfg.setupOpts})
'';
};
}

View file

@ -0,0 +1,6 @@
{
imports = [
./basics.nix
./config.nix
];
}

View file

@ -0,0 +1,13 @@
{
config,
lib,
...
}: let
inherit (lib.options) mkEnableOption;
inherit (lib.nvim.types) mkPluginSetupOption;
in {
options.vim.mini.bracketed = {
enable = mkEnableOption "mini.bracketed";
setupOpts = mkPluginSetupOption "mini.bracketed" {};
};
}

View file

@ -0,0 +1,19 @@
{
config,
lib,
...
}: let
inherit (lib.modules) mkIf;
inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.lua) toLuaObject;
cfg = config.vim.mini.bracketed;
in {
vim = mkIf cfg.enable {
startPlugins = ["mini-bracketed"];
pluginRC.mini-bracketed = entryAnywhere ''
require("mini.bracketed").setup(${toLuaObject cfg.setupOpts})
'';
};
}

View file

@ -0,0 +1,6 @@
{
imports = [
./bracketed.nix
./config.nix
];
}

View file

@ -0,0 +1,13 @@
{
config,
lib,
...
}: let
inherit (lib.options) mkEnableOption;
inherit (lib.nvim.types) mkPluginSetupOption;
in {
options.vim.mini.bufremove = {
enable = mkEnableOption "mini.bufremove";
setupOpts = mkPluginSetupOption "mini.bufremove" {};
};
}

View file

@ -0,0 +1,19 @@
{
config,
lib,
...
}: let
inherit (lib.modules) mkIf;
inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.lua) toLuaObject;
cfg = config.vim.mini.bufremove;
in {
vim = mkIf cfg.enable {
startPlugins = ["mini-bufremove"];
pluginRC.mini-bufremove = entryAnywhere ''
require("mini.bufremove").setup(${toLuaObject cfg.setupOpts})
'';
};
}

View file

@ -0,0 +1,6 @@
{
imports = [
./bufremove.nix
./config.nix
];
}

View file

@ -0,0 +1,13 @@
{
config,
lib,
...
}: let
inherit (lib.options) mkEnableOption;
inherit (lib.nvim.types) mkPluginSetupOption;
in {
options.vim.mini.clue = {
enable = mkEnableOption "mini.clue";
setupOpts = mkPluginSetupOption "mini.clue" {};
};
}

View file

@ -0,0 +1,19 @@
{
config,
lib,
...
}: let
inherit (lib.modules) mkIf;
inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.lua) toLuaObject;
cfg = config.vim.mini.clue;
in {
vim = mkIf cfg.enable {
startPlugins = ["mini-clue"];
pluginRC.mini-clue = entryAnywhere ''
require("mini.clue").setup(${toLuaObject cfg.setupOpts})
'';
};
}

View file

@ -0,0 +1,6 @@
{
imports = [
./clue.nix
./config.nix
];
}

View file

@ -0,0 +1,11 @@
{
config,
lib,
...
}: let
inherit (lib.options) mkEnableOption;
in {
options.vim.mini.colors = {
enable = mkEnableOption "mini.colors";
};
}

View file

@ -0,0 +1,18 @@
{
config,
lib,
...
}: let
inherit (lib.modules) mkIf;
inherit (lib.nvim.dag) entryAnywhere;
cfg = config.vim.mini.colors;
in {
vim = mkIf cfg.enable {
startPlugins = ["mini-colors"];
pluginRC.mini-colors = entryAnywhere ''
require("mini.colors").setup()
'';
};
}

View file

@ -0,0 +1,6 @@
{
imports = [
./colors.nix
./config.nix
];
}

View file

@ -0,0 +1,13 @@
{
config,
lib,
...
}: let
inherit (lib.options) mkEnableOption;
inherit (lib.nvim.types) mkPluginSetupOption;
in {
options.vim.mini.comment = {
enable = mkEnableOption "mini.comment";
setupOpts = mkPluginSetupOption "mini.comment" {};
};
}

View file

@ -0,0 +1,19 @@
{
config,
lib,
...
}: let
inherit (lib.modules) mkIf;
inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.lua) toLuaObject;
cfg = config.vim.mini.comment;
in {
vim = mkIf cfg.enable {
startPlugins = ["mini-comment"];
pluginRC.mini-comment = entryAnywhere ''
require("mini.comment").setup(${toLuaObject cfg.setupOpts})
'';
};
}

View file

@ -0,0 +1,6 @@
{
imports = [
./comment.nix
./config.nix
];
}

View file

@ -0,0 +1,13 @@
{
config,
lib,
...
}: let
inherit (lib.options) mkEnableOption;
inherit (lib.nvim.types) mkPluginSetupOption;
in {
options.vim.mini.completion = {
enable = mkEnableOption "mini.completion";
setupOpts = mkPluginSetupOption "mini.completion" {};
};
}

View file

@ -0,0 +1,19 @@
{
config,
lib,
...
}: let
inherit (lib.modules) mkIf;
inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.lua) toLuaObject;
cfg = config.vim.mini.completion;
in {
vim = mkIf cfg.enable {
startPlugins = ["mini-completion"];
pluginRC.mini-completion = entryAnywhere ''
require("mini.completion").setup(${toLuaObject cfg.setupOpts})
'';
};
}

View file

@ -0,0 +1,6 @@
{
imports = [
./completion.nix
./config.nix
];
}

View file

@ -0,0 +1,44 @@
{
imports = [
./ai
./align
./animate
# ./base16 # NOTE: configured in theme/
./basics
./bracketed
./bufremove
./clue
./colors
./comment
./completion
./diff
./doc
./extra
./files
./fuzzy
./git
./hipatterns
./hues
./icons
./indentscope
./jump
./jump2d
./map
./misc
./move
./notify
./operators
./pairs
./pick
./sessions
./snippets
./splitjoin
./starter
./statusline
./surround
./tabline
./test
./trailspace
./visits
];
}

View file

@ -0,0 +1,19 @@
{
config,
lib,
...
}: let
inherit (lib.modules) mkIf;
inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.lua) toLuaObject;
cfg = config.vim.mini.diff;
in {
vim = mkIf cfg.enable {
startPlugins = ["mini-diff"];
pluginRC.mini-diff = entryAnywhere ''
require("mini.diff").setup(${toLuaObject cfg.setupOpts})
'';
};
}

View file

@ -0,0 +1,6 @@
{
imports = [
./diff.nix
./config.nix
];
}

View file

@ -0,0 +1,13 @@
{
config,
lib,
...
}: let
inherit (lib.options) mkEnableOption;
inherit (lib.nvim.types) mkPluginSetupOption;
in {
options.vim.mini.diff = {
enable = mkEnableOption "mini.diff";
setupOpts = mkPluginSetupOption "mini.diff" {};
};
}

View file

@ -0,0 +1,19 @@
{
config,
lib,
...
}: let
inherit (lib.modules) mkIf;
inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.lua) toLuaObject;
cfg = config.vim.mini.doc;
in {
vim = mkIf cfg.enable {
startPlugins = ["mini-doc"];
pluginRC.mini-doc = entryAnywhere ''
require("mini.doc").setup(${toLuaObject cfg.setupOpts})
'';
};
}

View file

@ -0,0 +1,6 @@
{
imports = [
./doc.nix
./config.nix
];
}

View file

@ -0,0 +1,13 @@
{
config,
lib,
...
}: let
inherit (lib.options) mkEnableOption;
inherit (lib.nvim.types) mkPluginSetupOption;
in {
options.vim.mini.doc = {
enable = mkEnableOption "mini.doc";
setupOpts = mkPluginSetupOption "mini.doc" {};
};
}

View file

@ -0,0 +1,18 @@
{
config,
lib,
...
}: let
inherit (lib.modules) mkIf;
inherit (lib.nvim.dag) entryAnywhere;
cfg = config.vim.mini.extra;
in {
vim = mkIf cfg.enable {
startPlugins = ["mini-extra"];
pluginRC.mini-extra = entryAnywhere ''
require("mini.extra").setup()
'';
};
}

View file

@ -0,0 +1,6 @@
{
imports = [
./extra.nix
./config.nix
];
}

View file

@ -0,0 +1,11 @@
{
config,
lib,
...
}: let
inherit (lib.options) mkEnableOption;
in {
options.vim.mini.extra = {
enable = mkEnableOption "mini.extra";
};
}

View file

@ -0,0 +1,19 @@
{
config,
lib,
...
}: let
inherit (lib.modules) mkIf;
inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.lua) toLuaObject;
cfg = config.vim.mini.files;
in {
vim = mkIf cfg.enable {
startPlugins = ["mini-files"];
pluginRC.mini-files = entryAnywhere ''
require("mini.files").setup(${toLuaObject cfg.setupOpts})
'';
};
}

View file

@ -0,0 +1,6 @@
{
imports = [
./files.nix
./config.nix
];
}

View file

@ -0,0 +1,13 @@
{
config,
lib,
...
}: let
inherit (lib.options) mkEnableOption;
inherit (lib.nvim.types) mkPluginSetupOption;
in {
options.vim.mini.files = {
enable = mkEnableOption "mini.files";
setupOpts = mkPluginSetupOption "mini.files" {};
};
}

View file

@ -0,0 +1,19 @@
{
config,
lib,
...
}: let
inherit (lib.modules) mkIf;
inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.lua) toLuaObject;
cfg = config.vim.mini.fuzzy;
in {
vim = mkIf cfg.enable {
startPlugins = ["mini-fuzzy"];
pluginRC.mini-fuzzy = entryAnywhere ''
require("mini.fuzzy").setup(${toLuaObject cfg.setupOpts})
'';
};
}

View file

@ -0,0 +1,6 @@
{
imports = [
./fuzzy.nix
./config.nix
];
}

View file

@ -0,0 +1,13 @@
{
config,
lib,
...
}: let
inherit (lib.options) mkEnableOption;
inherit (lib.nvim.types) mkPluginSetupOption;
in {
options.vim.mini.fuzzy = {
enable = mkEnableOption "mini.fuzzy";
setupOpts = mkPluginSetupOption "mini.fuzzy" {};
};
}

View file

@ -0,0 +1,19 @@
{
config,
lib,
...
}: let
inherit (lib.modules) mkIf;
inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.lua) toLuaObject;
cfg = config.vim.mini.git;
in {
vim = mkIf cfg.enable {
startPlugins = ["mini-git"];
pluginRC.mini-git = entryAnywhere ''
require("mini.git").setup(${toLuaObject cfg.setupOpts})
'';
};
}

View file

@ -0,0 +1,6 @@
{
imports = [
./git.nix
./config.nix
];
}

View file

@ -0,0 +1,13 @@
{
config,
lib,
...
}: let
inherit (lib.options) mkEnableOption;
inherit (lib.nvim.types) mkPluginSetupOption;
in {
options.vim.mini.git = {
enable = mkEnableOption "mini.git";
setupOpts = mkPluginSetupOption "mini.git" {};
};
}

View file

@ -0,0 +1,19 @@
{
config,
lib,
...
}: let
inherit (lib.modules) mkIf;
inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.lua) toLuaObject;
cfg = config.vim.mini.hipatterns;
in {
vim = mkIf cfg.enable {
startPlugins = ["mini-hipatterns"];
pluginRC.mini-hipatterns = entryAnywhere ''
require("mini.hipatterns").setup(${toLuaObject cfg.setupOpts})
'';
};
}

View file

@ -0,0 +1,6 @@
{
imports = [
./hipatterns.nix
./config.nix
];
}

View file

@ -0,0 +1,13 @@
{
config,
lib,
...
}: let
inherit (lib.options) mkEnableOption;
inherit (lib.nvim.types) mkPluginSetupOption;
in {
options.vim.mini.hipatterns = {
enable = mkEnableOption "mini.hipatterns";
setupOpts = mkPluginSetupOption "mini.hipatterns" {};
};
}

View file

@ -0,0 +1,19 @@
{
config,
lib,
...
}: let
inherit (lib.modules) mkIf;
inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.lua) toLuaObject;
cfg = config.vim.mini.hues;
in {
vim = mkIf cfg.enable {
startPlugins = ["mini-hues"];
pluginRC.mini-hues = entryAnywhere ''
require("mini.hues").setup(${toLuaObject cfg.setupOpts})
'';
};
}

View file

@ -0,0 +1,6 @@
{
imports = [
./hues.nix
./config.nix
];
}

View file

@ -0,0 +1,25 @@
{
config,
lib,
...
}: let
inherit (lib.options) mkEnableOption mkOption;
inherit (lib.strings) hasPrefix;
inherit (lib.nvim.types) mkPluginSetupOption;
inherit (lib.nvim.types) hexColor;
in {
options.vim.mini.hues = {
enable = mkEnableOption "mini.hues";
setupOpts = mkPluginSetupOption "mini.hues" {
background = mkOption {
description = "The hex color for the background color of the color scheme, prefixed with #";
type = hexColor;
};
foreground = mkOption {
description = "The hex color for the foreground color of the color scheme, prefixed with #";
type = hexColor;
};
};
};
}

View file

@ -0,0 +1,19 @@
{
config,
lib,
...
}: let
inherit (lib.modules) mkIf;
inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.lua) toLuaObject;
cfg = config.vim.mini.icons;
in {
vim = mkIf cfg.enable {
startPlugins = ["mini-icons"];
pluginRC.mini-icons = entryAnywhere ''
require("mini.icons").setup(${toLuaObject cfg.setupOpts})
'';
};
}

View file

@ -0,0 +1,6 @@
{
imports = [
./icons.nix
./config.nix
];
}

View file

@ -0,0 +1,13 @@
{
config,
lib,
...
}: let
inherit (lib.options) mkEnableOption;
inherit (lib.nvim.types) mkPluginSetupOption;
in {
options.vim.mini.icons = {
enable = mkEnableOption "mini.icons";
setupOpts = mkPluginSetupOption "mini.icons" {};
};
}

View file

@ -0,0 +1,19 @@
{
config,
lib,
...
}: let
inherit (lib.modules) mkIf;
inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.lua) toLuaObject;
cfg = config.vim.mini.indentscope;
in {
vim = mkIf cfg.enable {
startPlugins = ["mini-indentscope"];
pluginRC.mini-indentscope = entryAnywhere ''
require("mini.indentscope").setup(${toLuaObject cfg.setupOpts})
'';
};
}

View file

@ -0,0 +1,6 @@
{
imports = [
./indentscope.nix
./config.nix
];
}

View file

@ -0,0 +1,13 @@
{
config,
lib,
...
}: let
inherit (lib.options) mkEnableOption;
inherit (lib.nvim.types) mkPluginSetupOption;
in {
options.vim.mini.indentscope = {
enable = mkEnableOption "mini.indentscope";
setupOpts = mkPluginSetupOption "mini.indentscope" {};
};
}

View file

@ -0,0 +1,19 @@
{
config,
lib,
...
}: let
inherit (lib.modules) mkIf;
inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.lua) toLuaObject;
cfg = config.vim.mini.jump;
in {
vim = mkIf cfg.enable {
startPlugins = ["mini-jump"];
pluginRC.mini-jump = entryAnywhere ''
require("mini.jump").setup(${toLuaObject cfg.setupOpts})
'';
};
}

View file

@ -0,0 +1,6 @@
{
imports = [
./jump.nix
./config.nix
];
}

View file

@ -0,0 +1,13 @@
{
config,
lib,
...
}: let
inherit (lib.options) mkEnableOption;
inherit (lib.nvim.types) mkPluginSetupOption;
in {
options.vim.mini.jump = {
enable = mkEnableOption "mini.jump";
setupOpts = mkPluginSetupOption "mini.jump" {};
};
}

View file

@ -0,0 +1,19 @@
{
config,
lib,
...
}: let
inherit (lib.modules) mkIf;
inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.lua) toLuaObject;
cfg = config.vim.mini.jump2d;
in {
vim = mkIf cfg.enable {
startPlugins = ["mini-jump2d"];
pluginRC.mini-jump2d = entryAnywhere ''
require("mini.jump2d").setup(${toLuaObject cfg.setupOpts})
'';
};
}

View file

@ -0,0 +1,6 @@
{
imports = [
./jump2d.nix
./config.nix
];
}

View file

@ -0,0 +1,13 @@
{
config,
lib,
...
}: let
inherit (lib.options) mkEnableOption;
inherit (lib.nvim.types) mkPluginSetupOption;
in {
options.vim.mini.jump2d = {
enable = mkEnableOption "mini.jump2d";
setupOpts = mkPluginSetupOption "mini.jump2d" {};
};
}

View file

@ -0,0 +1,19 @@
{
config,
lib,
...
}: let
inherit (lib.modules) mkIf;
inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.lua) toLuaObject;
cfg = config.vim.mini.map;
in {
vim = mkIf cfg.enable {
startPlugins = ["mini-map"];
pluginRC.mini-map = entryAnywhere ''
require("mini.map").setup(${toLuaObject cfg.setupOpts})
'';
};
}

View file

@ -0,0 +1,6 @@
{
imports = [
./map.nix
./config.nix
];
}

View file

@ -0,0 +1,13 @@
{
config,
lib,
...
}: let
inherit (lib.options) mkEnableOption;
inherit (lib.nvim.types) mkPluginSetupOption;
in {
options.vim.mini.map = {
enable = mkEnableOption "mini.map";
setupOpts = mkPluginSetupOption "mini.map" {};
};
}

View file

@ -0,0 +1,19 @@
{
config,
lib,
...
}: let
inherit (lib.modules) mkIf;
inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.lua) toLuaObject;
cfg = config.vim.mini.misc;
in {
vim = mkIf cfg.enable {
startPlugins = ["mini-misc"];
pluginRC.mini-misc = entryAnywhere ''
require("mini.misc").setup(${toLuaObject cfg.setupOpts})
'';
};
}

View file

@ -0,0 +1,6 @@
{
imports = [
./misc.nix
./config.nix
];
}

View file

@ -0,0 +1,13 @@
{
config,
lib,
...
}: let
inherit (lib.options) mkEnableOption;
inherit (lib.nvim.types) mkPluginSetupOption;
in {
options.vim.mini.misc = {
enable = mkEnableOption "mini.misc";
setupOpts = mkPluginSetupOption "mini.misc" {};
};
}

View file

@ -0,0 +1,19 @@
{
config,
lib,
...
}: let
inherit (lib.modules) mkIf;
inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.lua) toLuaObject;
cfg = config.vim.mini.move;
in {
vim = mkIf cfg.enable {
startPlugins = ["mini-move"];
pluginRC.mini-move = entryAnywhere ''
require("mini.move").setup(${toLuaObject cfg.setupOpts})
'';
};
}

View file

@ -0,0 +1,6 @@
{
imports = [
./move.nix
./config.nix
];
}

View file

@ -0,0 +1,13 @@
{
config,
lib,
...
}: let
inherit (lib.options) mkEnableOption;
inherit (lib.nvim.types) mkPluginSetupOption;
in {
options.vim.mini.move = {
enable = mkEnableOption "mini.move";
setupOpts = mkPluginSetupOption "mini.move" {};
};
}

View file

@ -0,0 +1,20 @@
{
config,
lib,
...
}: let
inherit (lib.modules) mkIf mkAssert;
inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.lua) toLuaObject;
cfg = config.vim.mini.notify;
in {
vim = mkIf cfg.enable (mkAssert (!config.vim.notify.nvim-notify.enable) "Mini.notify is incompatible with nvim-notify!" {
startPlugins = ["mini-notify"];
pluginRC.mini-notify = entryAnywhere ''
require("mini.notify").setup(${toLuaObject cfg.setupOpts})
vim.notify = MiniNotify.make_notify(${toLuaObject cfg.notifyOpts})
'';
});
}

View file

@ -0,0 +1,6 @@
{
imports = [
./notify.nix
./config.nix
];
}

View file

@ -0,0 +1,41 @@
{
config,
lib,
...
}: let
inherit (lib.options) mkEnableOption mkOption;
inherit (lib.types) int str;
inherit (lib.nvim.types) mkPluginSetupOption borderType;
mkNotifyOpt = name: duration: hl_group: {
duration = mkOption {
type = int;
default = duration;
description = "The duration of the ${name} notification";
};
hl_group = mkOption {
type = str;
default = hl_group;
description = "The highlight group of the ${name} notification";
};
};
in {
options.vim.mini.notify = {
enable = mkEnableOption "mini.notify";
setupOpts = mkPluginSetupOption "mini.notify" {
window.config.border = mkOption {
type = borderType;
default = config.vim.ui.borders.globalStyle;
description = "The border type for the mini.notify-notifications";
};
};
notifyOpts = mkPluginSetupOption "mini.notify notifications" {
ERROR = mkNotifyOpt "error" 5000 "DiagnosticError";
WARN = mkNotifyOpt "warn" 5000 "DiagnosticWarn";
INFO = mkNotifyOpt "info" 5000 "DiagnosticInfo";
DEBUG = mkNotifyOpt "debug" 0 "DiagnosticHint";
TRACE = mkNotifyOpt "trace" 0 "DiagnosticOk";
OFF = mkNotifyOpt "off" 0 "MiniNotifyNormal";
};
};
}

View file

@ -0,0 +1,19 @@
{
config,
lib,
...
}: let
inherit (lib.modules) mkIf;
inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.lua) toLuaObject;
cfg = config.vim.mini.operators;
in {
vim = mkIf cfg.enable {
startPlugins = ["mini-operators"];
pluginRC.mini-operators = entryAnywhere ''
require("mini.operators").setup(${toLuaObject cfg.setupOpts})
'';
};
}

View file

@ -0,0 +1,6 @@
{
imports = [
./operators.nix
./config.nix
];
}

View file

@ -0,0 +1,13 @@
{
config,
lib,
...
}: let
inherit (lib.options) mkEnableOption;
inherit (lib.nvim.types) mkPluginSetupOption;
in {
options.vim.mini.operators = {
enable = mkEnableOption "mini.operators";
setupOpts = mkPluginSetupOption "mini.operators" {};
};
}

View file

@ -0,0 +1,19 @@
{
config,
lib,
...
}: let
inherit (lib.modules) mkIf;
inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.lua) toLuaObject;
cfg = config.vim.mini.pairs;
in {
vim = mkIf cfg.enable {
startPlugins = ["mini-pairs"];
pluginRC.mini-pairs = entryAnywhere ''
require("mini.pairs").setup(${toLuaObject cfg.setupOpts})
'';
};
}

View file

@ -0,0 +1,6 @@
{
imports = [
./pairs.nix
./config.nix
];
}

View file

@ -0,0 +1,13 @@
{
config,
lib,
...
}: let
inherit (lib.options) mkEnableOption;
inherit (lib.nvim.types) mkPluginSetupOption;
in {
options.vim.mini.pairs = {
enable = mkEnableOption "mini.pairs";
setupOpts = mkPluginSetupOption "mini.pairs" {};
};
}

View file

@ -0,0 +1,19 @@
{
config,
lib,
...
}: let
inherit (lib.modules) mkIf;
inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.lua) toLuaObject;
cfg = config.vim.mini.pick;
in {
vim = mkIf cfg.enable {
startPlugins = ["mini-pick"];
pluginRC.mini-pick = entryAnywhere ''
require("mini.pick").setup(${toLuaObject cfg.setupOpts})
'';
};
}

View file

@ -0,0 +1,6 @@
{
imports = [
./pick.nix
./config.nix
];
}

View file

@ -0,0 +1,13 @@
{
config,
lib,
...
}: let
inherit (lib.options) mkEnableOption;
inherit (lib.nvim.types) mkPluginSetupOption;
in {
options.vim.mini.pick = {
enable = mkEnableOption "mini.pick";
setupOpts = mkPluginSetupOption "mini.pick" {};
};
}

View file

@ -0,0 +1,19 @@
{
config,
lib,
...
}: let
inherit (lib.modules) mkIf;
inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.lua) toLuaObject;
cfg = config.vim.mini.sessions;
in {
vim = mkIf cfg.enable {
startPlugins = ["mini-sessions"];
pluginRC.mini-sessions = entryAnywhere ''
require("mini.sessions").setup(${toLuaObject cfg.setupOpts})
'';
};
}

View file

@ -0,0 +1,6 @@
{
imports = [
./sessions.nix
./config.nix
];
}

View file

@ -0,0 +1,13 @@
{
config,
lib,
...
}: let
inherit (lib.options) mkEnableOption;
inherit (lib.nvim.types) mkPluginSetupOption;
in {
options.vim.mini.sessions = {
enable = mkEnableOption "mini.sessions";
setupOpts = mkPluginSetupOption "mini.sessions" {};
};
}

Some files were not shown because too many files have changed in this diff Show more