commit cb247e06f0ba19ca55252de0aebe249ed4c3635f
parent 90d15227c55c9ae6e4d52884817db75e4329792b
Author: msaher <77233589+msaher@users.noreply.github.com>
Date: Sun, 30 Mar 2025 22:33:37 +0300
fix(defaults): visual-mode [[,]] for :terminal shell prompts #33201
Problem:
:terminal shell prompt jump mappings ]]/[[ don't work in visual mode.
Solution:
Also define them for in visual mode.
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/runtime/lua/vim/_defaults.lua b/runtime/lua/vim/_defaults.lua
@@ -622,10 +622,10 @@ do
end
vim.wo[0][0].winhighlight = winhl .. 'StatusLine:StatusLineTerm,StatusLineNC:StatusLineTermNC'
- vim.keymap.set('n', '[[', function()
+ vim.keymap.set({ 'n', 'x' }, '[[', function()
jump_to_prompt(nvim_terminal_prompt_ns, 0, args.buf, -vim.v.count1)
end, { buffer = args.buf, desc = 'Jump [count] shell prompts backward' })
- vim.keymap.set('n', ']]', function()
+ vim.keymap.set({ 'n', 'x' }, ']]', function()
jump_to_prompt(nvim_terminal_prompt_ns, 0, args.buf, vim.v.count1)
end, { buffer = args.buf, desc = 'Jump [count] shell prompts forward' })
end,