blob: a7fac8965a8181651120ab80cad827ed6546752e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
;; Key mappings for lsp.
(fn on-attach [bufnr] (let [opts {:noremap true :silent true}]
(vim.api.nvim_buf_set_keymap bufnr :n :gD
"<cmd>lua vim.lsp.buf.declaration()<CR>"
opts)
(vim.api.nvim_buf_set_keymap bufnr :n :gd
"<cmd>lua vim.lsp.buf.definition()<CR>"
opts)
(vim.api.nvim_buf_set_keymap bufnr :n :gI
"<cmd>lua vim.lsp.buf.implementation()<CR>"
opts)
(vim.api.nvim_buf_set_keymap bufnr :n :gr
"<cmd>lua vim.lsp.buf.references()<CR>"
opts)
(vim.api.nvim_buf_set_keymap bufnr :n :gl
"<cmd>lua vim.diagnostic.open_float()<CR>"
opts)
(vim.api.nvim_buf_set_keymap bufnr :n :gs
"<cmd>lua vim.lsp.buf.signature_help()<CR>"
opts)))
{: on-attach}
|