mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-06-10 23:13:17 +00:00
Merge branch 'main' into main
This commit is contained in:
commit
7383a3999b
39 changed files with 1768 additions and 612 deletions
|
|
@ -19,6 +19,8 @@ in {
|
|||
"<leader>t" = "+NvimTree";
|
||||
};
|
||||
|
||||
visuals.fidget-nvim.setupOpts.notification.window.avoid = ["NvimTree"];
|
||||
|
||||
lazy.plugins.nvim-tree-lua = {
|
||||
package = "nvim-tree-lua";
|
||||
setupModule = "nvim-tree";
|
||||
|
|
|
|||
|
|
@ -4,15 +4,36 @@
|
|||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.options) mkEnableOption mkOption literalExpression;
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.options) mkEnableOption mkOption literalExpression;
|
||||
inherit (lib.types) enum listOf;
|
||||
inherit (lib) genAttrs;
|
||||
inherit (lib.attrsets) attrNames genAttrs;
|
||||
inherit (lib.generators) mkLuaInline;
|
||||
inherit (lib.meta) getExe;
|
||||
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||
inherit (lib.nvim.types) mkGrammarOption;
|
||||
|
||||
cfg = config.vim.languages.assembly;
|
||||
defaultServers = ["asm-lsp"];
|
||||
servers = ["asm-lsp"];
|
||||
|
||||
defaultFormat = ["asmfmt"];
|
||||
formats = {
|
||||
asmfmt = {
|
||||
command = getExe pkgs.asmfmt;
|
||||
};
|
||||
nasmfmt = {
|
||||
command = getExe pkgs.nasmfmt;
|
||||
args = mkLuaInline ''
|
||||
function(self, ctx)
|
||||
return {
|
||||
"--ii", ctx.shiftwidth,
|
||||
"$FILENAME",
|
||||
}
|
||||
end
|
||||
'';
|
||||
};
|
||||
};
|
||||
in {
|
||||
options.vim.languages.assembly = {
|
||||
enable = mkEnableOption "Assembly support";
|
||||
|
|
@ -42,6 +63,20 @@ in {
|
|||
description = "Assembly LSP server to use";
|
||||
};
|
||||
};
|
||||
|
||||
format = {
|
||||
enable =
|
||||
mkEnableOption "Assembly formatting"
|
||||
// {
|
||||
default = config.vim.languages.enableFormat;
|
||||
defaultText = literalExpression "config.vim.languages.enableFormat";
|
||||
};
|
||||
type = mkOption {
|
||||
type = listOf (enum (attrNames formats));
|
||||
default = defaultFormat;
|
||||
description = "Assembly formatter to use";
|
||||
};
|
||||
};
|
||||
};
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
(mkIf cfg.treesitter.enable {
|
||||
|
|
@ -57,9 +92,43 @@ in {
|
|||
vim.lsp = {
|
||||
presets = genAttrs cfg.lsp.servers (_: {enable = true;});
|
||||
servers = genAttrs cfg.lsp.servers (_: {
|
||||
filetypes = ["asm" "nasm" "masm" "vmasm" "fasm" "tasm" "tiasm" "asm68k" "asm8300"];
|
||||
filetypes = [
|
||||
"asm"
|
||||
"nasm"
|
||||
"masm"
|
||||
"vmasm"
|
||||
"fasm"
|
||||
"tasm"
|
||||
"tiasm"
|
||||
"asm68k"
|
||||
"asmh8300"
|
||||
];
|
||||
});
|
||||
};
|
||||
})
|
||||
|
||||
(mkIf cfg.format.enable {
|
||||
vim.formatter.conform-nvim = {
|
||||
enable = true;
|
||||
setupOpts = {
|
||||
formatters_by_ft = {
|
||||
asm = cfg.format.type;
|
||||
nasm = cfg.format.type;
|
||||
masm = cfg.format.type;
|
||||
vmasm = cfg.format.type;
|
||||
tasm = cfg.format.type;
|
||||
tiasm = cfg.format.type;
|
||||
asm68k = cfg.format.type;
|
||||
asmh8300 = cfg.format.type;
|
||||
};
|
||||
formatters =
|
||||
mapListToAttrs (name: {
|
||||
inherit name;
|
||||
value = formats.${name};
|
||||
})
|
||||
cfg.format.type;
|
||||
};
|
||||
};
|
||||
})
|
||||
]);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,9 +8,12 @@
|
|||
inherit (lib.options) mkEnableOption mkOption literalExpression;
|
||||
inherit (lib.types) bool enum package listOf;
|
||||
inherit (lib) genAttrs;
|
||||
inherit (lib.meta) getExe getExe';
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.nvim.types) mkGrammarOption;
|
||||
inherit (lib.generators) mkLuaInline;
|
||||
inherit (lib.nvim.dag) entryAfter;
|
||||
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||
|
||||
cfg = config.vim.languages.clang;
|
||||
|
||||
|
|
@ -45,6 +48,54 @@
|
|||
'';
|
||||
};
|
||||
};
|
||||
|
||||
defaultFormat = ["clang-format"];
|
||||
formats = {
|
||||
astyle = {
|
||||
command = getExe pkgs.astyle;
|
||||
stdin = false;
|
||||
args = mkLuaInline ''
|
||||
function(self, ctx)
|
||||
local args = {
|
||||
"$FILENAME",
|
||||
}
|
||||
|
||||
if not vim.bo[ctx.buf].expandtab then
|
||||
table.insert(args, "--indent=tab=" .. ctx.shiftwidth)
|
||||
else
|
||||
table.insert(args, "--indent=spaces=" .. ctx.shiftwidth)
|
||||
end
|
||||
|
||||
return args
|
||||
end
|
||||
'';
|
||||
};
|
||||
indent = {
|
||||
command = getExe pkgs.indent;
|
||||
stdin = true;
|
||||
args = mkLuaInline ''
|
||||
function(self, ctx)
|
||||
local args = {
|
||||
"--indent-level", ctx.shiftwidth,
|
||||
"--tab-size", ctx.shiftwidth,
|
||||
}
|
||||
|
||||
if not vim.bo[ctx.buf].expandtab then
|
||||
table.insert(args, "--use-tabs")
|
||||
else
|
||||
table.insert(args, "--no-tabs")
|
||||
end
|
||||
|
||||
return args
|
||||
end
|
||||
'';
|
||||
# Default is GNU style. Nobody likes that one.
|
||||
# This is under `append_args`, to allow easy editing of this argument,
|
||||
# without having to redefine everything as a user.
|
||||
append_args = ["--linux-style"];
|
||||
};
|
||||
clang-format.command = getExe' pkgs.clang-tools "clang-format";
|
||||
};
|
||||
in {
|
||||
options.vim.languages.clang = {
|
||||
enable = mkEnableOption "C/C++ language support";
|
||||
|
|
@ -102,6 +153,21 @@ in {
|
|||
default = debuggers.${cfg.dap.debugger}.package;
|
||||
};
|
||||
};
|
||||
|
||||
format = {
|
||||
enable =
|
||||
mkEnableOption "C formatting"
|
||||
// {
|
||||
default = config.vim.languages.enableFormat;
|
||||
defaultText = literalExpression "config.vim.languages.enableFormat";
|
||||
};
|
||||
|
||||
type = mkOption {
|
||||
type = listOf (enum (attrNames formats));
|
||||
default = defaultFormat;
|
||||
description = "C formatter to use";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
|
|
@ -127,5 +193,23 @@ in {
|
|||
vim.debugger.nvim-dap.enable = true;
|
||||
vim.debugger.nvim-dap.sources.clang-debugger = debuggers.${cfg.dap.debugger}.dapConfig;
|
||||
})
|
||||
|
||||
(mkIf cfg.format.enable {
|
||||
vim.formatter.conform-nvim = {
|
||||
enable = true;
|
||||
setupOpts = {
|
||||
formatters_by_ft = {
|
||||
c = cfg.format.type;
|
||||
cpp = cfg.format.type;
|
||||
};
|
||||
formatters =
|
||||
mapListToAttrs (name: {
|
||||
inherit name;
|
||||
value = formats.${name};
|
||||
})
|
||||
cfg.format.type;
|
||||
};
|
||||
};
|
||||
})
|
||||
]);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
cfg = config.vim.languages.css;
|
||||
|
||||
defaultServer = ["vscode-css-language-server"];
|
||||
servers = ["vscode-css-language-server"];
|
||||
servers = ["vscode-css-language-server" "emmet-ls"];
|
||||
|
||||
defaultFormat = ["prettier"];
|
||||
formats = {
|
||||
|
|
|
|||
|
|
@ -7,65 +7,72 @@ in {
|
|||
./asm.nix
|
||||
./astro.nix
|
||||
./bash.nix
|
||||
./cue.nix
|
||||
./dart.nix
|
||||
./clang.nix
|
||||
./clojure.nix
|
||||
./cmake.nix
|
||||
./csharp.nix
|
||||
./css.nix
|
||||
./scss.nix
|
||||
./cue.nix
|
||||
./dart.nix
|
||||
./docker.nix
|
||||
./elixir.nix
|
||||
./elm.nix
|
||||
./env.nix
|
||||
./fish.nix
|
||||
./fluent.nix
|
||||
./fsharp.nix
|
||||
./gettext.nix
|
||||
./gleam.nix
|
||||
./glsl.nix
|
||||
./go.nix
|
||||
./haskell.nix
|
||||
./hcl.nix
|
||||
./helm.nix
|
||||
./kotlin.nix
|
||||
./html.nix
|
||||
./tera.nix
|
||||
./twig.nix
|
||||
./liquid.nix
|
||||
./haskell.nix
|
||||
./java.nix
|
||||
./jinja.nix
|
||||
./jq.nix
|
||||
./json.nix
|
||||
./julia.nix
|
||||
./just.nix
|
||||
./kotlin.nix
|
||||
./liquid.nix
|
||||
./lua.nix
|
||||
./make.nix
|
||||
./markdown.nix
|
||||
./tex.nix
|
||||
./nim.nix
|
||||
./vala.nix
|
||||
./nix.nix
|
||||
./nu.nix
|
||||
./ocaml.nix
|
||||
./odin.nix
|
||||
./openscad.nix
|
||||
./php.nix
|
||||
./python.nix
|
||||
./qml.nix
|
||||
./r.nix
|
||||
./ruby.nix
|
||||
./rust.nix
|
||||
./scala.nix
|
||||
./scss.nix
|
||||
./scss.nix
|
||||
./sql.nix
|
||||
./standard-ml.nix
|
||||
./svelte.nix
|
||||
./vue.nix
|
||||
./tera.nix
|
||||
./terraform.nix
|
||||
./tex.nix
|
||||
./toml.nix
|
||||
./tsx.nix
|
||||
./twig.nix
|
||||
./typescript.nix
|
||||
./typst.nix
|
||||
./zig.nix
|
||||
./csharp.nix
|
||||
./julia.nix
|
||||
./nu.nix
|
||||
./odin.nix
|
||||
./vala.nix
|
||||
./vhdl.nix
|
||||
./vue.nix
|
||||
./wgsl.nix
|
||||
./yaml.nix
|
||||
./ruby.nix
|
||||
./just.nix
|
||||
./make.nix
|
||||
./xml.nix
|
||||
./gettext.nix
|
||||
./fluent.nix
|
||||
./openscad.nix
|
||||
./jq.nix
|
||||
./yaml.nix
|
||||
./zig.nix
|
||||
|
||||
# This is now a hard deprecation.
|
||||
(mkRenamedOptionModule ["vim" "languages" "enableLSP"] ["vim" "lsp" "enable"])
|
||||
|
|
|
|||
163
modules/plugins/languages/docker.nix
Normal file
163
modules/plugins/languages/docker.nix
Normal file
|
|
@ -0,0 +1,163 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (builtins) attrNames;
|
||||
inherit (lib) genAttrs;
|
||||
inherit (lib.meta) getExe;
|
||||
inherit (lib.options) mkEnableOption mkOption literalExpression;
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.types) enum listOf;
|
||||
inherit (lib.nvim.types) mkGrammarOption diagnostics;
|
||||
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||
|
||||
cfg = config.vim.languages.docker;
|
||||
|
||||
defaultServers = ["docker-language-server"];
|
||||
servers = ["docker-language-server"];
|
||||
|
||||
defaultFormat = ["dockerfmt"];
|
||||
formats = {
|
||||
dockerfmt = {
|
||||
command = getExe pkgs.dockerfmt;
|
||||
};
|
||||
};
|
||||
|
||||
defaultDiagnosticsProvider = ["hadolint"];
|
||||
diagnosticsProviders = {
|
||||
hadolint = {
|
||||
config.cmd = getExe (
|
||||
pkgs.writeShellApplication {
|
||||
name = "hadolint";
|
||||
runtimeInputs = [pkgs.hadolint];
|
||||
text = "hadolint -";
|
||||
}
|
||||
);
|
||||
};
|
||||
};
|
||||
in {
|
||||
options.vim.languages.docker = {
|
||||
enable = mkEnableOption "Docker language support";
|
||||
treesitter = {
|
||||
enable =
|
||||
mkEnableOption "Docker treesitter support"
|
||||
// {
|
||||
default = config.vim.languages.enableTreesitter;
|
||||
defaultText = literalExpression "config.vim.languages.enableTreesitter";
|
||||
};
|
||||
package = mkGrammarOption pkgs "dockerfile";
|
||||
};
|
||||
|
||||
lsp = {
|
||||
enable =
|
||||
mkEnableOption "Docker LSP support"
|
||||
// {
|
||||
default = config.vim.lsp.enable;
|
||||
defaultText = literalExpression "config.vim.lsp.enable";
|
||||
};
|
||||
servers = mkOption {
|
||||
type = listOf (enum servers);
|
||||
default = defaultServers;
|
||||
description = "Docker LSP server to use";
|
||||
};
|
||||
};
|
||||
|
||||
format = {
|
||||
enable =
|
||||
mkEnableOption "Dockerfile formatting"
|
||||
// {
|
||||
default = config.vim.languages.enableFormat;
|
||||
defaultText = literalExpression "config.vim.languages.enableFormat";
|
||||
};
|
||||
|
||||
type = mkOption {
|
||||
type = listOf (enum (attrNames formats));
|
||||
default = defaultFormat;
|
||||
description = "Dockerfile formatter to use";
|
||||
};
|
||||
};
|
||||
|
||||
extraDiagnostics = {
|
||||
enable =
|
||||
mkEnableOption "extra Dockerfile diagnostics"
|
||||
// {
|
||||
default = config.vim.languages.enableExtraDiagnostics;
|
||||
};
|
||||
|
||||
types = diagnostics {
|
||||
langDesc = "Dockerfile";
|
||||
inherit diagnosticsProviders;
|
||||
inherit defaultDiagnosticsProvider;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
{
|
||||
vim.autocmds = [
|
||||
# Without this the LSP doesn't understand them correctly
|
||||
# and there are conflicts with the YAML LSP
|
||||
{
|
||||
desc = "Set Docker Compose filetype";
|
||||
event = ["BufRead" "BufNewFile"];
|
||||
pattern = [
|
||||
"compose.yml"
|
||||
"compose.yaml"
|
||||
"docker-compose.yml"
|
||||
"docker-compose.yaml"
|
||||
];
|
||||
command = "set filetype=dockercompose";
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
(mkIf cfg.treesitter.enable {
|
||||
vim.treesitter = {
|
||||
enable = true;
|
||||
grammars = [cfg.treesitter.package];
|
||||
};
|
||||
})
|
||||
|
||||
(mkIf cfg.lsp.enable {
|
||||
vim.lsp = {
|
||||
presets = genAttrs cfg.lsp.servers (_: {enable = true;});
|
||||
servers = genAttrs cfg.lsp.servers (_: {
|
||||
filetypes = [
|
||||
"dockerfile"
|
||||
"dockercompose"
|
||||
];
|
||||
});
|
||||
};
|
||||
})
|
||||
|
||||
(mkIf cfg.format.enable {
|
||||
vim.formatter.conform-nvim = {
|
||||
enable = true;
|
||||
setupOpts = {
|
||||
formatters_by_ft.dockerfile = cfg.format.type;
|
||||
formatters =
|
||||
mapListToAttrs (name: {
|
||||
inherit name;
|
||||
value = formats.${name};
|
||||
})
|
||||
cfg.format.type;
|
||||
};
|
||||
};
|
||||
})
|
||||
|
||||
(mkIf cfg.extraDiagnostics.enable {
|
||||
vim.diagnostics.nvim-lint = {
|
||||
enable = true;
|
||||
linters_by_ft.dockerfile = cfg.extraDiagnostics.types;
|
||||
linters = mkMerge (
|
||||
map (name: {
|
||||
${name} = diagnosticsProviders.${name}.config;
|
||||
})
|
||||
cfg.extraDiagnostics.types
|
||||
);
|
||||
};
|
||||
})
|
||||
]);
|
||||
}
|
||||
70
modules/plugins/languages/env.nix
Normal file
70
modules/plugins/languages/env.nix
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.options) mkEnableOption literalExpression;
|
||||
inherit (lib.meta) getExe;
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.nvim.types) diagnostics;
|
||||
|
||||
cfg = config.vim.languages.env;
|
||||
|
||||
defaultDiagnosticsProvider = ["dotenv-linter"];
|
||||
diagnosticsProviders = {
|
||||
dotenv-linter = let
|
||||
pkg = pkgs.dotenv-linter;
|
||||
in {
|
||||
package = pkg;
|
||||
config = {
|
||||
cmd = getExe pkg;
|
||||
};
|
||||
};
|
||||
};
|
||||
in {
|
||||
options.vim.languages.env = {
|
||||
enable = mkEnableOption "Env language support";
|
||||
|
||||
extraDiagnostics = {
|
||||
enable =
|
||||
mkEnableOption "extra Env diagnostics"
|
||||
// {
|
||||
default = config.vim.languages.enableExtraDiagnostics;
|
||||
defaultText = literalExpression "config.vim.languages.enableExtraDiagnostics";
|
||||
};
|
||||
types = diagnostics {
|
||||
langDesc = "Env";
|
||||
inherit diagnosticsProviders;
|
||||
inherit defaultDiagnosticsProvider;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
{
|
||||
vim.autocmds = [
|
||||
{
|
||||
event = ["BufRead" "BufNewFile"];
|
||||
pattern = [
|
||||
# support common names like `dist.env`
|
||||
"*.env"
|
||||
# support weird env files names like symfony ones.
|
||||
".env.*"
|
||||
];
|
||||
command = "set filetype=env";
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
(mkIf cfg.extraDiagnostics.enable {
|
||||
vim.diagnostics.nvim-lint = {
|
||||
enable = true;
|
||||
linters_by_ft.env = cfg.extraDiagnostics.types;
|
||||
linters =
|
||||
mkMerge (map (name: {${name} = diagnosticsProviders.${name}.config;})
|
||||
cfg.extraDiagnostics.types);
|
||||
};
|
||||
})
|
||||
]);
|
||||
}
|
||||
102
modules/plugins/languages/fish.nix
Normal file
102
modules/plugins/languages/fish.nix
Normal file
|
|
@ -0,0 +1,102 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (builtins) attrNames;
|
||||
inherit (lib.options) mkOption mkEnableOption literalExpression;
|
||||
inherit (lib.meta) getExe';
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.types) enum bool listOf;
|
||||
inherit (lib) genAttrs;
|
||||
inherit (lib.nvim.types) mkGrammarOption;
|
||||
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||
|
||||
cfg = config.vim.languages.fish;
|
||||
|
||||
defaultServers = ["fish-lsp"];
|
||||
servers = ["fish-lsp"];
|
||||
|
||||
defaultFormat = ["fish_indent"];
|
||||
formats = {
|
||||
fish_indent = {
|
||||
command = getExe' pkgs.fish "fish_indent";
|
||||
};
|
||||
};
|
||||
in {
|
||||
options.vim.languages.fish = {
|
||||
enable = mkEnableOption "Fish language support";
|
||||
|
||||
treesitter = {
|
||||
enable =
|
||||
mkEnableOption "Fish treesitter"
|
||||
// {
|
||||
default = config.vim.languages.enableTreesitter;
|
||||
defaultText = literalExpression "config.vim.languages.enableTreesitter";
|
||||
};
|
||||
package = mkGrammarOption pkgs "fish";
|
||||
};
|
||||
|
||||
lsp = {
|
||||
enable =
|
||||
mkEnableOption "Fish LSP support"
|
||||
// {
|
||||
default = config.vim.lsp.enable;
|
||||
defaultText = literalExpression "config.vim.lsp.enable";
|
||||
};
|
||||
servers = mkOption {
|
||||
type = listOf (enum servers);
|
||||
default = defaultServers;
|
||||
description = "Fish LSP server to use";
|
||||
};
|
||||
};
|
||||
|
||||
format = {
|
||||
enable = mkOption {
|
||||
type = bool;
|
||||
default = config.vim.languages.enableFormat;
|
||||
defaultText = literalExpression "config.vim.languages.enableFormat";
|
||||
description = "Enable Fish formatting";
|
||||
};
|
||||
type = mkOption {
|
||||
type = listOf (enum (attrNames formats));
|
||||
default = defaultFormat;
|
||||
description = "Fish formatter to use";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
(mkIf cfg.treesitter.enable {
|
||||
vim.treesitter = {
|
||||
enable = true;
|
||||
grammars = [cfg.treesitter.package];
|
||||
};
|
||||
})
|
||||
|
||||
(mkIf cfg.lsp.enable {
|
||||
vim.lsp = {
|
||||
presets = genAttrs cfg.lsp.servers (_: {enable = true;});
|
||||
servers = genAttrs cfg.lsp.servers (_: {
|
||||
filetypes = ["fish"];
|
||||
});
|
||||
};
|
||||
})
|
||||
|
||||
(mkIf cfg.format.enable {
|
||||
vim.formatter.conform-nvim = {
|
||||
enable = true;
|
||||
setupOpts = {
|
||||
formatters_by_ft.fish = cfg.format.type;
|
||||
formatters =
|
||||
mapListToAttrs (name: {
|
||||
inherit name;
|
||||
value = formats.${name};
|
||||
})
|
||||
cfg.format.type;
|
||||
};
|
||||
};
|
||||
})
|
||||
]);
|
||||
}
|
||||
|
|
@ -67,7 +67,21 @@
|
|||
"--output.junit-xml.path="
|
||||
"--output.teamcity.path="
|
||||
"--output.sarif.path="
|
||||
(mkLuaInline ''
|
||||
-- Run on current file only if go.mod is missing
|
||||
function()
|
||||
local fnmod = ":p";
|
||||
local cmd = {"${getExe pkgs.go}", "env", "GOMOD"};
|
||||
local ok, gomod = pcall(vim.fn.system, cmd);
|
||||
gomod = gomod:gsub("%s+", "")
|
||||
if ok and gomod ~= "" and gomod ~= "/dev/null" then
|
||||
fnmod = ":h";
|
||||
end
|
||||
return vim.fn.fnamemodify(vim.api.nvim_buf_get_name(0), fnmod)
|
||||
end
|
||||
'')
|
||||
];
|
||||
append_fname = false;
|
||||
parser = mkLuaInline ''
|
||||
function(output, bufnr)
|
||||
local SOURCE = "golangci-lint";
|
||||
|
|
@ -111,15 +125,19 @@
|
|||
local normalized = issue.Severity:lower()
|
||||
sev = severity_map[normalized] or vim.diagnostic.severity.ERROR
|
||||
end
|
||||
table.insert(diagnostics, {
|
||||
bufnr = bufnr,
|
||||
lnum = issue.Pos.Line - 1,
|
||||
col = issue.Pos.Column - 1,
|
||||
message = issue.Text,
|
||||
code = issue.FromLinter,
|
||||
severity = sev,
|
||||
source = SOURCE,
|
||||
})
|
||||
|
||||
local buffer = vim.fn.fnamemodify(vim.api.nvim_buf_get_name(bufnr), ":p")
|
||||
if vim.fs.normalize(buffer) == vim.fs.normalize(issue.Pos.Filename) then
|
||||
table.insert(diagnostics, {
|
||||
bufnr = bufnr,
|
||||
lnum = issue.Pos.Line - 1,
|
||||
col = issue.Pos.Column - 1,
|
||||
message = issue.Text,
|
||||
code = issue.FromLinter,
|
||||
severity = sev,
|
||||
source = SOURCE,
|
||||
})
|
||||
end
|
||||
end
|
||||
return diagnostics
|
||||
end
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
cfg = config.vim.languages.hcl;
|
||||
|
||||
defaultServers = ["tofu-ls"];
|
||||
servers = ["terraform-ls" "tofu-ls"];
|
||||
servers = ["terraform-ls" "tofu-ls" "docker-language-server"];
|
||||
|
||||
defaultFormat = ["hclfmt"];
|
||||
formats = {
|
||||
|
|
|
|||
|
|
@ -25,6 +25,14 @@
|
|||
command = getExe pkgs.jsonfmt;
|
||||
args = ["-w" "-"];
|
||||
};
|
||||
|
||||
prettier = {
|
||||
command = getExe pkgs.prettier;
|
||||
};
|
||||
|
||||
prettierd = {
|
||||
command = getExe pkgs.prettierd;
|
||||
};
|
||||
};
|
||||
in {
|
||||
options.vim.languages.json = {
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.types) enum int attrs listOf;
|
||||
inherit (lib.nvim.lua) toLuaObject;
|
||||
inherit (lib.nvim.types) mkGrammarOption;
|
||||
inherit (lib.nvim.types) mkGrammarOption diagnostics;
|
||||
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||
|
||||
cfg = config.vim.languages.php;
|
||||
|
|
@ -33,6 +33,14 @@
|
|||
command = "${pkgs.php84Packages.php-cs-fixer}/bin/php-cs-fixer";
|
||||
};
|
||||
};
|
||||
|
||||
defaultDiagnosticsProvider = ["phpstan"];
|
||||
|
||||
diagnosticsProviders = {
|
||||
phpstan = {
|
||||
config.cmd = getExe pkgs.phpstan;
|
||||
};
|
||||
};
|
||||
in {
|
||||
options.vim.languages.php = {
|
||||
enable = mkEnableOption "PHP language support";
|
||||
|
|
@ -103,6 +111,21 @@ in {
|
|||
};
|
||||
};
|
||||
};
|
||||
|
||||
extraDiagnostics = {
|
||||
enable =
|
||||
mkEnableOption "extra PHP diagnostics"
|
||||
// {
|
||||
default = config.vim.languages.enableExtraDiagnostics;
|
||||
defaultText = literalExpression "config.vim.languages.enableExtraDiagnostic";
|
||||
};
|
||||
|
||||
types = diagnostics {
|
||||
langDesc = "PHP";
|
||||
inherit diagnosticsProviders;
|
||||
inherit defaultDiagnosticsProvider;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
|
|
@ -154,5 +177,15 @@ in {
|
|||
};
|
||||
};
|
||||
})
|
||||
|
||||
(mkIf cfg.extraDiagnostics.enable {
|
||||
vim.diagnostics.nvim-lint = {
|
||||
enable = true;
|
||||
linters_by_ft.php = cfg.extraDiagnostics.types;
|
||||
linters =
|
||||
mkMerge (map (name: {${name} = diagnosticsProviders.${name}.config;})
|
||||
cfg.extraDiagnostics.types);
|
||||
};
|
||||
})
|
||||
]);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
cfg = config.vim.languages.scss;
|
||||
|
||||
defaultServer = ["some-sass-language-server"];
|
||||
servers = ["some-sass-language-server" "vscode-css-language-server"];
|
||||
servers = ["some-sass-language-server" "vscode-css-language-server" "emmet-ls"];
|
||||
|
||||
defaultFormat = ["prettier"];
|
||||
formats = {
|
||||
|
|
|
|||
114
modules/plugins/languages/standard-ml.nix
Normal file
114
modules/plugins/languages/standard-ml.nix
Normal file
|
|
@ -0,0 +1,114 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.options) literalExpression mkEnableOption mkOption;
|
||||
inherit (lib.types) enum listOf;
|
||||
inherit (lib.attrsets) attrNames genAttrs;
|
||||
inherit (lib.generators) mkLuaInline;
|
||||
inherit (lib.meta) getExe;
|
||||
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||
inherit (lib.nvim.types) mkTreesitterGrammarOption;
|
||||
|
||||
cfg = config.vim.languages.standard-ml;
|
||||
|
||||
defaultServers = ["millet"];
|
||||
servers = ["millet"];
|
||||
|
||||
defaultFormat = ["smlfmt"];
|
||||
formats = {
|
||||
smlfmt = {
|
||||
command = getExe pkgs.smlfmt;
|
||||
stdin = false;
|
||||
args = mkLuaInline ''
|
||||
function(self, ctx)
|
||||
return {
|
||||
"--force",
|
||||
"-tab-width", ctx.shiftwidth,
|
||||
"-indent-width", ctx.shiftwidth,
|
||||
"$FILENAME",
|
||||
}
|
||||
end
|
||||
'';
|
||||
};
|
||||
};
|
||||
in {
|
||||
options.vim.languages.standard-ml = {
|
||||
enable = mkEnableOption "Standard ML support";
|
||||
|
||||
treesitter = {
|
||||
enable =
|
||||
mkEnableOption "Standard ML treesitter"
|
||||
// {
|
||||
default = config.vim.languages.enableTreesitter;
|
||||
defaultText = literalExpression "config.vim.languages.enableTreesitter";
|
||||
};
|
||||
package = mkTreesitterGrammarOption pkgs "sml";
|
||||
};
|
||||
|
||||
lsp = {
|
||||
enable =
|
||||
mkEnableOption "Standard ML LSP support"
|
||||
// {
|
||||
default = config.vim.lsp.enable;
|
||||
defaultText = literalExpression "config.vim.lsp.enable";
|
||||
};
|
||||
servers = mkOption {
|
||||
type = listOf (enum servers);
|
||||
default = defaultServers;
|
||||
description = "Standard ML LSP server to use";
|
||||
};
|
||||
};
|
||||
|
||||
format = {
|
||||
enable =
|
||||
mkEnableOption "Standard ML formatting"
|
||||
// {
|
||||
default = config.vim.languages.enableFormat;
|
||||
defaultText = literalExpression "config.vim.languages.enableFormat";
|
||||
};
|
||||
|
||||
type = mkOption {
|
||||
description = "Standard ML formatter to use";
|
||||
type = listOf (enum (attrNames formats));
|
||||
default = defaultFormat;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
(mkIf cfg.treesitter.enable {
|
||||
vim.treesitter = {
|
||||
enable = true;
|
||||
grammars = [cfg.treesitter.package];
|
||||
};
|
||||
})
|
||||
|
||||
(mkIf cfg.lsp.enable {
|
||||
vim.lsp = {
|
||||
presets = genAttrs cfg.lsp.servers (_: {enable = true;});
|
||||
servers = genAttrs cfg.lsp.servers (_: {
|
||||
filetypes = ["sml"];
|
||||
});
|
||||
};
|
||||
})
|
||||
|
||||
(mkIf cfg.format.enable {
|
||||
vim.formatter.conform-nvim = {
|
||||
enable = true;
|
||||
setupOpts = {
|
||||
formatters_by_ft.sml = cfg.format.type;
|
||||
formatters =
|
||||
mapListToAttrs (name: {
|
||||
inherit name;
|
||||
value = formats.${name};
|
||||
})
|
||||
cfg.format.type;
|
||||
};
|
||||
};
|
||||
})
|
||||
]);
|
||||
}
|
||||
|
|
@ -17,7 +17,7 @@
|
|||
cfg = config.vim.languages.svelte;
|
||||
|
||||
defaultServers = ["svelte-language-server"];
|
||||
servers = ["svelte-language-server"];
|
||||
servers = ["svelte-language-server" "emmet-ls"];
|
||||
|
||||
defaultFormat = ["prettier"];
|
||||
formats = let
|
||||
|
|
|
|||
159
modules/plugins/languages/tsx.nix
Normal file
159
modules/plugins/languages/tsx.nix
Normal file
|
|
@ -0,0 +1,159 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.options) mkEnableOption mkOption literalExpression;
|
||||
inherit (lib.types) enum listOf;
|
||||
inherit (lib.attrsets) attrNames genAttrs;
|
||||
inherit (lib.meta) getExe;
|
||||
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||
inherit (lib.nvim.types) mkGrammarOption diagnostics;
|
||||
|
||||
cfg = config.vim.languages.tsx;
|
||||
|
||||
defaultServers = ["typescript-language-server"];
|
||||
servers = ["typescript-language-server" "deno" "typescript-go" "emmet-ls"];
|
||||
|
||||
defaultFormat = ["prettier"];
|
||||
formats = {
|
||||
prettier = {
|
||||
command = getExe pkgs.prettier;
|
||||
};
|
||||
|
||||
prettierd = {
|
||||
command = getExe pkgs.prettierd;
|
||||
};
|
||||
|
||||
biome = {
|
||||
command = getExe pkgs.biome;
|
||||
};
|
||||
|
||||
biome-check = {
|
||||
command = getExe pkgs.biome;
|
||||
};
|
||||
|
||||
biome-organize-imports = {
|
||||
command = getExe pkgs.biome;
|
||||
};
|
||||
};
|
||||
|
||||
defaultDiagnosticsProvider = ["biomejs"];
|
||||
diagnosticsProviders = {
|
||||
biomejs = let
|
||||
pkg = pkgs.biome;
|
||||
in {
|
||||
package = pkg;
|
||||
config = {
|
||||
cmd = getExe pkg;
|
||||
};
|
||||
};
|
||||
};
|
||||
in {
|
||||
options.vim.languages.tsx = {
|
||||
enable = mkEnableOption "Typescript XML (TSX) language support";
|
||||
|
||||
treesitter = {
|
||||
enable =
|
||||
mkEnableOption "Typescript XML (TSX) treesitter"
|
||||
// {
|
||||
default = config.vim.languages.enableTreesitter;
|
||||
defaultText = literalExpression "config.vim.languages.enableTreesitter";
|
||||
};
|
||||
package = mkGrammarOption pkgs "tsx";
|
||||
};
|
||||
|
||||
lsp = {
|
||||
enable =
|
||||
mkEnableOption "Typescript XML (TSX) LSP support"
|
||||
// {
|
||||
default = config.vim.lsp.enable;
|
||||
defaultText = literalExpression "config.vim.lsp.enable";
|
||||
};
|
||||
servers = mkOption {
|
||||
type = listOf (enum servers);
|
||||
default = defaultServers;
|
||||
description = "Typescript XML (TSX) LSP server to use";
|
||||
};
|
||||
};
|
||||
|
||||
format = {
|
||||
enable =
|
||||
mkEnableOption "Typescript XML (TSX) formatting"
|
||||
// {
|
||||
default = config.vim.languages.enableFormat;
|
||||
defaultText = literalExpression "config.vim.languages.enableFormat";
|
||||
};
|
||||
|
||||
type = mkOption {
|
||||
description = "Typescript XML (TSX) formatter to use";
|
||||
type = listOf (enum (attrNames formats));
|
||||
default = defaultFormat;
|
||||
};
|
||||
};
|
||||
|
||||
extraDiagnostics = {
|
||||
enable = mkEnableOption "extra Typescript XML (TSX) diagnostics" // {default = config.vim.languages.enableExtraDiagnostics;};
|
||||
|
||||
types = diagnostics {
|
||||
langDesc = "Typescript XML (TSX)";
|
||||
inherit diagnosticsProviders;
|
||||
inherit defaultDiagnosticsProvider;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
(mkIf cfg.treesitter.enable {
|
||||
vim.treesitter = {
|
||||
enable = true;
|
||||
grammars = [cfg.treesitter.package];
|
||||
};
|
||||
})
|
||||
|
||||
(mkIf cfg.lsp.enable {
|
||||
vim.lsp = {
|
||||
presets = genAttrs cfg.lsp.servers (_: {enable = true;});
|
||||
servers = genAttrs cfg.lsp.servers (_: {
|
||||
filetypes = [
|
||||
"typescriptreact"
|
||||
"javascriptreact"
|
||||
];
|
||||
});
|
||||
};
|
||||
})
|
||||
|
||||
(mkIf cfg.format.enable {
|
||||
vim.formatter.conform-nvim = {
|
||||
enable = true;
|
||||
setupOpts = {
|
||||
formatters_by_ft = {
|
||||
typescriptreact = cfg.format.type;
|
||||
javascriptreact = cfg.format.type;
|
||||
};
|
||||
formatters =
|
||||
mapListToAttrs (name: {
|
||||
inherit name;
|
||||
value = formats.${name};
|
||||
})
|
||||
cfg.format.type;
|
||||
};
|
||||
};
|
||||
})
|
||||
|
||||
(mkIf cfg.extraDiagnostics.enable {
|
||||
vim.diagnostics.nvim-lint = {
|
||||
enable = true;
|
||||
linters_by_ft = {
|
||||
typescriptreact = cfg.extraDiagnostics.types;
|
||||
javascriptreact = cfg.extraDiagnostics.types;
|
||||
};
|
||||
linters =
|
||||
mkMerge (map (name: {${name} = diagnosticsProviders.${name}.config;})
|
||||
cfg.extraDiagnostics.types);
|
||||
};
|
||||
})
|
||||
]);
|
||||
}
|
||||
|
|
@ -18,7 +18,7 @@
|
|||
cfg = config.vim.languages.typescript;
|
||||
|
||||
defaultServers = ["typescript-language-server"];
|
||||
servers = ["typescript-language-server" "deno" "typescript-go" "angular-language-server"];
|
||||
servers = ["typescript-language-server" "deno" "typescript-go" "angular-language-server" "emmet-ls"];
|
||||
|
||||
# TODO: specify packages
|
||||
defaultFormat = ["prettier"];
|
||||
|
|
@ -85,7 +85,6 @@ in {
|
|||
defaultText = literalExpression "config.vim.languages.enableTreesitter";
|
||||
};
|
||||
tsPackage = mkGrammarOption pkgs "typescript";
|
||||
tsxPackage = mkGrammarOption pkgs "tsx";
|
||||
jsPackage = mkGrammarOption pkgs "javascript";
|
||||
};
|
||||
|
||||
|
|
@ -162,7 +161,6 @@ in {
|
|||
vim.treesitter.enable = true;
|
||||
vim.treesitter.grammars = [
|
||||
cfg.treesitter.tsPackage
|
||||
cfg.treesitter.tsxPackage
|
||||
cfg.treesitter.jsPackage
|
||||
];
|
||||
})
|
||||
|
|
@ -173,11 +171,6 @@ in {
|
|||
servers = genAttrs cfg.lsp.servers (_: {
|
||||
filetypes = [
|
||||
"typescript"
|
||||
# TODO: move to a React module
|
||||
"typescriptreact"
|
||||
"typescript.tsx"
|
||||
"javascriptreact"
|
||||
"javascript.jsx"
|
||||
# TODO: move to a JavaScript module
|
||||
"javascript"
|
||||
];
|
||||
|
|
@ -192,8 +185,6 @@ in {
|
|||
formatters_by_ft = {
|
||||
typescript = cfg.format.type;
|
||||
javascript = cfg.format.type;
|
||||
# .tsx/.jsx files
|
||||
typescriptreact = cfg.format.type;
|
||||
};
|
||||
formatters =
|
||||
mapListToAttrs (name: {
|
||||
|
|
@ -209,8 +200,6 @@ in {
|
|||
vim.diagnostics.nvim-lint = {
|
||||
enable = true;
|
||||
linters_by_ft.typescript = cfg.extraDiagnostics.types;
|
||||
linters_by_ft.typescriptreact = cfg.extraDiagnostics.types;
|
||||
|
||||
linters =
|
||||
mkMerge (map (name: {${name} = diagnosticsProviders.${name}.config;})
|
||||
cfg.extraDiagnostics.types);
|
||||
|
|
|
|||
65
modules/plugins/languages/vhdl.nix
Normal file
65
modules/plugins/languages/vhdl.nix
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (builtins) attrNames;
|
||||
inherit (lib.options) mkOption mkEnableOption literalExpression;
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.types) enum bool listOf;
|
||||
inherit (lib) genAttrs;
|
||||
inherit (lib.nvim.types) mkGrammarOption;
|
||||
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||
|
||||
cfg = config.vim.languages.vhdl;
|
||||
|
||||
defaultServers = ["vhdl-ls"];
|
||||
servers = ["vhdl-ls"];
|
||||
in {
|
||||
options.vim.languages.vhdl = {
|
||||
enable = mkEnableOption "VHDL language support";
|
||||
|
||||
treesitter = {
|
||||
enable =
|
||||
mkEnableOption "VHDL treesitter"
|
||||
// {
|
||||
default = config.vim.languages.enableTreesitter;
|
||||
defaultText = literalExpression "config.vim.languages.enableTreesitter";
|
||||
};
|
||||
package = mkGrammarOption pkgs "vhdl";
|
||||
};
|
||||
|
||||
lsp = {
|
||||
enable =
|
||||
mkEnableOption "VHDL LSP support"
|
||||
// {
|
||||
default = config.vim.lsp.enable;
|
||||
defaultText = literalExpression "config.vim.lsp.enable";
|
||||
};
|
||||
servers = mkOption {
|
||||
type = listOf (enum servers);
|
||||
default = defaultServers;
|
||||
description = "VHDL LSP server to use";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
(mkIf cfg.treesitter.enable {
|
||||
vim.treesitter = {
|
||||
enable = true;
|
||||
grammars = [cfg.treesitter.package];
|
||||
};
|
||||
})
|
||||
|
||||
(mkIf cfg.lsp.enable {
|
||||
vim.lsp = {
|
||||
presets = genAttrs cfg.lsp.servers (_: {enable = true;});
|
||||
servers = genAttrs cfg.lsp.servers (_: {
|
||||
filetypes = ["vhdl"];
|
||||
});
|
||||
};
|
||||
})
|
||||
]);
|
||||
}
|
||||
|
|
@ -16,7 +16,7 @@
|
|||
cfg = config.vim.languages.vue;
|
||||
|
||||
defaultServers = ["vue-language-server" "vtsls"];
|
||||
servers = ["vue-language-server" "vtsls" "typescript-language-server"];
|
||||
servers = ["vue-language-server" "vtsls" "typescript-language-server" "emmet-ls"];
|
||||
|
||||
defaultFormat = ["biome" "biome-check" "biome-organize-imports"];
|
||||
formats = {
|
||||
|
|
|
|||
|
|
@ -13,9 +13,11 @@
|
|||
./cue.nix
|
||||
./dart.nix
|
||||
./deno.nix
|
||||
./docker-language-server.nix
|
||||
./elixir-ls.nix
|
||||
./elm-language-server.nix
|
||||
./emmet-ls.nix
|
||||
./fish-lsp.nix
|
||||
./fsautocomplete.nix
|
||||
./gleam.nix
|
||||
./glsl_analyzer.nix
|
||||
|
|
@ -33,6 +35,7 @@
|
|||
./lua-language-server.nix
|
||||
./markdown-oxide.nix
|
||||
./marksman.nix
|
||||
./millet.nix
|
||||
./neocmakelsp.nix
|
||||
./nil.nix
|
||||
./nimlsp.nix
|
||||
|
|
@ -70,6 +73,7 @@
|
|||
./typescript-go.nix
|
||||
./typescript-language-server.nix
|
||||
./vala-language-server.nix
|
||||
./vhdl-ls.nix
|
||||
./vscode-css-language-server.nix
|
||||
./vscode-json-language-server.nix
|
||||
./vtsls.nix
|
||||
|
|
|
|||
33
modules/plugins/lsp/presets/docker-language-server.nix
Normal file
33
modules/plugins/lsp/presets/docker-language-server.nix
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.meta) getExe;
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.nvim.types) mkLspPresetEnableOption;
|
||||
|
||||
cfg = config.vim.lsp.presets.docker-language-server;
|
||||
in {
|
||||
options.vim.lsp.presets.docker-language-server = {
|
||||
enable = mkLspPresetEnableOption "docker-language-server" "Docker" [];
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
vim.lsp.servers.docker-language-server = {
|
||||
enable = true;
|
||||
cmd = [(getExe pkgs.docker-language-server) "start" "--stdio"];
|
||||
root_markers = [
|
||||
".git"
|
||||
"Dockerfile"
|
||||
"docker-compose.yaml"
|
||||
"docker-compose.yml"
|
||||
"compose.yaml"
|
||||
"compose.yml"
|
||||
"docker-bake.json"
|
||||
"docker-bake.hcl"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
24
modules/plugins/lsp/presets/fish-lsp.nix
Normal file
24
modules/plugins/lsp/presets/fish-lsp.nix
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.meta) getExe;
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.nvim.types) mkLspPresetEnableOption;
|
||||
|
||||
cfg = config.vim.lsp.presets.fish-lsp;
|
||||
in {
|
||||
options.vim.lsp.presets.fish-lsp = {
|
||||
enable = mkLspPresetEnableOption "fish-lsp" "Fish" [];
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
vim.lsp.servers.fish-lsp = {
|
||||
enable = true;
|
||||
cmd = [(getExe pkgs.fish-lsp) "start"];
|
||||
root_markers = ["config.fish" ".git"];
|
||||
};
|
||||
};
|
||||
}
|
||||
24
modules/plugins/lsp/presets/millet.nix
Normal file
24
modules/plugins/lsp/presets/millet.nix
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.meta) getExe;
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.nvim.types) mkLspPresetEnableOption;
|
||||
|
||||
cfg = config.vim.lsp.presets.millet;
|
||||
in {
|
||||
options.vim.lsp.presets.millet = {
|
||||
enable = mkLspPresetEnableOption "millet" "Millet Standard ML" [];
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
vim.lsp.servers.millet = {
|
||||
enable = true;
|
||||
cmd = [(getExe pkgs.millet)];
|
||||
root_markers = [".git" "millet.toml"];
|
||||
};
|
||||
};
|
||||
}
|
||||
24
modules/plugins/lsp/presets/vhdl-ls.nix
Normal file
24
modules/plugins/lsp/presets/vhdl-ls.nix
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.meta) getExe;
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.nvim.types) mkLspPresetEnableOption;
|
||||
|
||||
cfg = config.vim.lsp.presets.vhdl-ls;
|
||||
in {
|
||||
options.vim.lsp.presets.vhdl-ls = {
|
||||
enable = mkLspPresetEnableOption "vhdl-ls" "VHDL" [];
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
vim.lsp.servers.vhdl-ls = {
|
||||
enable = true;
|
||||
cmd = [(getExe pkgs.vhdl-ls)];
|
||||
root_markers = [".git" "vhdl_ls.toml"];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -41,8 +41,12 @@ in {
|
|||
'';
|
||||
description = ''
|
||||
List of treesitter grammars to install. For grammars to be installed properly,
|
||||
you must use grammars from `pkgs.vimPlugins.nvim-treesitter.parsers` or `pkgs.vimPlugins.nvim-treesitter.grammarPlugins`.
|
||||
You can use `pkgs.vimPlugins.nvim-treesitter.allGrammars` to install all grammars.
|
||||
you must use grammars from one of those:
|
||||
- `pkgs.vimPlugins.nvim-treesitter.parsers`
|
||||
- `pkgs.vimPlugins.nvim-treesitter.grammarPlugins`
|
||||
- `pkgs.tree-sitter-grammars` (mostly untested)
|
||||
|
||||
You can use `pkgs.vimPlugins.nvim-treesitter.allGrammars` to install all grammars shipped with `nvim-treesitter`.
|
||||
|
||||
For languages already supported by nvf, you may use
|
||||
{option}`vim.language.<lang>.treesitter` options, which will automatically add
|
||||
|
|
|
|||
|
|
@ -25,69 +25,86 @@ in {
|
|||
setupOpts = mkPluginSetupOption "Fidget" {
|
||||
progress = {
|
||||
poll_rate = mkOption {
|
||||
description = "How frequently to poll for LSP progress messages";
|
||||
type = int;
|
||||
default = 0;
|
||||
description = "How frequently to poll for LSP progress messages";
|
||||
};
|
||||
suppress_on_insert = mkOption {
|
||||
description = "Suppress new messages when in insert mode";
|
||||
type = bool;
|
||||
default = false;
|
||||
description = "Suppress new messages when in insert mode";
|
||||
};
|
||||
ignore_done_already = mkOption {
|
||||
description = "Ignore new tasks that are already done";
|
||||
type = bool;
|
||||
default = false;
|
||||
description = "Ignore new tasks that are already done";
|
||||
};
|
||||
ignore_empty_message = mkOption {
|
||||
description = "Ignore new tasks with empty messages";
|
||||
type = bool;
|
||||
default = false;
|
||||
description = "Ignore new tasks with empty messages";
|
||||
};
|
||||
notification_group = mkOption {
|
||||
description = "How to get a progress message's notification group key";
|
||||
type = luaInline;
|
||||
default = mkLuaInline ''
|
||||
function(msg)
|
||||
return msg.lsp_client.name
|
||||
end
|
||||
'';
|
||||
description = "How to get a progress message's notification group key";
|
||||
};
|
||||
clear_on_detach = mkOption {
|
||||
type = nullOr luaInline;
|
||||
default = mkLuaInline ''
|
||||
function(client_id)
|
||||
local client = vim.lsp.get_client_by_id(client_id)
|
||||
return client and client.name or nil
|
||||
end
|
||||
'';
|
||||
defaultText = literalExpression ''
|
||||
default = mkLuaInline '''
|
||||
function(client_id)
|
||||
local client = vim.lsp.get_client_by_id(client_id)
|
||||
return client and client.name or nil
|
||||
end
|
||||
''';
|
||||
'';
|
||||
description = "Clear notification group when LSP server detaches";
|
||||
};
|
||||
ignore = mkOption {
|
||||
description = "Ignore LSP servers by name";
|
||||
type = listOf str;
|
||||
default = [];
|
||||
description = "Ignore LSP servers by name";
|
||||
};
|
||||
|
||||
display = {
|
||||
render_limit = mkOption {
|
||||
description = "Maximum number of messages to render";
|
||||
type = int;
|
||||
default = 16;
|
||||
description = "Maximum number of messages to render";
|
||||
};
|
||||
done_ttl = mkOption {
|
||||
description = "How long a message should persist when complete";
|
||||
type = int;
|
||||
default = 3;
|
||||
description = "How long a message should persist when complete";
|
||||
};
|
||||
done_icon = mkOption {
|
||||
description = "Icon shown when LSP progress tasks are completed";
|
||||
type = str;
|
||||
default = "✓";
|
||||
description = "Icon shown when LSP progress tasks are completed";
|
||||
};
|
||||
done_style = mkOption {
|
||||
description = "Highlight group for completed LSP tasks";
|
||||
type = str;
|
||||
default = "Constant";
|
||||
description = "Highlight group for completed LSP tasks";
|
||||
};
|
||||
progress_ttl = mkOption {
|
||||
description = "How long a message should persist when in progress";
|
||||
type = int;
|
||||
default = 99999;
|
||||
description = "How long a message should persist when in progress";
|
||||
};
|
||||
progress_icon = {
|
||||
pattern = mkOption {
|
||||
description = "Pattern shown when LSP progress tasks are in progress";
|
||||
type = enum [
|
||||
"dots"
|
||||
"dots_negative"
|
||||
|
|
@ -124,60 +141,208 @@ in {
|
|||
"meter"
|
||||
];
|
||||
default = "dots";
|
||||
description = "Pattern shown when LSP progress tasks are in progress";
|
||||
};
|
||||
period = mkOption {
|
||||
description = "Period of the pattern";
|
||||
type = int;
|
||||
default = 1;
|
||||
description = "Period of the pattern";
|
||||
};
|
||||
};
|
||||
progress_style = mkOption {
|
||||
description = "Highlight group for in-progress LSP tasks";
|
||||
type = str;
|
||||
default = "WarningMsg";
|
||||
description = "Highlight group for in-progress LSP tasks";
|
||||
};
|
||||
group_style = mkOption {
|
||||
description = "Highlight group for group name (LSP server name)";
|
||||
type = str;
|
||||
default = "Title";
|
||||
description = "Highlight group for group name (LSP server name)";
|
||||
};
|
||||
icon_style = mkOption {
|
||||
description = "Highlight group for group icons";
|
||||
type = str;
|
||||
default = "Question";
|
||||
description = "Highlight group for group icons";
|
||||
};
|
||||
priority = mkOption {
|
||||
description = "Priority of the progress notification";
|
||||
type = int;
|
||||
default = 30;
|
||||
description = "Priority of the progress notification";
|
||||
};
|
||||
skip_history = mkOption {
|
||||
description = "Skip adding messages to history";
|
||||
type = bool;
|
||||
default = true;
|
||||
description = "Skip adding messages to history";
|
||||
};
|
||||
format_message = mkOption {
|
||||
description = "How to format a progress message";
|
||||
type = luaInline;
|
||||
default = mkLuaInline ''
|
||||
require("fidget.progress.display").default_format_message
|
||||
'';
|
||||
description = "How to format a progress message";
|
||||
};
|
||||
format_annote = mkOption {
|
||||
description = "How to format a progress annotation";
|
||||
type = luaInline;
|
||||
default = mkLuaInline ''
|
||||
function(msg) return msg.title end
|
||||
'';
|
||||
description = "How to format a progress annotation";
|
||||
};
|
||||
format_group_name = mkOption {
|
||||
description = "How to format a progress notification group's name";
|
||||
type = luaInline;
|
||||
default = mkLuaInline ''
|
||||
function(group) return tostring(group) end
|
||||
'';
|
||||
description = "How to format a progress notification group's name";
|
||||
};
|
||||
overrides = mkOption {
|
||||
type = attrsOf (submodule {
|
||||
options = {
|
||||
name = mkOption {
|
||||
type = nullOr (oneOf [str luaInline]);
|
||||
default = null;
|
||||
description = ''
|
||||
Name of the group, displayed in the notification window.
|
||||
Can be a string or a function that returns a string.
|
||||
|
||||
If a function, it is invoked every render cycle with the items
|
||||
list, useful for rendering animations and other dynamic content.
|
||||
|
||||
::: {.note}
|
||||
If you're looking for detailed information into the function
|
||||
signature, you can refer to the fidget API documentation available
|
||||
[here](https://github.com/j-hui/fidget.nvim/blob/1ba38e4cbb24683973e00c2e36f53ae64da38ef5/doc/fidget-api.txt#L70-L77)
|
||||
:::
|
||||
'';
|
||||
};
|
||||
icon = mkOption {
|
||||
type = nullOr (oneOf [str luaInline]);
|
||||
default = null;
|
||||
description = ''
|
||||
Icon of the group, displayed in the notification window.
|
||||
Can be a string or a function that returns a string.
|
||||
|
||||
If a function, it is invoked every render cycle with the items
|
||||
list, useful for rendering animations and other dynamic content.
|
||||
|
||||
::: {.note}
|
||||
If you're looking for detailed information into the function
|
||||
signature, you can refer to the fidget API documentation available
|
||||
[here](https://github.com/j-hui/fidget.nvim/blob/1ba38e4cbb24683973e00c2e36f53ae64da38ef5/doc/fidget-api.txt#L70-L77)
|
||||
:::
|
||||
'';
|
||||
};
|
||||
icon_on_left = mkOption {
|
||||
type = nullOr bool;
|
||||
default = null;
|
||||
description = "If true, icon is rendered on the left instead of right";
|
||||
};
|
||||
annote_separator = mkOption {
|
||||
type = nullOr str;
|
||||
default = " ";
|
||||
description = "Separator between message from annote";
|
||||
};
|
||||
ttl = mkOption {
|
||||
type = nullOr int;
|
||||
default = 5;
|
||||
description = "How long a notification item should exist";
|
||||
};
|
||||
render_limit = mkOption {
|
||||
type = nullOr int;
|
||||
default = null;
|
||||
description = "How many notification items to show at once";
|
||||
};
|
||||
group_style = mkOption {
|
||||
type = nullOr str;
|
||||
default = "Title";
|
||||
description = "Style used to highlight group name";
|
||||
};
|
||||
icon_style = mkOption {
|
||||
type = nullOr str;
|
||||
default = null;
|
||||
description = "Style used to highlight icon, if null, use group_style";
|
||||
};
|
||||
annote_style = mkOption {
|
||||
type = nullOr str;
|
||||
default = "Question";
|
||||
description = "Default style used to highlight item annotes";
|
||||
};
|
||||
debug_style = mkOption {
|
||||
type = nullOr str;
|
||||
default = null;
|
||||
description = "Style used to highlight debug item annotes";
|
||||
};
|
||||
info_style = mkOption {
|
||||
type = nullOr str;
|
||||
default = null;
|
||||
description = "Style used to highlight info item annotes";
|
||||
};
|
||||
warn_style = mkOption {
|
||||
type = nullOr str;
|
||||
default = null;
|
||||
description = "Style used to highlight warn item annotes";
|
||||
};
|
||||
error_style = mkOption {
|
||||
type = nullOr str;
|
||||
default = null;
|
||||
description = "Style used to highlight error item annotes";
|
||||
};
|
||||
debug_annote = mkOption {
|
||||
type = nullOr str;
|
||||
default = null;
|
||||
description = "Default annotation for debug items";
|
||||
};
|
||||
info_annote = mkOption {
|
||||
type = nullOr str;
|
||||
default = null;
|
||||
description = "Default annotation for info items";
|
||||
};
|
||||
warn_annote = mkOption {
|
||||
type = nullOr str;
|
||||
default = null;
|
||||
description = "Default annotation for warn items";
|
||||
};
|
||||
error_annote = mkOption {
|
||||
type = nullOr str;
|
||||
default = null;
|
||||
description = "Default annotation for error items";
|
||||
};
|
||||
priority = mkOption {
|
||||
type = nullOr int;
|
||||
default = 50;
|
||||
description = "Order in which group should be displayed";
|
||||
};
|
||||
skip_history = mkOption {
|
||||
type = nullOr bool;
|
||||
default = null;
|
||||
description = "Whether messages should be preserved in history";
|
||||
};
|
||||
update_hook = mkOption {
|
||||
type = nullOr (oneOf [bool luaInline]);
|
||||
default = false;
|
||||
description = ''
|
||||
Called when an item is updated.
|
||||
|
||||
If false, no action is taken.
|
||||
If a function, it is invoked with the item being updated.
|
||||
|
||||
::: {.note}
|
||||
If you're looking for detailed information into the function
|
||||
signature, you can refer to the fidget API documentation available
|
||||
[here](https://github.com/j-hui/fidget.nvim/blob/1ba38e4cbb24683973e00c2e36f53ae64da38ef5/doc/fidget-api.txt#L114)
|
||||
:::
|
||||
'';
|
||||
};
|
||||
};
|
||||
});
|
||||
default = {};
|
||||
example = literalExpression ''
|
||||
{
|
||||
rust_analyzer = {
|
||||
name = "Rust Analyzer";
|
||||
};
|
||||
}
|
||||
'';
|
||||
description = ''
|
||||
Overrides the default configuration for a notification group defined
|
||||
in {option}`vim.visuals.fidget-nvim.setupOpts.notification.configs`.
|
||||
|
|
@ -208,199 +373,51 @@ in {
|
|||
}
|
||||
```
|
||||
'';
|
||||
type = attrsOf (submodule {
|
||||
options = {
|
||||
name = mkOption {
|
||||
description = ''
|
||||
Name of the group, displayed in the notification window.
|
||||
Can be a string or a function that returns a string.
|
||||
|
||||
If a function, it is invoked every render cycle with the items
|
||||
list, useful for rendering animations and other dynamic content.
|
||||
|
||||
::: {.note}
|
||||
If you're looking for detailed information into the function
|
||||
signature, you can refer to the fidget API documentation available
|
||||
[here](https://github.com/j-hui/fidget.nvim/blob/1ba38e4cbb24683973e00c2e36f53ae64da38ef5/doc/fidget-api.txt#L70-L77)
|
||||
:::
|
||||
'';
|
||||
type = nullOr (oneOf [str luaInline]);
|
||||
default = null;
|
||||
};
|
||||
icon = mkOption {
|
||||
description = ''
|
||||
Icon of the group, displayed in the notification window.
|
||||
Can be a string or a function that returns a string.
|
||||
|
||||
If a function, it is invoked every render cycle with the items
|
||||
list, useful for rendering animations and other dynamic content.
|
||||
|
||||
::: {.note}
|
||||
If you're looking for detailed information into the function
|
||||
signature, you can refer to the fidget API documentation available
|
||||
[here](https://github.com/j-hui/fidget.nvim/blob/1ba38e4cbb24683973e00c2e36f53ae64da38ef5/doc/fidget-api.txt#L70-L77)
|
||||
:::
|
||||
'';
|
||||
type = nullOr (oneOf [str luaInline]);
|
||||
default = null;
|
||||
};
|
||||
icon_on_left = mkOption {
|
||||
description = "If true, icon is rendered on the left instead of right";
|
||||
type = nullOr bool;
|
||||
default = null;
|
||||
};
|
||||
annote_separator = mkOption {
|
||||
description = "Separator between message from annote";
|
||||
type = nullOr str;
|
||||
default = " ";
|
||||
};
|
||||
ttl = mkOption {
|
||||
description = "How long a notification item should exist";
|
||||
type = nullOr int;
|
||||
default = 5;
|
||||
};
|
||||
render_limit = mkOption {
|
||||
description = "How many notification items to show at once";
|
||||
type = nullOr int;
|
||||
default = null;
|
||||
};
|
||||
group_style = mkOption {
|
||||
description = "Style used to highlight group name";
|
||||
type = nullOr str;
|
||||
default = "Title";
|
||||
};
|
||||
icon_style = mkOption {
|
||||
description = "Style used to highlight icon, if null, use group_style";
|
||||
type = nullOr str;
|
||||
default = null;
|
||||
};
|
||||
annote_style = mkOption {
|
||||
description = "Default style used to highlight item annotes";
|
||||
type = nullOr str;
|
||||
default = "Question";
|
||||
};
|
||||
debug_style = mkOption {
|
||||
description = "Style used to highlight debug item annotes";
|
||||
type = nullOr str;
|
||||
default = null;
|
||||
};
|
||||
info_style = mkOption {
|
||||
description = "Style used to highlight info item annotes";
|
||||
type = nullOr str;
|
||||
default = null;
|
||||
};
|
||||
warn_style = mkOption {
|
||||
description = "Style used to highlight warn item annotes";
|
||||
type = nullOr str;
|
||||
default = null;
|
||||
};
|
||||
error_style = mkOption {
|
||||
description = "Style used to highlight error item annotes";
|
||||
type = nullOr str;
|
||||
default = null;
|
||||
};
|
||||
debug_annote = mkOption {
|
||||
description = "Default annotation for debug items";
|
||||
type = nullOr str;
|
||||
default = null;
|
||||
};
|
||||
info_annote = mkOption {
|
||||
description = "Default annotation for info items";
|
||||
type = nullOr str;
|
||||
default = null;
|
||||
};
|
||||
warn_annote = mkOption {
|
||||
description = "Default annotation for warn items";
|
||||
type = nullOr str;
|
||||
default = null;
|
||||
};
|
||||
error_annote = mkOption {
|
||||
description = "Default annotation for error items";
|
||||
type = nullOr str;
|
||||
default = null;
|
||||
};
|
||||
priority = mkOption {
|
||||
description = "Order in which group should be displayed";
|
||||
type = nullOr int;
|
||||
default = 50;
|
||||
};
|
||||
skip_history = mkOption {
|
||||
description = "Whether messages should be preserved in history";
|
||||
type = nullOr bool;
|
||||
default = null;
|
||||
};
|
||||
update_hook = mkOption {
|
||||
description = ''
|
||||
Called when an item is updated.
|
||||
|
||||
If false, no action is taken.
|
||||
If a function, it is invoked with the item being updated.
|
||||
|
||||
::: {.note}
|
||||
If you're looking for detailed information into the function
|
||||
signature, you can refer to the fidget API documentation available
|
||||
[here](https://github.com/j-hui/fidget.nvim/blob/1ba38e4cbb24683973e00c2e36f53ae64da38ef5/doc/fidget-api.txt#L114)
|
||||
:::
|
||||
'';
|
||||
type = nullOr (oneOf [bool luaInline]);
|
||||
default = false;
|
||||
};
|
||||
};
|
||||
});
|
||||
default = {};
|
||||
example = literalExpression ''
|
||||
{
|
||||
rust_analyzer = {
|
||||
name = "Rust Analyzer";
|
||||
};
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
lsp = {
|
||||
progress_ringbuf_size = mkOption {
|
||||
description = "Nvim's LSP client ring buffer size";
|
||||
type = int;
|
||||
default = 100;
|
||||
description = "Nvim's LSP client ring buffer size";
|
||||
};
|
||||
log_handler = mkOption {
|
||||
description = "Log `$/progress` handler invocations";
|
||||
type = bool;
|
||||
default = false;
|
||||
description = "Log `$/progress` handler invocations";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
notification = {
|
||||
poll_rate = mkOption {
|
||||
description = "How frequently to update and render notifications";
|
||||
type = int;
|
||||
default = 10;
|
||||
description = "How frequently to update and render notifications";
|
||||
};
|
||||
filter = mkOption {
|
||||
description = "Minimum notifications level";
|
||||
type = enum ["debug" "info" "warn" "error"];
|
||||
default = "info";
|
||||
description = "Minimum notifications level";
|
||||
apply = filter: mkLuaInline "vim.log.levels.${toUpper filter}";
|
||||
};
|
||||
history_size = mkOption {
|
||||
description = "Number of removed messages to retain in history";
|
||||
type = int;
|
||||
default = 128;
|
||||
description = "Number of removed messages to retain in history";
|
||||
};
|
||||
override_vim_notify = mkOption {
|
||||
description = "Automatically override vim.notify() with Fidget";
|
||||
type = bool;
|
||||
default = false;
|
||||
description = "Automatically override vim.notify() with Fidget";
|
||||
};
|
||||
configs = mkOption {
|
||||
description = "How to configure notification groups when instantiated";
|
||||
type = attrsOf luaInline;
|
||||
default = {default = mkLuaInline "require('fidget.notification').default_config";};
|
||||
description = "How to configure notification groups when instantiated";
|
||||
};
|
||||
redirect = mkOption {
|
||||
description = "Conditionally redirect notifications to another backend";
|
||||
type = luaInline;
|
||||
default = mkLuaInline ''
|
||||
function(msg, level, opts)
|
||||
|
|
@ -409,142 +426,206 @@ in {
|
|||
end
|
||||
end
|
||||
'';
|
||||
description = "Conditionally redirect notifications to another backend";
|
||||
};
|
||||
|
||||
view = {
|
||||
stack_upwards = mkOption {
|
||||
description = "Display notification items from bottom to top";
|
||||
type = bool;
|
||||
default = true;
|
||||
description = "Display notification items from bottom to top";
|
||||
};
|
||||
align = mkOption {
|
||||
type = enum ["message" "annote"];
|
||||
default = "message";
|
||||
description = "Indent messages longer than a single line";
|
||||
};
|
||||
reflow = mkOption {
|
||||
type = enum ["hard" "hyphenate" "ellipsis" "false"];
|
||||
default = "false";
|
||||
description = ''
|
||||
Reflow (wrap) messages wider than notification window
|
||||
|
||||
The various options determine how wrapping is handled mid-word.
|
||||
'';
|
||||
};
|
||||
icon_separator = mkOption {
|
||||
description = "Separator between group name and icon";
|
||||
type = str;
|
||||
default = " ";
|
||||
description = "Separator between group name and icon";
|
||||
};
|
||||
group_separator = mkOption {
|
||||
description = "Separator between notification groups";
|
||||
type = str;
|
||||
default = "---";
|
||||
description = "Separator between notification groups";
|
||||
};
|
||||
group_separator_hl = mkOption {
|
||||
description = "Highlight group used for group separator";
|
||||
type = str;
|
||||
default = "Comment";
|
||||
description = "Highlight group used for group separator";
|
||||
};
|
||||
line_margin = mkOption {
|
||||
type = int;
|
||||
default = 1;
|
||||
description = ''
|
||||
Spaces to pad both sides of each non-empty line
|
||||
|
||||
Useful for adding a visual gap between notification text
|
||||
and any buffer it may overlap with.
|
||||
'';
|
||||
};
|
||||
render_message = mkOption {
|
||||
description = "How to render notification messages";
|
||||
type = luaInline;
|
||||
default = mkLuaInline ''
|
||||
function(msg, cnt)
|
||||
return cnt == 1 and msg or string.format("(%dx) %s", cnt, msg)
|
||||
end
|
||||
'';
|
||||
description = "How to render notification messages";
|
||||
};
|
||||
};
|
||||
|
||||
window = {
|
||||
normal_hl = mkOption {
|
||||
description = "Base highlight group in the notification window";
|
||||
type = str;
|
||||
default = "Comment";
|
||||
description = "Base highlight group in the notification window";
|
||||
};
|
||||
winblend = mkOption {
|
||||
description = "Background color opacity in the notification window";
|
||||
type = int;
|
||||
default = 100;
|
||||
description = "Background color opacity in the notification window";
|
||||
};
|
||||
border = mkOption {
|
||||
description = "Border style of the notification window";
|
||||
type = borderType;
|
||||
default =
|
||||
if config.vim.ui.borders.enable
|
||||
then config.vim.ui.borders.globalStyle
|
||||
else "none";
|
||||
description = "Border style of the notification window";
|
||||
};
|
||||
border_hl = mkOption {
|
||||
type = str;
|
||||
default = "";
|
||||
description = ''
|
||||
Highlight group for notification window border
|
||||
|
||||
Set to empty string to keep your theme's default `FloatBorder` highlight.
|
||||
'';
|
||||
};
|
||||
zindex = mkOption {
|
||||
description = "Stacking priority of the notification window";
|
||||
type = int;
|
||||
default = 45;
|
||||
description = "Stacking priority of the notification window";
|
||||
};
|
||||
max_width = mkOption {
|
||||
description = "Maximum width of the notification window";
|
||||
type = int;
|
||||
default = 0;
|
||||
description = "Maximum width of the notification window";
|
||||
};
|
||||
max_height = mkOption {
|
||||
description = "Maximum height of the notification window";
|
||||
type = int;
|
||||
default = 0;
|
||||
description = "Maximum height of the notification window";
|
||||
};
|
||||
x_padding = mkOption {
|
||||
description = "Padding from right edge of window boundary";
|
||||
type = int;
|
||||
default = 1;
|
||||
description = "Padding from right edge of window boundary";
|
||||
};
|
||||
y_padding = mkOption {
|
||||
description = "Padding from bottom edge of window boundary";
|
||||
type = int;
|
||||
default = 0;
|
||||
description = "Padding from bottom edge of window boundary";
|
||||
};
|
||||
align = mkOption {
|
||||
description = "How to align the notification window";
|
||||
type = enum ["top" "bottom"];
|
||||
default = "bottom";
|
||||
description = "How to align the notification window";
|
||||
};
|
||||
relative = mkOption {
|
||||
description = "What the notification window position is relative to";
|
||||
type = enum ["editor" "win"];
|
||||
default = "editor";
|
||||
description = "What the notification window position is relative to";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
integration = {
|
||||
nvim-tree = {
|
||||
enable = mkOption {
|
||||
description = "Integrate with nvim-tree/nvim-tree.lua (if enabled)";
|
||||
type = bool;
|
||||
default =
|
||||
if config.vim.filetree.nvimTree.enable
|
||||
then true
|
||||
else false;
|
||||
tabstop = mkOption {
|
||||
type = int;
|
||||
default = 8;
|
||||
description = "Width of each tab character in the notification window";
|
||||
};
|
||||
};
|
||||
xcodebuild-nvim = {
|
||||
enable = mkOption {
|
||||
description = "Integrate with wojciech-kulik/xcodebuild.nvim (if enabled)";
|
||||
type = bool;
|
||||
default = true;
|
||||
avoid = mkOption {
|
||||
type = listOf str;
|
||||
default = [];
|
||||
description = "Filetypes the notification window should avoid";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
logger = {
|
||||
level = mkOption {
|
||||
description = "Minimum logging level";
|
||||
type = enum ["debug" "error" "info" "trace" "warn" "off"];
|
||||
default = "warn";
|
||||
description = "Minimum logging level";
|
||||
apply = logLevel: mkLuaInline "vim.log.levels.${toUpper logLevel}";
|
||||
};
|
||||
max_size = mkOption {
|
||||
description = "Maximum log file size, in KB";
|
||||
type = int;
|
||||
default = 10000;
|
||||
description = "Maximum log file size, in KB";
|
||||
};
|
||||
float_precision = mkOption {
|
||||
description = "Limit the number of decimals displayed for floats";
|
||||
type = float;
|
||||
default = 0.01;
|
||||
description = "Limit the number of decimals displayed for floats";
|
||||
};
|
||||
path = mkOption {
|
||||
description = "Where Fidget writes its logs to";
|
||||
type = luaInline;
|
||||
default = mkLuaInline ''
|
||||
string.format("%s/fidget.nvim.log", vim.fn.stdpath("cache"))
|
||||
'';
|
||||
description = "Where Fidget writes its logs to";
|
||||
};
|
||||
};
|
||||
|
||||
# removed, see below
|
||||
integration = {
|
||||
nvim-tree.enable = mkOption {
|
||||
default = null;
|
||||
visible = false;
|
||||
};
|
||||
xcodebuild-nvim.enable = mkOption {
|
||||
default = null;
|
||||
visible = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# this can't be done better, I tried
|
||||
# mostly mostly caused by the deprecated options being inside a submodule
|
||||
# try improving this if you don't care about your sanity
|
||||
# ~ poz
|
||||
config = {
|
||||
assertions = let
|
||||
inherit (config.vim.visuals.fidget-nvim.setupOpts) integration;
|
||||
in [
|
||||
{
|
||||
assertion = integration.nvim-tree.enable == null;
|
||||
message = ''
|
||||
Option `vim.visuals.fidget-nvim.setupOpts.integration.nvim-tree.enable`
|
||||
has been deprecated upstream. Use
|
||||
`vim.visuals.fidget-nvim.setupOpts.notification.window.avoid = ["NvimTree"]` instead.
|
||||
This is already set if `vim.filetree.nvimTree.enable == true`.
|
||||
'';
|
||||
}
|
||||
{
|
||||
assertion = integration.xcodebuild-nvim.enable == null;
|
||||
message = ''
|
||||
Option `vim.visuals.fidget-nvim.setupOpts.integration.xcodebuild-nvim.enable`
|
||||
has been deprecated upstream. Use
|
||||
`vim.visuals.fidget-nvim.setupOpts.notification.window.avoid = ["TestExplorer"]` instead.
|
||||
'';
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue