From c6a4b48052dca7af6814cd4d19442ad531bd9b0d Mon Sep 17 00:00:00 2001 From: Ellis Rahhal Date: Fri, 21 Mar 2025 14:34:33 -0700 Subject: [PATCH] fixed/added lsp keybindings --- plugins/lsp.nix | 78 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) diff --git a/plugins/lsp.nix b/plugins/lsp.nix index 3af6abd..4ec9e87 100644 --- a/plugins/lsp.nix +++ b/plugins/lsp.nix @@ -6,6 +6,84 @@ ]; programs.nixvim = { + keymaps = [ + { + key = "gD"; + action = "lua vim.lsp.buf.declaration()"; + options = { noremap = true; }; + } + { + key = "gd"; + action = "lua vim.lsp.buf.definition()"; + options = { noremap = true; }; + } + { + key = "gi"; + action = "lua vim.lsp.buf.implementation()"; + options = { noremap = true; }; + } + { + key = "gk"; + action = "lua vim.lsp.buf.signature_help()"; + options = { noremap = true; }; + } + { + key = "K"; + action = "lua vim.lsp.buf.hover()"; + options = { noremap = true; }; + } + { + key = "wa"; + action = "lua vim.lsp.buf.add_workspace_folder()"; + options = { noremap = true; }; + } + { + key = "wr"; + action = "lua vim.lsp.buf.remove_workspace_folder()"; + options = { noremap = true; }; + } + { + key = "wl"; + action = "lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))"; + options = { noremap = true; }; + } + { + key = "D"; + action = "lua vim.lsp.buf.type_definition()"; + options = { noremap = true; }; + } + { + key = "r"; + action = "lua vim.lsp.buf.rename()"; + options = { noremap = true; }; + } + { + key = "ca"; + action = "lua vim.lsp.buf.code_action()"; + options = { noremap = true; }; + } + { + key = "e"; + action = "lua vim.diagnostic.open_float()"; + options = { noremap = true; }; + } + { + key = "q"; + action = "lua vim.diagnostic.setloclist()"; + options = { noremap = true; }; + } + { + key = "f"; + action = "lua vim.lsp.buf.formatting()"; + options = { noremap = true; }; + } + { + key = "gr"; + action = "lua vim.lsp.buf.references()"; + options = { noremap = true; }; + } + ]; + plugins.lsp = { enable = true; onAttach = ''