diff options
author | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2024-03-05 00:13:30 +0100 |
---|---|---|
committer | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2024-03-05 00:13:30 +0100 |
commit | 04c7f672fa3d58aaa340a36d5590088d816b578f (patch) | |
tree | 7952384aad7e68e03b49c27ef2be4061cafa8e15 /fnl/plugins/lsp | |
parent | 75679680cc41bb7eec3dc157b67ef6e7a0f241bb (diff) |
Update lsp keymaps
Diffstat (limited to 'fnl/plugins/lsp')
-rw-r--r-- | fnl/plugins/lsp/keymaps.fnl | 40 |
1 files changed, 30 insertions, 10 deletions
diff --git a/fnl/plugins/lsp/keymaps.fnl b/fnl/plugins/lsp/keymaps.fnl index 73cbf94..806d514 100644 --- a/fnl/plugins/lsp/keymaps.fnl +++ b/fnl/plugins/lsp/keymaps.fnl @@ -1,19 +1,39 @@ ;; Key mappings for lsp. -(local opts {:noremap true :silent true}) - (local mappings [[:n :gD "<cmd>lua vim.lsp.buf.declaration()<CR>" {:desc :Declaration}] - [:n :gd "<cmd>lua vim.lsp.buf.definition()<CR>" {:desc :Definition}] + [:n + :gd + "<cmd>Telescope lsp_definitions theme=dropdown<cr>" + {:desc :Definition}] [:n :gI - "<cmd>lua vim.lsp.buf.implementation()<CR>" + "<cmd>Telescope lsp_implementations theme=dropdown<cr>" {:desc :Implementation}] - [:n :gr "<cmd>lua vim.lsp.buf.references()<CR>" {:desc :References}] + [:n + :gr + "<cmd>Telescope lsp_references theme=dropdown<cr>" + {:desc :References}] [:n :gl "<cmd>lua vim.diagnostic.open_float()<CR>" {:desc :Diagnostics}] + [:n + :gu + "<cmd>Telescope lsp_document_symbols theme=dropdown<cr>" + {:desc "Document Symbols"}] + [:n + :gj + "<cmd>Telescope diagnostics theme=dropdown<cr>" + {:desc "Telescope Diagnostics"}] + [:n + :gw + "<cmd>Telescope lsp_dynamic_workspace_symbols theme=dropdown<cr>" + {:desc "Workspace Symbols"}] + [:n + :gE + "<cmd>Telescope lsp_type_definitions theme=dropdown<cr>" + {:desc "Workspace Symbols"}] [:n :gs "<cmd>lua vim.lsp.buf.signature_help()<CR>" {:desc :Signature}] [:n :gh "<cmd>lua vim.lsp.buf.code_action()<cr>" {:desc "Code Action"}] [:n :gb "<cmd>lua vim.lsp.codelens.run()<cr>" {:desc "Code Lens"}] @@ -21,10 +41,10 @@ [:n :<leader>li :<cmd>LspInfo<cr> {:desc "Lsp Info"}]]) (fn on-attach [buffer] - (each [_ mapping (ipairs mappings)] - (match mapping - [mode key cmd desc] (vim.api.nvim_buf_set_keymap buffer mode key cmd - (vim.tbl_extend :force - opts desc))))) + (let [opts {:noremap true :silent true : buffer}] + (each [_ mapping (ipairs mappings)] + (match mapping + [mode key cmd desc] + (vim.keymap.set mode key cmd (vim.tbl_extend :force opts desc)))))) {: on-attach} |