diff options
author | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2023-01-17 00:08:43 +0100 |
---|---|---|
committer | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2023-01-17 00:08:43 +0100 |
commit | a48ba3f7dfe35c7ca622e63a72574134788d68c7 (patch) | |
tree | 0675dc0f5e950c8739b63da29568d083e9c1d057 /fnl/plugins/lsp/keymaps.fnl | |
parent | 10b175f252104458d7478d8a2822818850cfdf92 (diff) |
Update key mappings
Diffstat (limited to 'fnl/plugins/lsp/keymaps.fnl')
-rw-r--r-- | fnl/plugins/lsp/keymaps.fnl | 34 |
1 files changed, 27 insertions, 7 deletions
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 "<cmd>lua vim.lsp.buf.declaration()<CR>"] - [:n :gd "<cmd>lua vim.lsp.buf.definition()<CR>"] - [:n :gI "<cmd>lua vim.lsp.buf.implementation()<CR>"] - [:n :gr "<cmd>lua vim.lsp.buf.references()<CR>"] - [:n :gl "<cmd>lua vim.diagnostic.open_float()<CR>"] - [:n :gs "<cmd>lua vim.lsp.buf.signature_help()<CR>"]]) + [[:n :gD "<cmd>lua vim.lsp.buf.declaration()<CR>" {:desc :Declaration}] + [:n :gd "<cmd>lua vim.lsp.buf.definition()<CR>" {:desc :Definition}] + [:n + :gI + "<cmd>lua vim.lsp.buf.implementation()<CR>" + {:desc :Implementation}] + [:n :gr "<cmd>lua vim.lsp.buf.references()<CR>" {:desc :References}] + [:n + :gl + "<cmd>lua vim.diagnostic.open_float()<CR>" + {:desc :Diagnostics}] + [:n :gs "<cmd>lua vim.lsp.buf.signature_help()<CR>" {:desc :Signature}] + [:n :gv "<cmd>lua vim.lsp.buf.rename()<cr>" {:desc :Rename}] + [:n + :<leader>a + "<cmd>lua vim.lsp.buf.code_action()<cr>" + {:desc "Code Action"}] + [:n + :<leader>e + "<cmd>lua vim.lsp.buf.format { async = true }<cr>" + {:desc :Format}] + [:n + :<leader>i + "<cmd>lua vim.lsp.codelens.run()<cr>" + {:desc "Code Lens"}] + [:n :<leader>li :<cmd>LspInfo<cr> {: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} |