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

时间:2014-01-08 14:05:11

标签: vim mouse

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

2 个答案:

答案 0 :(得分:5)

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

   map <ScrollWheelUp> <C-Y>
   map <ScrollWheelDown> <C-E>

P.S。最好的解决方案是:不要使用鼠标滚轮......

答案 1 :(得分: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>.

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

:map <ScrollWheelUp> <C-Y>