I have set a high value for scrolloff, which works really well for me when I am moving around with the keyboard. However, any time I try to select something with the mouse in an off-center line (so that I can copy some text), that line jumps to the center, preventing me from selecting that text. Is there a way to keep the scrolloff setting but prevent a mouse click from moving the cursor to that line?
I don't believe that there is a way to use an autocmd to set scrolloff=0 when using the mouse, but you could map a key to toggle between scrolloff=0 and scrolloff=50(or whatever value you are using) and just use that mapping before selecting text:
map <silent> <Leader>m :exec &scrolloff==0? "set scrolloff=50" : "set scrolloff=0"<CR>