I use (neo)vim with
scrolloff=5. Clicking on one of the top or bottom five lines with the mouse causes the screen to jump (so that the new cursor position is more centered), which distracts me. Is there any way to disable "
so=5" for mouse-clicking only?
If you want to avoid test scrolling when you mouse-click at edges of the window, you can simply set scrolloff to 0, see comments in
" Show a few lines of context around the cursor. Note that this makes the " text scroll if you mouse-click near the start or end of the window. set scrolloff=5
Note that you have to
set scrolloff=0 after sourcing the above
defaults.vim if you are using
.vimrc copied from
vimrc_example.vim, on Ubuntu for example, set it like:
" Get the defaults that most users want. source $VIMRUNTIME/defaults.vim set scrolloff=0