diff options
-rw-r--r-- | fnl/plugins/lsp/keymaps.fnl | 40 | ||||
-rw-r--r-- | fnl/plugins/telescope.fnl | 11 |
2 files changed, 31 insertions, 20 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} 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 :<leader>ft 2 "<cmd>Telescope live_grep theme=dropdown<cr>" :desc "Find Text"} - {1 :<leader>js - 2 "<cmd>Telescope diagnostics theme=dropdown<cr>" - :desc "Telescope Diagnostics"} {1 :<leader>gc 2 "<cmd>Telescope git_commits theme=dropdown<cr>" - :desc "Checkout Commit"} - {1 :<leader>lS - 2 "<cmd>Telescope lsp_dynamic_workspace_symbols<cr>" - :desc "Workspace Symbols"} - {1 :<leader>n - 2 "<cmd>Telescope lsp_document_symbols theme=dropdown<cr>" - :desc "Document Symbols"}]) + :desc "Checkout Commit"}]) (fn config [] (let [telescope (require :telescope) |