summaryrefslogtreecommitdiff
path: root/fnl/config/lsp/keymaps.fnl
blob: c60dfa95ebb92eef0ae4c91ef5528b3304e4ff15 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
;; Key mappings for lsp.
(module config.lsp.keymaps {autoload {nvim aniseed.nvim}})

(defn on-attach [bufnr] (let [opts {:noremap true :silent true}]
                          (nvim.buf_set_keymap bufnr :n :gD
                                               "<cmd>lua vim.lsp.buf.declaration()<CR>"
                                               opts)
                          (nvim.buf_set_keymap bufnr :n :gd
                                               "<cmd>lua vim.lsp.buf.definition()<CR>"
                                               opts)
                          (nvim.buf_set_keymap bufnr :n :gI
                                               "<cmd>lua vim.lsp.buf.implementation()<CR>"
                                               opts)
                          (nvim.buf_set_keymap bufnr :n :gr
                                               "<cmd>lua vim.lsp.buf.references()<CR>"
                                               opts)
                          (nvim.buf_set_keymap bufnr :n :gl
                                               "<cmd>lua vim.diagnostic.open_float()<CR>"
                                               opts)
                          (nvim.buf_set_keymap bufnr :n :gs
                                               "<cmd>lua vim.lsp.buf.signature_help()<CR>"
                                               opts)))