Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Native scrolling and iTerm2 (filippo.io)
35 points by FiloSottile on March 13, 2014 | hide | past | favorite | 11 comments


Nice! Until now I've been using

    imap <silent> <Down> <C-o>gj
    imap <silent> <Up> <C-o>gk
    nmap <silent> <Down> gj
    nmap <silent> <Up> gk
in my .vimrc to give me mousewheel scrolling in vim.

The advantage of putting it in my .vimrc is that I have mousewheel scrolling on the server no matter what computer I log in from.

The disadvantage is that I'm locked into vim and it won't work for someone using, say, emacs.


"set mouse=a" works better


Thank you for posting that. I can now use my mouse wheel on my mac to scroll through documents in vim.

I can also SSH into a Linux box from my mac and the mouse wheel works in the same way.


I have that set... and that's what I meant to copy/paste instead of wrapped line navigation. Oops.


Hmm, I always had scrolling with iTerm2, even with vim, weechat, htop, etc


Yup, same here. Just tested it. I don't understand what's new here; can anyone explain?


This is for applications that put the terminal into a specific mode (or modes) that don't work. The example given in the patch linked to is man, but really it seems to be an issue with most pagers. What the patch does is hook into that mode being set and start translating mouse scroll events to arrow key events. The easiest way to see the problem is to run "man man" and try to scroll up, then scroll down. Up looks like it works because iTerm is saving that output, but scrolling down doesn't. If you do something like "less +200 rfc1918.txt" to start in the middle of the file you'll find that you can't scroll up either.


Yeah, but getting everything to place nicely while inside tmux is a bit of a challenge, especially if you want to have proper clipboard support.


I do run tmux and don't have any problems. For clipboard support, I just use reattach-to-user-namespace.


Mouse wheel scolling works in vim, less etc when using Mintty and cygwin on windows. Worked out of the box.


Does iTerm2 support the old bookmark system from iTerm yet? I'd love to upgrade but that's essential to my workflow.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: