Compare commits

..

No commits in common. "09bd743ad6fed1228fc6bcdd11a03fd849c6f36c" and "f8f1017411c677cde35d0c28397209510fcc36c3" have entirely different histories.

15 changed files with 37 additions and 317 deletions

View file

@ -72,7 +72,6 @@ isMaximal: {
extensions.crates-nvim.enable = isMaximal; extensions.crates-nvim.enable = isMaximal;
}; };
toml.enable = isMaximal; toml.enable = isMaximal;
xml.enable = isMaximal;
# Language modules that are not as common. # Language modules that are not as common.
assembly.enable = false; assembly.enable = false;
@ -93,10 +92,9 @@ isMaximal: {
fsharp.enable = false; fsharp.enable = false;
just.enable = false; just.enable = false;
qml.enable = false; qml.enable = false;
jinja.enable = false;
tailwind.enable = false; tailwind.enable = false;
svelte.enable = false; svelte.enable = false;
tera.enable = false;
# Nim LSP is broken on Darwin and therefore # Nim LSP is broken on Darwin and therefore
# should be disabled by default. Users may still enable # should be disabled by default. Users may still enable

View file

@ -132,9 +132,6 @@
- Added [sqruff](https://github.com/quarylabs/sqruff) support to `languages.sql` - Added [sqruff](https://github.com/quarylabs/sqruff) support to `languages.sql`
- Lazy-load `crates.nvim` plugin when using
`vim.languages.rust.extensions.crates-nvim.enable`
- Added [Pyrefly](https://pyrefly.org/) and [zuban](https://zubanls.com/) - Added [Pyrefly](https://pyrefly.org/) and [zuban](https://zubanls.com/)
support to `languages.python` support to `languages.python`
@ -142,14 +139,9 @@
[Tombi](https://tombi-toml.github.io/tombi/) language server, linter, and [Tombi](https://tombi-toml.github.io/tombi/) language server, linter, and
formatter. formatter.
- Added Jinja support via `languages.jinja`
- Added [hlargs.nvim](https://github.com/m-demare/hlargs.nvim) support as - Added [hlargs.nvim](https://github.com/m-demare/hlargs.nvim) support as
`visuals.hlargs-nvim`. `visuals.hlargs-nvim`.
- Lazy-load `nvim-autopairs` plugin when using
`vim.autopairs.nvim-autopairs.enable`
[Machshev](https://github.com/machshev): [Machshev](https://github.com/machshev):
- Added `ruff` and `ty` LSP support for Python under `programs.python`. - Added `ruff` and `ty` LSP support for Python under `programs.python`.
@ -159,17 +151,4 @@
- Added [Selenen](https://github.com/kampfkarren/selene) for more diagnostics in - Added [Selenen](https://github.com/kampfkarren/selene) for more diagnostics in
`languages.lua`. `languages.lua`.
- Added XML syntax highlighting, LSP support and formatting
- Added [tera](https://keats.github.io/tera/) language support (syntax
highlighting only).
- Added [`golangci-lint`](https://golangci-lint.run/) for more diagnostics.
[vagahbond](https://github.com/vagahbond): [codewindow.nvim]:
https://github.com/gorbit99/codewindow.nvim
- Add [codewindow.nvim] plugin in `vim.assistant.codewindow` with `enable` and
`setupOpts`
<!-- vim: set textwidth=80: --> <!-- vim: set textwidth=80: -->

8
flake.lock generated
View file

@ -74,16 +74,16 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1769461804, "lastModified": 1768875095,
"narHash": "sha256-msG8SU5WsBUfVVa/9RPLaymvi5bI8edTavbIq3vRlhI=", "narHash": "sha256-dYP3DjiL7oIiiq3H65tGIXXIT1Waiadmv93JS0sS+8A=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "bfc1b8a4574108ceef22f02bafcf6611380c100d", "rev": "ed142ab1b3a092c4d149245d0c4126a5d7ea00b0",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nixos", "owner": "nixos",
"ref": "nixos-unstable", "ref": "nixpkgs-unstable",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }

View file

@ -122,7 +122,7 @@
systems.url = "github:nix-systems/default"; systems.url = "github:nix-systems/default";
## Basic Inputs ## Basic Inputs
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
flake-parts = { flake-parts = {
url = "github:hercules-ci/flake-parts"; url = "github:hercules-ci/flake-parts";

View file

@ -4,14 +4,17 @@
... ...
}: let }: let
inherit (lib.modules) mkIf; inherit (lib.modules) mkIf;
inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.lua) toLuaObject;
cfg = config.vim.autopairs.nvim-autopairs; cfg = config.vim.autopairs.nvim-autopairs;
in { in {
config = mkIf cfg.enable { config = mkIf cfg.enable {
vim.lazy.plugins.nvim-autopairs = { vim = {
package = "nvim-autopairs"; startPlugins = ["nvim-autopairs"];
setupModule = "nvim-autopairs"; pluginRC.autopairs = entryAnywhere ''
setupOpts = cfg.setupOpts; require('nvim-autopairs').setup(${toLuaObject cfg.setupOpts})
event = ["InsertEnter"]; '';
}; };
}; };
} }

View file

@ -19,10 +19,8 @@ in {
./helm.nix ./helm.nix
./kotlin.nix ./kotlin.nix
./html.nix ./html.nix
./tera.nix
./haskell.nix ./haskell.nix
./java.nix ./java.nix
./jinja.nix
./json.nix ./json.nix
./lua.nix ./lua.nix
./markdown.nix ./markdown.nix
@ -52,7 +50,6 @@ in {
./yaml.nix ./yaml.nix
./ruby.nix ./ruby.nix
./just.nix ./just.nix
./xml.nix
# This is now a hard deprecation. # This is now a hard deprecation.
(mkRenamedOptionModule ["vim" "languages" "enableLSP"] ["vim" "lsp" "enable"]) (mkRenamedOptionModule ["vim" "languages" "enableLSP"] ["vim" "lsp" "enable"])

View file

@ -10,7 +10,7 @@
inherit (lib.meta) getExe; inherit (lib.meta) getExe;
inherit (lib.generators) mkLuaInline; inherit (lib.generators) mkLuaInline;
inherit (lib.types) bool enum package; inherit (lib.types) bool enum package;
inherit (lib.nvim.types) mkGrammarOption diagnostics deprecatedSingleOrListOf; inherit (lib.nvim.types) mkGrammarOption deprecatedSingleOrListOf;
inherit (lib.nvim.dag) entryAfter; inherit (lib.nvim.dag) entryAfter;
inherit (lib.nvim.attrsets) mapListToAttrs; inherit (lib.nvim.attrsets) mapListToAttrs;
@ -78,91 +78,6 @@
package = pkgs.delve; package = pkgs.delve;
}; };
}; };
defaultDiagnosticsProvider = ["golangci-lint"];
diagnosticsProviders = {
golangci-lint = let
pkg = pkgs.golangci-lint;
in {
package = pkg;
config = {
cmd = getExe pkg;
args = [
"run"
"--output.json.path=stdout"
"--issues-exit-code=0"
"--show-stats=false"
"--fix=false"
"--path-mode=abs"
# Overwrite values that could be configured and result in unwanted writes
"--output.text.path="
"--output.tab.path="
"--output.html.path="
"--output.checkstyle.path="
"--output.code-climate.path="
"--output.junit-xml.path="
"--output.teamcity.path="
"--output.sarif.path="
];
parser = mkLuaInline ''
function(output, bufnr)
local SOURCE = "golangci-lint";
local function display_tool_error(msg)
return{
{
bufnr = bufnr,
lnum = 0,
col = 0,
message = string.format("[%s] %s", SOURCE, msg),
severity = vim.diagnostic.severity.ERROR,
source = SOURCE,
},
}
end
if output == "" then
return display_tool_error("no output provided")
end
local ok, decoded = pcall(vim.json.decode, output)
if not ok then
return display_tool_error("failed to parse JSON output")
end
if not decoded or not decoded.Issues then
return display_tool_error("unexpected output format")
end
local severity_map = {
error = vim.diagnostic.severity.ERROR,
warning = vim.diagnostic.severity.WARN,
info = vim.diagnostic.severity.INFO,
hint = vim.diagnostic.severity.HINT,
}
local diagnostics = {}
for _, issue in ipairs(decoded.Issues) do
local sev = vim.diagnostic.severity.ERROR
if issue.Severity and issue.Severity ~= "" then
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,
})
end
return diagnostics
end
'';
};
};
};
in { in {
options.vim.languages.go = { options.vim.languages.go = {
enable = mkEnableOption "Go language support"; enable = mkEnableOption "Go language support";
@ -219,14 +134,6 @@ in {
default = debuggers.${cfg.dap.debugger}.package; default = debuggers.${cfg.dap.debugger}.package;
}; };
}; };
extraDiagnostics = {
enable = mkEnableOption "extra Go diagnostics" // {default = config.vim.languages.enableExtraDiagnostics;};
types = diagnostics {
langDesc = "Go";
inherit diagnosticsProviders;
inherit defaultDiagnosticsProvider;
};
};
}; };
config = mkIf cfg.enable (mkMerge [ config = mkIf cfg.enable (mkMerge [
@ -272,15 +179,5 @@ in {
debugger.nvim-dap.enable = true; debugger.nvim-dap.enable = true;
}; };
}) })
(mkIf cfg.extraDiagnostics.enable {
vim.diagnostics.nvim-lint = {
enable = true;
linters_by_ft.go = cfg.extraDiagnostics.types;
linters =
mkMerge (map (name: {${name} = diagnosticsProviders.${name}.config;})
cfg.extraDiagnostics.types);
};
})
]); ]);
} }

