diff options
author | Zach Smith <zsmith@newhopechurch.tv> | 2025-06-30 09:52:52 -0500 |
---|---|---|
committer | Zach Smith <zsmith@newhopechurch.tv> | 2025-06-30 09:52:52 -0500 |
commit | c8691fe2bcc291875c9919c2c3742a0c0ca587da (patch) | |
tree | f546481bec7c5d6880f305cb87644935cf32e3a3 /nvim/lua/lsp.lua | |
parent | f87ded6f168c156b3bc71a8c4733c5eeafeb311c (diff) | |
parent | 6c75a83e941500619b5499b5d4763c8dab2c93b6 (diff) |
Merge branch 'master' into mac
Diffstat (limited to 'nvim/lua/lsp.lua')
-rw-r--r-- | nvim/lua/lsp.lua | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/nvim/lua/lsp.lua b/nvim/lua/lsp.lua new file mode 100644 index 0000000..343c76b --- /dev/null +++ b/nvim/lua/lsp.lua @@ -0,0 +1,22 @@ +-- Remove Global Default Key mapping +vim.keymap.del("n", "grn") +vim.keymap.del("n", "gra") +vim.keymap.del("n", "grr") +vim.keymap.del("n", "gri") +vim.keymap.del("n", "gO") + +-- Create keymapping +-- LspAttach: After an LSP Client performs "initialize" and attaches to a buffer. +vim.api.nvim_create_autocmd("LspAttach", { + callback = function(args) + local keymap = vim.keymap + local lsp = vim.lsp + local bufopts = { noremap = true, silent = true } + + keymap.set("n", "gr", lsp.buf.references, bufopts) + keymap.set("n", "gd", lsp.buf.definition, bufopts) + keymap.set("n", "<space>rn", lsp.buf.rename, bufopts) + keymap.set("n", "K", lsp.buf.hover, bufopts) + keymap.set("n", "<space>f", lsp.buf.format, bufopts) + end +}) |