From a48ba3f7dfe35c7ca622e63a72574134788d68c7 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Tue, 17 Jan 2023 00:08:43 +0100 Subject: Update key mappings --- fnl/plugins/lsp/keymaps.fnl | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) (limited to 'fnl/plugins/lsp') diff --git a/fnl/plugins/lsp/keymaps.fnl b/fnl/plugins/lsp/keymaps.fnl index cd62073..fdcf53f 100644 --- a/fnl/plugins/lsp/keymaps.fnl +++ b/fnl/plugins/lsp/keymaps.fnl @@ -3,16 +3,36 @@ (local opts {:noremap true :silent true}) (local mappings - [[:n :gD "lua vim.lsp.buf.declaration()"] - [:n :gd "lua vim.lsp.buf.definition()"] - [:n :gI "lua vim.lsp.buf.implementation()"] - [:n :gr "lua vim.lsp.buf.references()"] - [:n :gl "lua vim.diagnostic.open_float()"] - [:n :gs "lua vim.lsp.buf.signature_help()"]]) + [[:n :gD "lua vim.lsp.buf.declaration()" {:desc :Declaration}] + [:n :gd "lua vim.lsp.buf.definition()" {:desc :Definition}] + [:n + :gI + "lua vim.lsp.buf.implementation()" + {:desc :Implementation}] + [:n :gr "lua vim.lsp.buf.references()" {:desc :References}] + [:n + :gl + "lua vim.diagnostic.open_float()" + {:desc :Diagnostics}] + [:n :gs "lua vim.lsp.buf.signature_help()" {:desc :Signature}] + [:n :gv "lua vim.lsp.buf.rename()" {:desc :Rename}] + [:n + :a + "lua vim.lsp.buf.code_action()" + {:desc "Code Action"}] + [:n + :e + "lua vim.lsp.buf.format { async = true }" + {:desc :Format}] + [:n + :i + "lua vim.lsp.codelens.run()" + {:desc "Code Lens"}] + [:n :li :LspInfo {:desc "Lsp Info"}]]) (fn on-attach [bufnr] (each [_ mapping (ipairs mappings)] (match mapping - [mode key cmd] (vim.api.nvim_buf_set_keymap bufnr mode key cmd opts)))) + [mode key cmd desc] (vim.api.nvim_buf_set_keymap bufnr mode key cmd (vim.tbl_extend :force opts desc))))) {: on-attach} -- cgit v1.2.3-70-g09d2