1

This question already has an answer here:

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?

marked as duplicate by Community Feb 14 at 16:55

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

0

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" – Pierre-Antoine Guillaume Feb 14 at 16:24

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