From 04c7f672fa3d58aaa340a36d5590088d816b578f Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Tue, 5 Mar 2024 00:13:30 +0100 Subject: Update lsp keymaps --- fnl/plugins/lsp/keymaps.fnl | 40 ++++++++++++++++++++++++++++++---------- fnl/plugins/telescope.fnl | 11 +---------- 2 files changed, 31 insertions(+), 20 deletions(-) (limited to 'fnl') 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 "lua vim.lsp.buf.declaration()" {:desc :Declaration}] - [:n :gd "lua vim.lsp.buf.definition()" {:desc :Definition}] + [:n + :gd + "Telescope lsp_definitions theme=dropdown" + {:desc :Definition}] [:n :gI - "lua vim.lsp.buf.implementation()" + "Telescope lsp_implementations theme=dropdown" {:desc :Implementation}] - [:n :gr "lua vim.lsp.buf.references()" {:desc :References}] + [:n + :gr + "Telescope lsp_references theme=dropdown" + {:desc :References}] [:n :gl "lua vim.diagnostic.open_float()" {:desc :Diagnostics}] + [:n + :gu + "Telescope lsp_document_symbols theme=dropdown" + {:desc "Document Symbols"}] + [:n + :gj + "Telescope diagnostics theme=dropdown" + {:desc "Telescope Diagnostics"}] + [:n + :gw + "Telescope lsp_dynamic_workspace_symbols theme=dropdown" + {:desc "Workspace Symbols"}] + [:n + :gE + "Telescope lsp_type_definitions theme=dropdown" + {:desc "Workspace Symbols"}] [:n :gs "lua vim.lsp.buf.signature_help()" {:desc :Signature}] [:n :gh "lua vim.lsp.buf.code_action()" {:desc "Code Action"}] [:n :gb "lua vim.lsp.codelens.run()" {:desc "Code Lens"}] @@ -21,10 +41,10 @@ [:n :li :LspInfo {: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} diff --git a/fnl/plugins/telescope.fnl b/fnl/plugins/telescope.fnl index b072a87..ef0054b 100644 --- a/fnl/plugins/telescope.fnl +++ b/fnl/plugins/telescope.fnl @@ -92,18 +92,9 @@ {1 :ft 2 "Telescope live_grep theme=dropdown" :desc "Find Text"} - {1 :js - 2 "Telescope diagnostics theme=dropdown" - :desc "Telescope Diagnostics"} {1 :gc 2 "Telescope git_commits theme=dropdown" - :desc "Checkout Commit"} - {1 :lS - 2 "Telescope lsp_dynamic_workspace_symbols" - :desc "Workspace Symbols"} - {1 :n - 2 "Telescope lsp_document_symbols theme=dropdown" - :desc "Document Symbols"}]) + :desc "Checkout Commit"}]) (fn config [] (let [telescope (require :telescope) -- cgit v1.2.3-70-g09d2