mirror of
https://github.com/neovim/neovim.git
synced 2025-12-09 16:12:48 +00:00
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
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user