mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-11-12 16:35:30 +00:00
Merge branch 'main' into main
This commit is contained in:
commit
6f6992069b
6 changed files with 98 additions and 2 deletions
|
|
@ -193,6 +193,16 @@
|
||||||
[golines](https://github.com/segmentio/golines) and
|
[golines](https://github.com/segmentio/golines) and
|
||||||
[gofumpt](https://github.com/mvdan/gofumpt)
|
[gofumpt](https://github.com/mvdan/gofumpt)
|
||||||
|
|
||||||
|
|
||||||
[UltraGhostie](https://github.com/UltraGhostie)
|
[UltraGhostie](https://github.com/UltraGhostie)
|
||||||
|
|
||||||
- Add [harpoon](https://github.com/ThePrimeagen/harpoon) plugin for navigation
|
- 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`).
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,7 @@ in {
|
||||||
./nu.nix
|
./nu.nix
|
||||||
./odin.nix
|
./odin.nix
|
||||||
./wgsl.nix
|
./wgsl.nix
|
||||||
|
./yaml.nix
|
||||||
./ruby.nix
|
./ruby.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
||||||
72
modules/plugins/languages/yaml.nix
Normal file
72
modules/plugins/languages/yaml.nix
Normal 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;
|
||||||
|
})
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
@ -57,8 +57,8 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
mappings = {
|
mappings = {
|
||||||
viewToggle = mkMappingOption "Open or close the docs view panel" "lvt";
|
viewToggle = mkMappingOption "Open or close the docs view panel" "<leader>lvt";
|
||||||
viewUpdate = mkMappingOption "Manually update the docs view panel" "lvu";
|
viewUpdate = mkMappingOption "Manually update the docs view panel" "<leader>lvu";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@
|
||||||
in {
|
in {
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
vim = {
|
vim = {
|
||||||
|
startPlugins = ["snacks-nvim"];
|
||||||
lazy.plugins."yazi.nvim" = {
|
lazy.plugins."yazi.nvim" = {
|
||||||
package = pkgs.vimPlugins.yazi-nvim;
|
package = pkgs.vimPlugins.yazi-nvim;
|
||||||
setupModule = "yazi";
|
setupModule = "yazi";
|
||||||
|
|
|
||||||
|
|
@ -1892,6 +1892,18 @@
|
||||||
"url": "https://github.com/m4xshen/smartcolumn.nvim/archive/92f3773af80d674f1eb61e112dca79e2fa449fd1.tar.gz",
|
"url": "https://github.com/m4xshen/smartcolumn.nvim/archive/92f3773af80d674f1eb61e112dca79e2fa449fd1.tar.gz",
|
||||||
"hash": "0k1xnyvblshn4fhbxgl0i34j22n55xlwr09sdmb23l57br5rb07q"
|
"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": {
|
"sqls-nvim": {
|
||||||
"type": "Git",
|
"type": "Git",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue