I use (neo)vim with mouse=a
and 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?
0
0
Try the following: hold down shift key before you press mouse button.
-
Since I use neovim in the terminal this results in my terminal trying to select text. – 0x539 Jun 22 at 14:23
-
-
-
-
scrolloff
set a minimal number of lines below or above the cursor line. Disabling the option "only for mouse click" would mean that you don't have this minimal number of lines between the cursor line and the edge of the screen but how would vim know when to set this minimal number of lines again? – statox♦ Apr 7 at 17:25nnoremap <leftmouse> :set scrolloff=0<CR><leftmouse>
to disablescrolloff
when you click and then remap the motion you want to reenable the option but that seems very impractical. – statox♦ Apr 7 at 17:29