summaryrefslogtreecommitdiff
path: root/README
diff options
context:
space:
mode:
authorMichael Smith <mikesmiffy128@gmail.com>2022-05-23 04:41:22 +0100
committerMichael Smith <mikesmiffy128@gmail.com>2022-05-23 04:41:22 +0100
commita7b72fc27edac2305dbf0af807981bd703835b25 (patch)
tree625089940002ec5090fcc1c8de07cb635b542d86 /README
parentf32042f317c42e408fd62c9ce42b1d5c7ab3ba2a (diff)
Fix example woopsy
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>")