Someone wrote a SIMBL plugin called MouseTerm that passes through all mouse events to the terminal. After that, all you have to do is enable mouse support in vim, and Boom goes the Dynamite!
Steps:
1. Install SIMBL
2. Install MouseTerm
3. Edit your .vimrc:
" mouse support
if has("mouse")
set mouse=a
set ttymouse=xterm2
endif
4. That's it! Now you can use the mouse for clicking, selection, and scrolling!
One thing I did notice is that you can no longer copy text to the Mac clipboard from Vim in this mode. It's easy to toggle mouse event passing with Cmd-Shift-M (or menu item Shell > Send Mouse Events).
I used the ttymouse=xterm2 since it is the one recommended for use with gnu screen. ttymouse=xterm didn't behave properly for me when vim was used inside of screen.
Thanks to Ayaz for this article on "Using mouse inside Vim on Terminal.app" which got me pointed in the right direction.
0 comments:
Post a Comment