I like using Vim's virtualedit=all feature, but I also like being able to click after the end of a line and have the cursor go directly to the end of the line (instead of going to the exact position I clicked on). Is there a plugin or something that can make Vim's cursor-placement following a mouse click act more intelligently? Ideally, I'd like it to do either of the following:
- Ignore virtualedit preference on mouse-click: On a mouse-click, if the click occurred after the last character on the line, Vim would position the cursor at the end of the line regardless of whether virtualedit is turned on.
- Mode-dependent mouse-click behavior: In normal mode, mouse-click after end-of-line causes cursor to jump to the last character; in insert mode, cursor is positioned under mouse.
- MS-Word style behavior (preferabale): Cursor jumps to end of line on single click, or to virtualedit position on double-click
I know that I could just switch from virtualedit-all to virtualedit-block, but I prefer virtualedit=all for everything except mouse-click behavior. (Actually, I even like being able to position the cursor in the middle of a tab character using a mouse-click, so it's really just the behavior of clicking after the last character in a line.)
P.S. Please, no comments or answers suggesting I just teach myself not to use the mouse. Mouse-usage is one of the reasons I switched from Vim to gVim, because frankly it's extremely convenient sometimes, even if your primary method of movement in a file is keyboard-only.
EDIT: Added mode-dependent idea.