Vim鼠标滚轮垂直滚动只需一行

Man*_*d3r 3 vim mouse

如何调整我的vimrc以使垂直滚动更平滑?我想实现鼠标滚轮的一次迭代只滚动一行而不是三行.

Ken*_*ent 6

尝试将此添加到您的vimrc中:

   map <ScrollWheelUp> <C-Y>
   map <ScrollWheelDown> <C-E>
Run Code Online (Sandbox Code Playgroud)

PS最好的解决方案是:不要使用那个鼠标滚轮......


Ing*_*kat 5

相关信息见:help scroll-mouse-wheel:

For the Win32 GUI the scroll action is hard coded.  It works just like
dragging the scrollbar of the current window.  How many lines are scrolled
depends on your mouse driver.  If the scroll action causes input focus
problems, see intellimouse-wheel-problems.

For the X11 GUIs (Motif, Athena and GTK) scrolling the wheel generates key
presses <ScrollWheelUp>, <ScrollWheelDown>, <ScrollWheelLeft> and
<ScrollWheelRight>.
Run Code Online (Sandbox Code Playgroud)

所以,如果你在Windows上,你只能通过你的驱动程序全局影响它,而在X上,你可以做到

:map <ScrollWheelUp> <C-Y>
Run Code Online (Sandbox Code Playgroud)

等等