summaryrefslogtreecommitdiff
path: root/fnl/plugins/lsp/keymaps.fnl
diff options
context:
space:
mode:
Diffstat (limited to 'fnl/plugins/lsp/keymaps.fnl')
-rw-r--r--fnl/plugins/lsp/keymaps.fnl23
1 files changed, 23 insertions, 0 deletions
diff --git a/fnl/plugins/lsp/keymaps.fnl b/fnl/plugins/lsp/keymaps.fnl
new file mode 100644
index 0000000..a7fac89
--- /dev/null
+++ b/fnl/plugins/lsp/keymaps.fnl
@@ -0,0 +1,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}