diff options
author | Gregory Anders <8965202+gpanders@users.noreply.github.com> | 2024-10-11 11:56:21 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-11 11:56:21 -0500 |
commit | 26e765f905cbf1df18cfc825bad9b1b982f517ea (patch) | |
tree | 0693fb5f969ee8f07020e7dde001f9dcd029ac25 | |
parent | d3193afc2559e7d84ed2d76664a650dc03b4c6ef (diff) | |
download | rneovim-26e765f905cbf1df18cfc825bad9b1b982f517ea.tar.gz rneovim-26e765f905cbf1df18cfc825bad9b1b982f517ea.tar.bz2 rneovim-26e765f905cbf1df18cfc825bad9b1b982f517ea.zip |
feat(defaults): map gri to vim.lsp.buf.implementation() (#30764)
Continuing the default LSP maps under the "gr" prefix. Mnemonic: "i" for
"implementation".
-rw-r--r-- | runtime/doc/lsp.txt | 3 | ||||
-rw-r--r-- | runtime/doc/news.txt | 1 | ||||
-rw-r--r-- | runtime/doc/vim_diff.txt | 1 | ||||
-rw-r--r-- | runtime/lua/vim/_defaults.lua | 6 |
4 files changed, 9 insertions, 2 deletions
diff --git a/runtime/doc/lsp.txt b/runtime/doc/lsp.txt index 419f583c36..20503d46b8 100644 --- a/runtime/doc/lsp.txt +++ b/runtime/doc/lsp.txt @@ -71,11 +71,12 @@ options are not restored when the LSP client is stopped or detached. - |K| is mapped to |vim.lsp.buf.hover()| unless |'keywordprg'| is customized or a custom keymap for `K` exists. - *grr* *gra* *grn* *i_CTRL-S* + *grr* *gra* *grn* *gri* *i_CTRL-S* Some keymaps are created unconditionally when Nvim starts: - "grn" is mapped in Normal mode to |vim.lsp.buf.rename()| - "gra" is mapped in Normal and Visual mode to |vim.lsp.buf.code_action()| - "grr" is mapped in Normal mode to |vim.lsp.buf.references()| +- "gri" is mapped in Normal mode to |vim.lsp.buf.implementation()| - CTRL-S is mapped in Insert mode to |vim.lsp.buf.signature_help()| If not wanted, these keymaps can be removed at any time using diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt index 1d364ba29a..1b311330b0 100644 --- a/runtime/doc/news.txt +++ b/runtime/doc/news.txt @@ -139,6 +139,7 @@ DEFAULTS • Mappings: • |grn| in Normal mode maps to |vim.lsp.buf.rename()| • |grr| in Normal mode maps to |vim.lsp.buf.references()| + • |gri| in Normal mode maps to |vim.lsp.buf.implementation()| • |gra| in Normal and Visual mode maps to |vim.lsp.buf.code_action()| • CTRL-S in Insert mode maps to |vim.lsp.buf.signature_help()| • Mouse |popup-menu| includes an "Open in web browser" item when you right-click diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt index 0a42acffb9..137e78801b 100644 --- a/runtime/doc/vim_diff.txt +++ b/runtime/doc/vim_diff.txt @@ -150,6 +150,7 @@ of these in your config by simply removing the mapping, e.g. ":unmap Y". - |grn| - |grr| - |gra| + - |gri| - <C-S> |i_CTRL-S| - ]d |]d-default| - [d |[d-default| diff --git a/runtime/lua/vim/_defaults.lua b/runtime/lua/vim/_defaults.lua index 6cad1dbca9..8e850f4cd3 100644 --- a/runtime/lua/vim/_defaults.lua +++ b/runtime/lua/vim/_defaults.lua @@ -157,7 +157,7 @@ do --- client is attached. If no client is attached, or if a server does not support a capability, an --- error message is displayed rather than exhibiting different behavior. --- - --- See |grr|, |grn|, |gra|, |i_CTRL-S|. + --- See |grr|, |grn|, |gra|, |gri|, |i_CTRL-S|. do vim.keymap.set('n', 'grn', function() vim.lsp.buf.rename() @@ -171,6 +171,10 @@ do vim.lsp.buf.references() end, { desc = 'vim.lsp.buf.references()' }) + vim.keymap.set('n', 'gri', function() + vim.lsp.buf.implementation() + end, { desc = 'vim.lsp.buf.implementation()' }) + vim.keymap.set('i', '<C-S>', function() vim.lsp.buf.signature_help() end, { desc = 'vim.lsp.buf.signature_help()' }) |