summaryrefslogtreecommitdiff
path: root/README
diff options
context:
space:
mode:
Diffstat (limited to 'README')
-rw-r--r--README9
1 files changed, 5 insertions, 4 deletions
diff --git a/README b/README
index aedbabd..ea7c902 100644
--- a/README
+++ b/README
@@ -45,15 +45,16 @@ lua <<EOF
local caps = vim.lsp.protocol.make_client_capabilities()
caps = cmp_lsp.update_capabilities(caps)
- local opts = { noremap = true, silent = true }
- local function nn(from, to)
- vim.api.nvim_buf_set_keymap(buf, "n", from, to, opts)
- end
+ local opts = {noremap = true, silent = true}
+ local function nn(from, to) vim.api.nvim_set_keymap("n", from, to, opts) end
nn("<Leader>e", "<cmd>lua vim.diagnostic.open_float()<CR>")
nn("[d", "<cmd>lua vim.diagnostic.goto_prev()<CR>")
nn("]d", "<cmd>lua vim.diagnostic.goto_next()<CR>")
local function onattach(client, buf)
+ local function nn(from, to)
+ vim.api.nvim_buf_set_keymap(buf, "n", from, to, opts)
+ end
nn("gD", "<cmd>lua vim.lsp.buf.declaration()<CR>")
nn("gd", "<cmd>lua vim.lsp.buf.definition()<CR>")
nn("<Leader>K", "<cmd>lua vim.lsp.buf.hover()<CR>")