i'm not very experienced in VIM. i'm using VIM with putty, and i often use mouse scroll and move text cursor with mouse. also sometimes i need to paste some code from windows clipboard, so i have to type ":set mouse=" to turn off mouse handling in VIM, paste the code with right mouse button and then turn mouse handling on again with ":set mouse=a". i'm looking for a better way to do it.
<Shift> + LeftMouse to do a selection,
<Shift> + RightMouse to paste your code as usual (set mouse="" state)
Here's an excerpt from my vimrc. It maps a key to toggle the mouse mode between vim and external handling ("a" and ""). It's mapped twice so that it works both in normal and input mode, and it echoes which mode you've ended up in (though that'll be obscured in insert mode if you have showmode turned on).
" toggle between terminal and vim mouse map <silent><F12> :let &mouse=(&mouse == "a"?"":"a")<CR>:call ShowMouseMode()<CR> imap <silent><F12> :let &mouse=(&mouse == "a"?"":"a")<CR>:call ShowMouseMode()<CR> function ShowMouseMode() if (&mouse == 'a') echo "mouse-vim" else echo "mouse-xterm" endif endfunction
Most VIM purists would tell you: "Stop using the mouse for movement then".
Hopefully someone who uses the mouse in VIM can help you with making the mouse stuff work better, but if you're interested, I suggest the following helpful key combos to make moving your cursor/view easier in VIM:
h,j,k,l: left, down, up, right. H: Move cursor to the top of the visible screen. L: Move cursor to the bottom of the visible screen. G: Move cursor to the bottom of the file. gg: Move cursor to the top of the file. $: Move cursor to the end of the current line. 0: Move cursor to the very beginning of the current line. ^: Move cursor to the first non-whitespace character of the current line. Ctrl + f: Move forward/down one page. Ctrl + b: Move back/up one page.
Hopefully those help free you from the mouse, if you're interested, if not, hopefully someone has some mouse suggestions.
This tutorial here is quite good http://www.vi-improved.org/tutorial.php
It's a log of someone teaching someone over chat so it goes through things slowly.