From b6ea6af1fbf4357967ab7066d594dbc0d3e218f2 Mon Sep 17 00:00:00 2001 From: catvayor Date: Wed, 13 Nov 2024 16:56:33 +0100 Subject: [PATCH] feat(lsp): add ltex and keymaps --- kat/users/default.nix | 2 +- kat/users/{neovim/default.nix => neovim.nix} | 30 ++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) rename kat/users/{neovim/default.nix => neovim.nix} (76%) diff --git a/kat/users/default.nix b/kat/users/default.nix index 731cb4d..5039333 100644 --- a/kat/users/default.nix +++ b/kat/users/default.nix @@ -8,7 +8,7 @@ in { imports = [ zsh.user - ./neovim + ./neovim.nix ((import sources.nixvim).homeManagerModules.nixvim) ]; # options.kat = { diff --git a/kat/users/neovim/default.nix b/kat/users/neovim.nix similarity index 76% rename from kat/users/neovim/default.nix rename to kat/users/neovim.nix index 51c051a..6b9f46c 100644 --- a/kat/users/neovim/default.nix +++ b/kat/users/neovim.nix @@ -100,10 +100,40 @@ with lib; lsp = mkIf config.kat.neovim.lsp { enable = true; + keymaps = { + diagnostic = { + "lj" = "goto_next"; + "lk" = "goto_prev"; + }; + lspBuf = { + K = "hover"; + lgD = "references"; + lgd = "definition"; + lgi = "implementation"; + lgt = "type_definition"; + la = "code_action"; + ls = "signature_help"; + }; + extra = [ + { + action = "LspStop"; + key = "lx"; + } + { + action = "LspStart"; + key = "ls"; + } + { + action = "LspRestart"; + key = "lr"; + } + ]; + }; servers = { nixd.enable = true; pylsp.enable = true; clangd.enable = true; + ltex.enable = true; rust_analyzer = { enable = true; installCargo = true;