summaryrefslogtreecommitdiff
path: root/fnl/plugins/lsp/keymaps.fnl
diff options
context:
space:
mode:
Diffstat (limited to 'fnl/plugins/lsp/keymaps.fnl')
-rw-r--r--fnl/plugins/lsp/keymaps.fnl34
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}