Mapping behavior in vim

5 views
Skip to first unread message

Ven Tadipatri

unread,
Nov 22, 2025, 12:48:02 PM (18 hours ago) Nov 22
to vim...@googlegroups.com
Hi,
  I've installed git gutter for Vim, and I was hoping to get the navigation working. After a long conversation with ChatGPT, and no working solution, I was hoping to get some help from real vim users with mapping "bracket c" to navigate to the next hunk (using Vim 9.1 on WSL). This is what I tried in my ~/.vimrc

" GitGutter hunk navigation
"Failed attempt 1
nmap ]c <Plug>(GitGutterNextHunk)
nmap [c <Plug>(GitGutterPrevHunk)

"Failed attempt 2
nnoremap ]c <Plug>(GitGutterNextHunk)
nnoremap [c <Plug>(GitGutterPrevHunk)

"Failed attempt 3
autocmd VimEnter * nnoremap ]c <Plug>(GitGutterNextHunk)
autocmd VimEnter * nnoremap [c <Plug>(GitGutterPrevHunk)

If I try ":GitGutterNextHunk", it works just fine. But using the shortcut, the screen displays invisible text at the bottom of the screen. If I continue to type, then hit backspace, it shows:

:<C-U>execute v:count1 . 'GitGutterNextHunk'<CR>

Can someone provide any insight into this quirky vim behavior?

Thanks,
Ven
Reply all
Reply to author
Forward
0 new messages