![choose where smoothscroll goes choose where smoothscroll goes](https://i.pinimg.com/736x/28/d1/f4/28d1f4325345477c32d222fba62a86aa.jpg)
You can increase this up or down as it suits you.Į) Lastly execute normal M brings the cursor at the middle of the screen. You will want to decrease the number of lines for a smoother effect.
![choose where smoothscroll goes choose where smoothscroll goes](https://s3.amazonaws.com/docs-content.theme.co/basics/extensions/smooth-scroll/images/smooth-scroll-06.png)
Click on the Wheel tab, and you can adjust the number of lines per wheel notch. So for me range(3, &scroll, 2) returns which means that the loop will run 7 times (+1 time before entering the loop).ĭ) The sleep 7m sets a 7 milliseconds delay for a smoother experience and also redraws the screen. Click Start, click Control Panel, and click Mouse under the Hardware and Sound category. Check :set scroll? to see what value is set for you.
![choose where smoothscroll goes choose where smoothscroll goes](http://shamrockroseaussies.com/yahoo_site_admin/assets/images/DSC_0706.10500600_std.jpg)
If you like the scrolling to go a bit smoother, you can use these mappings:ī) The function automates this by taking a flag that indicates whether to scroll up (1) or down (0) and uses ternary operator to take an appropriate course of action Ctrl + Y or Ctrl + EĬ) The loop runs from 3 to the value set for scroll which determines how many lines to scroll through when using normal Ctrl + D and Ctrl + U actions.
#Choose where smoothscroll goes manual
Tl dr It basically replaces the normal Ctrl + D and Ctrl + U which instantly scrolls up or down by a set number of lines with a more delayed version for a smoother experience.Ī) The function modifies the original idea described in vim help manual for smooth scrolling which is to basically replace Ctrl+D and Ctrl + U with a bunch of Ctrl + Y and Ctrl + E ( :help scroll-smooth) Smooth scrolling scroll-smooth The repo OP linked credits to this answer from SO as the original source which was modified a little.Īlso just to give a brief idea on what's happening in the function for those who are not familiar with vim and want to customize some of these.