Merge branch 'main' into catppuccin-lspsaga-integration

This commit is contained in:
raf 2025-04-03 13:14:33 +00:00 committed by GitHub
commit 762e031a67
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 319 additions and 216 deletions

View file

@ -22,7 +22,7 @@
package = pkgs.astro-language-server;
lspConfig = ''
lspconfig.astro.setup {
capabilities = capabilities;
capabilities = capabilities,
on_attach = attach_keymaps,
cmd = ${
if isList cfg.lsp.package
@ -41,6 +41,10 @@
package = pkgs.nodePackages.prettier;
};
prettierd = {
package = pkgs.prettierd;
};
biome = {
package = pkgs.biome;
};
@ -84,16 +88,16 @@ in {
enable = mkEnableOption "Astro LSP support" // {default = config.vim.languages.enableLSP;};
server = mkOption {
description = "Astro LSP server to use";
type = enum (attrNames servers);
default = defaultServer;
description = "Astro LSP server to use";
};
package = mkOption {
description = "Astro LSP server package, or the command to run as a list of strings";
example = ''[lib.getExe pkgs.astro-language-server "--minify" "--stdio"]'';
type = either package (listOf str);
default = servers.${cfg.lsp.server}.package;
example = ''[lib.getExe pkgs.astro-language-server "--minify" "--stdio"]'';
description = "Astro LSP server package, or the command to run as a list of strings";
};
};

View file

@ -1,5 +1,6 @@
_: {
imports = [
./flash
./hop
./leap
./precognition

View file

@ -0,0 +1,34 @@
{
config,
lib,
...
}: let
inherit (lib.modules) mkIf;
inherit (lib.nvim.binds) mkKeymap;
inherit (lib.nvim.lua) toLuaObject;
inherit (lib.nvim.dag) entryAnywhere;
cfg = config.vim.utility.motion.flash-nvim;
in {
config = mkIf cfg.enable {
vim = {
lazy.plugins = {
"flash-nvim" = {
package = "flash-nvim";
setupModule = "flash";
setupOpts = cfg.setupOpts;
lazy = true;
keys = [
(mkKeymap ["n" "o" "x"] cfg.mappings.jump "<cmd>lua require(\"flash\").jump()<cr>" {desc = "Flash";})
(mkKeymap ["n" "o" "x"] cfg.mappings.treesitter "<cmd>lua require(\"flash\").treesitter()<cr>" {desc = "Flash Treesitter";})
(mkKeymap "o" cfg.mappings.remote "<cmd>lua require(\"flash\").remote()<cr>" {desc = "Remote Flash";})
(mkKeymap ["o" "x"] cfg.mappings.treesitter_search "<cmd>lua require(\"flash\").treesitter_search()<cr>" {desc = "Treesitter Search";})
(mkKeymap "c" cfg.mappings.toggle "<cmd>lua require(\"flash\").toggle()<cr>" {desc = "Toggle Flash Search";})
];
};
};
};
};
}

View file

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

View file

@ -0,0 +1,38 @@
{lib, ...}: let
inherit (lib.options) mkEnableOption mkOption;
inherit (lib.types) nullOr str;
inherit (lib.nvim.types) mkPluginSetupOption;
in {
options.vim.utility.motion.flash-nvim = {
enable = mkEnableOption "enhanced code navigation with flash.nvim";
setupOpts = mkPluginSetupOption "flash-nvim" {};
mappings = {
jump = mkOption {
type = nullOr str;
default = "s";
description = "Jump";
};
treesitter = mkOption {
type = nullOr str;
default = "S";
description = "Treesitter";
};
remote = mkOption {
type = nullOr str;
default = "r";
description = "Remote Flash";
};
treesitter_search = mkOption {
type = nullOr str;
default = "R";
description = "Treesitter Search";
};
toggle = mkOption {
type = nullOr str;
default = "<c-s>";
description = "Toggle Flash Search";
};
};
};
}

View file

@ -12,7 +12,7 @@ in {
config = mkIf cfg.enable {
vim = {
startPlugins = ["oil-nvim"];
pluginRC.snacks-nvim = entryAnywhere ''
pluginRC.oil-nvim = entryAnywhere ''
require("oil").setup(${toLuaObject cfg.setupOpts});
'';
};