View file

@ -1,65 +0,0 @@
{
config,
pkgs,
lib,
...
}: let
inherit (builtins) attrNames;
inherit (lib.meta) getExe;
inherit (lib.modules) mkIf mkMerge;
inherit (lib.options) mkEnableOption mkOption;
inherit (lib.types) enum listOf;
inherit (lib.nvim.types) mkGrammarOption;
inherit (lib.nvim.attrsets) mapListToAttrs;
cfg = config.vim.languages.jinja;
defaultServers = ["jinja-lsp"];
servers = {
jinja-lsp = {
enable = true;
cmd = [(getExe pkgs.jinja-lsp)];
filetypes = ["jinja"];
root_markers = [
".git"
];
};
};
in {
options.vim.languages.jinja = {
enable = mkEnableOption "Jinja template language support";
treesitter = {
enable = mkEnableOption "Jinja treesitter" // {default = config.vim.languages.enableTreesitter;};
package = mkGrammarOption pkgs "jinja";
inlinePackage = mkGrammarOption pkgs "jinja_inline";
};
lsp = {
enable = mkEnableOption "Jinja LSP support" // {default = config.vim.lsp.enable;};
servers = mkOption {
description = "Jinja LSP server to use";
type = listOf (enum (attrNames servers));
default = defaultServers;
};
};
};
config = mkIf cfg.enable (mkMerge [
(mkIf cfg.treesitter.enable {
vim.treesitter.enable = true;
vim.treesitter.grammars = [
cfg.treesitter.package
cfg.treesitter.inlinePackage
];
})
(mkIf cfg.lsp.enable {
vim.lsp.servers =
mapListToAttrs (n: {
name = n;
value = servers.${n};
})
cfg.lsp.servers;
})
]);
}

