Some user wrote:
Hello,
I'm using gVim on Windows and like it so far. There is one minor annoyance:
when I scroll with the mouse wheel (I'm trying to use only keyboard but
it'll take me a lot of time trying to break habit of using mouse to scroll),
the cursor moves with the screen. Is there a setting I can set that will
allow the cursor to remain fixed at one position when scrolling with the
mouse wheen/scrollbar?
Thanks,
" normal and visual
:noremap <MouseUp> 3<C-E>3j
:noremap <MouseDown> 3<C-Y>3k
" not command-line
:cunmap <MouseUp>
:cunmap <MouseDown>
" insert mode
:inoremap <MouseUp> <C-O>3<C-E><C-O>3j
:inoremap <MouseDown> <C-O>3<C-Y><C-O>3k
This maps the mouse wheel to scroll the display and move the cursor, so that
the cursor appears immobile on-screen (possibly barring edge conditions near
the top and bottom of the file).
Best regards,
Tony.
--
Sharks are as tough as those football fans who take their shirts off
during games in Chicago in January, only more intelligent.
-- Dave Barry, "Sex and the Single Amoeba: What Every
Teen Should Know"