Smooth scroll with mouse wheel (`<ScrollWheelUp>`/`<ScrollWheelDown>`)
karb94 opened this issue · 4 comments
karb94 commented
Simply binding <ScrollWheelUp>
/<ScrollWheelDown>
to the scroll function doesn't quite work as there's some stuttering from time to time. I need to investigate what is the issue is and see if it can be fixed.
vaibd commented
justinhj commented
I think the link should be:
https://stackoverflow.com/questions/4064651/what-is-the-best-way-to-do-smooth-scrolling-in-vim
ignamartinoli commented
For now I fixed it with this
vim.keymap.set('n', '<ScrollWheelUp>', '<C-y>')
vim.keymap.set('n', '<ScrollWheelDown>', '<C-e>')
vim.keymap.set('i', '<ScrollWheelUp>', '<C-y>')
vim.keymap.set('i', '<ScrollWheelDown>', '<C-e>')
vim.keymap.set('v', '<ScrollWheelUp>', '<C-y>')
vim.keymap.set('v', '<ScrollWheelDown>', '<C-e>')
require 'neoscroll'.setup {
mappings = { '<C-y>', '<C-e>' },
}
champignoom commented
Mapping each ScrollWheel events to <C-y>/<C-e>
will make the scrolling in a constant slow speed.
A better way would be to first count the number of incoming ScrollWheel events, calculate the offset, and then scroll only once.