Merge branch 'main' into main

This commit is contained in:
Theodor Björkman 2025-03-04 09:00:20 +01:00 committed by GitHub
commit 6f6992069b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 98 additions and 2 deletions

View file

@ -193,6 +193,16 @@
[golines](https://github.com/segmentio/golines) and
[gofumpt](https://github.com/mvdan/gofumpt)
[UltraGhostie](https://github.com/UltraGhostie)
- Add [harpoon](https://github.com/ThePrimeagen/harpoon) plugin for navigation
[MaxMur](https://github.com/TheMaxMur)
- Add YAML support under `vim.languages.yaml`.
[alfarel](https://github.com/alfarelcynthesis):
- Add missing `yazi.nvim` dependency (`snacks.nvim`).

View file

@ -39,6 +39,7 @@ in {
./nu.nix
./odin.nix
./wgsl.nix
./yaml.nix
./ruby.nix
];

View file

@ -0,0 +1,72 @@
{
pkgs,
config,
lib,
...
}: let
inherit (builtins) attrNames;
inherit (lib.options) mkEnableOption mkOption;
inherit (lib.modules) mkIf mkMerge;
inherit (lib.lists) isList;
inherit (lib.types) enum either listOf package str;
inherit (lib.nvim.types) mkGrammarOption;
inherit (lib.nvim.lua) expToLua;
cfg = config.vim.languages.yaml;
defaultServer = "yaml-language-server";
servers = {
yaml-language-server = {
package = pkgs.nodePackages.yaml-language-server;
lspConfig = ''
lspconfig.yamlls.setup {
capabilities = capabilities;
on_attach = default_on_attach;
cmd = ${
if isList cfg.lsp.package
then expToLua cfg.lsp.package
else ''{"${cfg.lsp.package}/bin/yaml-language-server", "--stdio"}''
},
}
'';
};
};
in {
options.vim.languages.yaml = {
enable = mkEnableOption "YAML language support";
treesitter = {
enable = mkEnableOption "YAML treesitter" // {default = config.vim.languages.enableTreesitter;};
package = mkGrammarOption pkgs "yaml";
};
lsp = {
enable = mkEnableOption "YAML LSP support" // {default = config.vim.languages.enableLSP;};
server = mkOption {
type = enum (attrNames servers);
default = defaultServer;
description = "YAML LSP server to use";
};
package = mkOption {
type = either package (listOf str);
default = servers.${cfg.lsp.server}.package;
description = "YAML LSP server package";
};
};
};
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.lspconfig.enable = true;
vim.lsp.lspconfig.sources.yaml-lsp = servers.${cfg.lsp.server}.lspConfig;
})
]);
}

View file

@ -57,8 +57,8 @@ in {
};
mappings = {
viewToggle = mkMappingOption "Open or close the docs view panel" "lvt";
viewUpdate = mkMappingOption "Manually update the docs view panel" "lvu";
viewToggle = mkMappingOption "Open or close the docs view panel" "<leader>lvt";
viewUpdate = mkMappingOption "Manually update the docs view panel" "<leader>lvu";
};
};
}

View file

@ -15,6 +15,7 @@
in {
config = mkIf cfg.enable {
vim = {
startPlugins = ["snacks-nvim"];
lazy.plugins."yazi.nvim" = {
package = pkgs.vimPlugins.yazi-nvim;
setupModule = "yazi";

View file

@ -1892,6 +1892,18 @@
"url": "https://github.com/m4xshen/smartcolumn.nvim/archive/92f3773af80d674f1eb61e112dca79e2fa449fd1.tar.gz",
"hash": "0k1xnyvblshn4fhbxgl0i34j22n55xlwr09sdmb23l57br5rb07q"
},
"snacks-nvim": {
"type": "Git",
"repository": {
"type": "GitHub",
"owner": "folke",
"repo": "snacks.nvim"
},
"branch": "main",
"revision": "bc0630e43be5699bb94dadc302c0d21615421d93",
"url": "https://github.com/folke/snacks.nvim/archive/bc0630e43be5699bb94dadc302c0d21615421d93.tar.gz",
"hash": "0a5nw7xa33shag1h12gf930g3vcixbwk8dxv0ji4980ycskh238v"
},
"sqls-nvim": {
"type": "Git",
"repository": {