aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/_defaults.lua
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2024-04-28 09:02:18 -0700
committerGitHub <noreply@github.com>2024-04-28 09:02:18 -0700
commit61063653b06bfccac083c0105ecd0c433b3bb8f7 (patch)
treecc59824b630fcce2ebe8c06a89e44cadefe4af5b /runtime/lua/vim/_defaults.lua
parent513fc461957f370f9e89b3cfd56cb03a816d6941 (diff)
downloadrneovim-61063653b06bfccac083c0105ecd0c433b3bb8f7.tar.gz
rneovim-61063653b06bfccac083c0105ecd0c433b3bb8f7.tar.bz2
rneovim-61063653b06bfccac083c0105ecd0c433b3bb8f7.zip
feat(defaults): visual CTRL-R for LSP mappings #28537
Problem: The new LSP "refactor menu" keybinding "crr" is also defined in visual mode, which overlaps with the builtin "c". Solution: Use CTRL-R instead of "crr" for visual mode. fix #28528
Diffstat (limited to 'runtime/lua/vim/_defaults.lua')
-rw-r--r--runtime/lua/vim/_defaults.lua11
1 files changed, 8 insertions, 3 deletions
diff --git a/runtime/lua/vim/_defaults.lua b/runtime/lua/vim/_defaults.lua
index 7166f7a23c..1094f22793 100644
--- a/runtime/lua/vim/_defaults.lua
+++ b/runtime/lua/vim/_defaults.lua
@@ -159,9 +159,14 @@ do
vim.lsp.buf.rename()
end, { desc = 'vim.lsp.buf.rename()' })
- vim.keymap.set({ 'n', 'v' }, 'crr', function()
- vim.lsp.buf.code_action()
- end, { desc = 'vim.lsp.buf.code_action()' })
+ local function map_codeaction(mode, lhs)
+ vim.keymap.set(mode, lhs, function()
+ vim.lsp.buf.code_action()
+ end, { desc = 'vim.lsp.buf.code_action()' })
+ end
+ map_codeaction('n', 'crr')
+ map_codeaction('x', '<C-R>r')
+ map_codeaction('x', '<C-R><C-R>')
vim.keymap.set('n', 'gr', function()
vim.lsp.buf.references()