View file

@ -228,17 +228,10 @@ in {
(mkIf cfg.extensions.crates-nvim.enable { (mkIf cfg.extensions.crates-nvim.enable {
vim = mkMerge [ vim = mkMerge [
{ {
lazy.plugins.crates-nvim = { startPlugins = ["crates-nvim"];
package = "crates-nvim"; pluginRC.rust-crates = entryAnywhere ''
setupModule = "crates"; require("crates").setup(${toLuaObject cfg.extensions.crates-nvim.setupOpts})
setupOpts = cfg.extensions.crates-nvim.setupOpts; '';
event = [
{
event = "BufRead";
pattern = "Cargo.toml";
}
];
};
} }
]; ];
}) })

View file

@ -1,28 +0,0 @@
{
config,
pkgs,
lib,
...
}: let
inherit (lib.options) mkEnableOption;
inherit (lib.modules) mkIf mkMerge;
inherit (lib.nvim.types) mkGrammarOption;
cfg = config.vim.languages.tera;
in {
options.vim.languages.tera = {
enable = mkEnableOption "Tera templating language support";
treesitter = {
enable = mkEnableOption "Tera treesitter" // {default = config.vim.languages.enableTreesitter;};
package = mkGrammarOption pkgs "tera";
};
};
config = mkIf cfg.enable (mkMerge [
(mkIf cfg.treesitter.enable {
vim.treesitter.enable = true;
vim.treesitter.grammars = [cfg.treesitter.package];
})
]);
}

View file

@ -1,62 +0,0 @@
{
config,
pkgs,
lib,
...
}: let
inherit (builtins) attrNames;
inherit (lib.options) mkOption mkEnableOption;
inherit (lib.meta) getExe;
inherit (lib.modules) mkIf mkMerge;
inherit (lib.types) enum listOf;
inherit (lib.nvim.types) mkGrammarOption;
inherit (lib.nvim.attrsets) mapListToAttrs;
cfg = config.vim.languages.xml;
defaultServers = ["lemminx"];
servers = {
lemminx = {
enable = true;
cmd = [
(getExe pkgs.lemminx)
];
filetypes = ["xml"];
root_markers = [".git"];
};
};
in {
options.vim.languages.xml = {
enable = mkEnableOption "XML language support";
treesitter = {
enable = mkEnableOption "XML treesitter" // {default = config.vim.languages.enableTreesitter;};
package = mkGrammarOption pkgs "xml";
};
lsp = {
enable = mkEnableOption "XML LSP support" // {default = config.vim.lsp.enable;};
servers = mkOption {
type = listOf (enum (attrNames servers));
default = defaultServers;
description = "XML LSP server to use";
};
};
};
config = mkIf cfg.enable (mkMerge [
(mkIf cfg.treesitter.enable {
vim.treesitter.enable = true;
vim.treesitter.grammars = [cfg.treesitter.package];
})
(mkIf cfg.lsp.enable {
vim.lsp.servers =
mapListToAttrs (name: {
inherit name;
value = servers.${name};
})
cfg.lsp.servers;
})
]);
}

View file

@ -1,7 +1,6 @@
{lib, ...}: let {lib, ...}: let
inherit (lib.options) mkEnableOption; inherit (lib.options) mkEnableOption;
inherit (lib.nvim.binds) mkMappingOption; inherit (lib.nvim.binds) mkMappingOption;
inherit (lib.nvim.types) mkPluginSetupOption;
in { in {
options.vim.minimap.codewindow = { options.vim.minimap.codewindow = {
enable = mkEnableOption "codewindow plugin for minimap view"; enable = mkEnableOption "codewindow plugin for minimap view";
@ -12,7 +11,5 @@ in {
toggle = mkMappingOption "Toggle minimap [codewindow]" "<leader>mm"; toggle = mkMappingOption "Toggle minimap [codewindow]" "<leader>mm";
toggleFocus = mkMappingOption "Toggle minimap focus [codewindow]" "<leader>mf"; toggleFocus = mkMappingOption "Toggle minimap focus [codewindow]" "<leader>mf";
}; };
setupOpts = mkPluginSetupOption "codewindow" {};
}; };
} }

