scrolling with vim not working correctly

2,665 views
Skip to first unread message

David Rees

unread,
Jun 7, 2016, 1:18:56 PM6/7/16
to iterm2-discuss
When I open vim and scroll I get some weird behavior. It seems to do a combination of scrolling back through the vim doc and scrolling back in the history.

Here is a screencast. I open a simple file with a number on each row. I page up and down a bit with page up/down which works fine. When I start to scroll you can see the vim edit bar scroll in from the top, then lower lines from the vim file (even though I am scrolling up), then the edit bar again, then eventually bash history from outside the vim file.

I have a debug log I can email also, just let me know where to send it.

Thanks,
dave

George Nachman

unread,
Jun 7, 2016, 3:57:53 PM6/7/16
to iterm2-...@googlegroups.com
It looks like you're using the scroll wheel, so iTerm2 is scrolling through your history. I guess mouse reporting is not enabled in vim. Try doing :set mouse=a and then the scroll wheel ought to move you around vim.

If you'd prefer the scroll wheel to send arrow keys without using mouse reporting, turn on "Prefs>Advanced>Scroll wheel sends arrow keys in alternate screen mode" and turn off "Prefs>Profiles>Terminal>Disable save/restore alternate screen".

--
You received this message because you are subscribed to the Google Groups "iterm2-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to iterm2-discus...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

David Rees

unread,
Jun 8, 2016, 5:27:05 PM6/8/16
to iterm2-...@googlegroups.com
So just after you emailed you I got a yellow message across the top of iTerm2 saying something like "do you want to scroll when in interactive mode like this one" (sorry I didn't screenshot it). Not sure why I suddenly got that message yesterday. After I said yes to it scrolling started working in vim. It seems by using the arrow key.

On top of that I did the the "set mouse=a" which seems to have given me normal scrolling.

Thanks!



--
You received this message because you are subscribed to a topic in the Google Groups "iterm2-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/iterm2-discuss/MIsBXP67Imk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to iterm2-discus...@googlegroups.com.

David Rees

unread,
Jun 11, 2016, 11:12:01 PM6/11/16
to iterm2-discuss
One follow up on this. With "set mouse=a" I lose the copy/paste to clipboard using Ctrl-C/Ctrl-V. I have found that I can use Alt with the mouse to copy/paste. But I'm wondering if there is a better solution. This blog seems to imply yes, but I can't find the "modern parser" option it lists - http://aubreypwd.com/copy-paste-not-working-in-iterm2-using-vim-and-system-keyboard-fix/

On a related note I'm finding that I can't yank/paste (y/p) into my OSX clipboard. I have tried "set clipboard=unnamed", but that doesn't seem to work. My vim does have +clipboard and +xterm_clipboard.

Sorry to ask what must be a common question, but I have spent a good chunk of time on this already trying all the various options. None seem to really do the job, and I feel like I am so close :).

Thanks!
d


On Wednesday, June 8, 2016 at 2:27:05 PM UTC-7, David Rees wrote:
So just after you emailed you I got a yellow message across the top of iTerm2 saying something like "do you want to scroll when in interactive mode like this one" (sorry I didn't screenshot it). Not sure why I suddenly got that message yesterday. After I said yes to it scrolling started working in vim. It seems by using the arrow key.

On top of that I did the the "set mouse=a" which seems to have given me normal scrolling.

Thanks!


On Tue, Jun 7, 2016 at 12:57 PM, George Nachman wrote:
It looks like you're using the scroll wheel, so iTerm2 is scrolling through your history. I guess mouse reporting is not enabled in vim. Try doing :set mouse=a and then the scroll wheel ought to move you around vim.

If you'd prefer the scroll wheel to send arrow keys without using mouse reporting, turn on "Prefs>Advanced>Scroll wheel sends arrow keys in alternate screen mode" and turn off "Prefs>Profiles>Terminal>Disable save/restore alternate screen".

George Nachman

unread,
Jun 12, 2016, 9:03:01 PM6/12/16
to iterm2-...@googlegroups.com
The modern parser option is outdated (the old parser is gone), but that's a red herring. Setting clipboard=unnamed will cause vim to copy to the system pasteboard (at least, it does for me). This won't work if you're ssh'ed somewhere, of course. TBH this is not an area of vim I know much about, but it's not interacting with iTerm2, so it's possible you've hit some odd behavior in vim.


David Rees

unread,
Jun 13, 2016, 3:24:18 PM6/13/16
to iterm2-...@googlegroups.com
Ah, I had incorrectly assumed that somehow vim interacted with the clipboard via the terminal, but it seems that clipboard access happens separately. There seem to be some good options using xclip with X Forwarding that I will try... 

Thanks!

--
You received this message because you are subscribed to a topic in the Google Groups "iterm2-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/iterm2-discuss/MIsBXP67Imk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to iterm2-discus...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages