Hacker Newsnew | comments | show | ask | jobs | submit login

The most valuable two settings I know for this are:

set ttymouse=xterm2

set mouse=n

Now you can use the mouse to resize buffers and click on tabs. You can even click to focus on a buffer and don't need to meta-press your way around when you just want to browse things. Go on, click on topics inside of the help, assign the right click to supertab[1], navigate NerdTree[2] like the explorer clone it is. Collapse and expand code folds[3] like a 21st century digital boy.[4]

Furthermore, your scrollwheel all of a sudden now scrolls through your document in putty, xterm, screen, rxvt, tmux, iterm; all of them. Yes, total heresy, I know.

The only thing more important than this is doing a visual selection[5] and then doing a :!(any program) like say: fmt, sort, mail, python, rdoc, indent, bc ...

I know what you are thinking; "But kristopolous, this is so easy; it is not possible". Relax my friend, this is unix, you know this.

PS: Here's my custom vim builder/environment maker: https://github.com/kristopolous/vimbuild

[1] http://www.vim.org/scripts/script.php?script_id=1658

[2] http://www.vim.org/scripts/script.php?script_id=1643

[3] http://vimdoc.sourceforge.net/htmldoc/fold.html

[4] http://www.youtube.com/watch?v=ZN6kCgMUjFw

[5] http://vimdoc.sourceforge.net/htmldoc/visual.html




The mouse?? But what for?

-----


Do you mean `set mouse=a`? `n` just makes it work while in normal mode iirc, while `a` should work in any mode.

-----


I was excited for a minute, but the ttymouse change did nothing for me on Mac OS Terminal with vim 7.3.

-----


I thought this was fixed in Lion, but I believe it used to be the case that OS X terminal didn't support mouse. Check out iTerm 2 instead.

-----


Thanks :) That seems to have done the trick. Now I just need to get my color scheme working right in iTerm. Still pretty new to Mac OS. I'm really a Linux guy.

-----


I always used terminal vim when on Linux, but after I got a macbook (from work - I'd never buy one), I'm pretty happy with MacVim. Give it a shot.

Pretty much everything works out of the box as with the terminal version, you just get a few usability improvements (OS-integrated clipboard, mouse selections create vim selections and vice versa, etc).

-----


iTerm 2 and Homebrew really make OS X a lot more bearable for me

Switching to zsh and oh-my-zsh has helped a lot too

-----


> OS X terminal didn't support mouse

It does not, you have to use the MouseTerm SIMBL plugin.

-----


ttymouse=xterm2 doesn't work with tmux. And generally, vim will set 'ttym' correctly for you.

-----


"ttymouse=xterm2 doesn't work with tmux"

Works For Me™

Using lilyterm[0], a libvte based terminal.

[0] http://lilyterm.luna.com.tw/

-----


Pretty sure it used to not work--glad to see that it does now. Thanks.

-----




Guidelines | FAQ | Support | API | Lists | Bookmarklet | DMCA | Y Combinator | Apply | Contact

Search: