diff options
Diffstat (limited to 'fnl/plugins/lsp/keymaps.fnl')
-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} |