View file

@ -6,7 +6,6 @@
}: let }: let
inherit (lib.modules) mkIf mkMerge; inherit (lib.modules) mkIf mkMerge;
inherit (lib.nvim.dag) entryAnywhere; inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.lua) toLuaObject;
inherit (lib.nvim.binds) addDescriptionsToMappings mkSetLuaBinding pushDownDefault; inherit (lib.nvim.binds) addDescriptionsToMappings mkSetLuaBinding pushDownDefault;
cfg = config.vim.minimap.codewindow; cfg = config.vim.minimap.codewindow;
@ -33,7 +32,9 @@ in {
pluginRC.codewindow = entryAnywhere '' pluginRC.codewindow = entryAnywhere ''
local codewindow = require('codewindow') local codewindow = require('codewindow')
codewindow.setup(${toLuaObject cfg.setupOpts}) codewindow.setup({
exclude_filetypes = { 'NvimTree', 'orgagenda', 'Alpha'},
})
''; '';
}; };
}; };

View file

@ -21,9 +21,18 @@ in {
treesitter.grammars = optionals cfg.addDefaultGrammars cfg.defaultGrammars; treesitter.grammars = optionals cfg.addDefaultGrammars cfg.defaultGrammars;
pluginRC.treesitter-autocommands = entryAfter ["basic"] '' # Define the autogroup for treesitter here rather than in the Lua snippet
vim.api.nvim_create_augroup("nvf_treesitter", { clear = true }) # to allow overriding more easily. Should be highly unlikely that a user
# wants to override, but not impossible.
augroups = [
{
enable = true;
name = "nvf_treesitter";
clear = true;
}
];
pluginRC.treesitter-autocommands = entryAfter ["basic"] ''
${lib.optionalString cfg.highlight.enable '' ${lib.optionalString cfg.highlight.enable ''
-- Enable treesitter highlighting for all filetypes -- Enable treesitter highlighting for all filetypes
vim.api.nvim_create_autocmd("FileType", { vim.api.nvim_create_autocmd("FileType", {
@ -54,6 +63,7 @@ in {
callback = function() callback = function()
vim.wo[0][0].foldmethod = "expr" vim.wo[0][0].foldmethod = "expr"
vim.wo[0][0].foldexpr = "v:lua.vim.treesitter.foldexpr()" vim.wo[0][0].foldexpr = "v:lua.vim.treesitter.foldexpr()"
-- This is optional, but is set rather as a sane default. -- This is optional, but is set rather as a sane default.
-- If unset, opened files will be folded by automatically as -- If unset, opened files will be folded by automatically as
-- the files are opened -- the files are opened

View file

@ -973,9 +973,9 @@
}, },
"branch": "main", "branch": "main",
"submodules": false, "submodules": false,
"revision": "c81ce9ed129387fc5fdec91abe9818a1b0e6fcac", "revision": "de79a7626d54d7785436105ef72f37ee8fe8fa16",
"url": "https://github.com/OXY2DEV/markview.nvim/archive/c81ce9ed129387fc5fdec91abe9818a1b0e6fcac.tar.gz", "url": "https://github.com/OXY2DEV/markview.nvim/archive/de79a7626d54d7785436105ef72f37ee8fe8fa16.tar.gz",
"hash": "sha256-CoPfVkPWh5neyIT1rVEHMLo7532lWvbv0Gg/27D0PHw=" "hash": "sha256-kGhohG4Aw9wMceLiX+s2HCWIyWuJYHoa9D80elM1UQw="
}, },
"mellow": { "mellow": {
"type": "Git", "type": "Git",