I am trying to make it so, in the normal mode :

  • some modifier + scroll upward triggers revert u
  • some modifier + scroll downward triggers redo <C-R>

Edit : I do mean mouse scroll

some modifier being left-alt, but that's not the important part.

Is there a way to do that ?

Edit 2 : this question is a duplicate of Console vim(x): Can I map the scroll wheel to undo--redo?


1 Answer 1


Here is my guess:

nnoremap <leader><Up> :execute "normal u"<cr>
nnoremap <leader><Down> :execute "normal ^R"<cr>

To see all mappings, look at key-codes:

:h keycodes
  • <up> <down> <left> and <right> are the keycodes for according arrows ! I meant "scrolling upward" or "scrolling downward" Feb 14, 2019 at 16:24

Not the answer you're looking for? Browse other questions tagged or ask your own question.