My .vimrc
has the following lines
set mouse=a map <ScrollWheelUp> <C-Y> map <ScrollWheelDown> <C-E>
But when I scroll up using the mouse wheel, I'd get the text above Vim. For example, I'd get my terminal session text if I'd just started Vim. I'm initially experimenting with the mouse scroll wheel on help files, then move on to other files, hence the a
option.
What else do I need to set? I'm using Snow Leopard and Vim 7.3 inside a Terminal.
Here, I just did a wheel up. See the Terminal session at the top.
You can make Vim scroll the text using the shifted up/down arrows by mapping Shift-Up to Ctrl-Y and Shift-Down to Ctrl-E. Shift-Down will then scroll down (like moving a scroll-bar down, or like moving a cursor at the bottom of a window down), and Shift-Up will then scroll up (like moving a scroll-bar up, etc).
Start a selection using v before you start scrolling. Then the start of the selection stays put and only the end of the selection moves as you scroll. Then make sure to Shift +click instead of just clicking to set the end position.
Of course you can advance by full screens using Ctrl+F and Ctrl+B . You can directly go to a particular line by typing the line number in normal mode and pressing capital G .
Install Imwheel Manually Now, paste the script into Text Editor and name the file mousewheel.sh. Doing so will open the dialog box to set mouse scroll speed on your terminal screen, with the help of which you can change your mouse scroll speed in Ubuntu.
Using vim in iTerm 2 in OS X, you can :set mouse=a
to enable scrolling with the scroll wheel, as well as selecting to enter Visual mode, etc.
If you use iTerm, you can simply execute the following command:
defaults write com.googlecode.iterm2 AlternateMouseScroll -bool true
This will enable mouse scrolling without having to add anything in your .vimrc
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With