back to listing index

Vim can't scroll in iTerm2

[web search]
Original source (stackoverflow.com)
Tags: vim mouse
Clipped on: 2016-03-02

My vim can't scroll in iTerm2 even set mouse=a has added in .vimrc file.

Within tmux, however, vim's scroll function works correctly.

What's wrong with my vim?

asked Aug 19 '15 at 19:01
Image (Asset 3/4) alt=
Douglas Su
520216
   upvote
  flag
how do you scroll? mouse? arrow keys? or hjkl? or ctrl+?? – HuStmpHrrr Aug 19 '15 at 19:04
   upvote
  flag
Please run vim --version from the command-line, or in Vim, enter :version and provide output. – Valery Viktorovsky Aug 19 '15 at 19:21
   upvote
  flag
On a side note, using the mouse to scroll is an antipattern in both Vim and tmux, and nullifies the advantages of using such tools. – zool Aug 22 '15 at 9:28
up vote 6 down vote accepted

Recent versions of vim support the "SGR" protocol, you can add code bellow to your .vimrc:

set mouse=a
if has("mouse_sgr")
    set ttymouse=sgr
else
    set ttymouse=xterm2
end
answered Aug 19 '15 at 19:22
Image (Asset 4/4) alt=
Valery Viktorovsky
3,40731527
1 upvote
  flag
Woo, really cool, it works, thx! – Douglas Su Aug 20 '15 at 2:30

Your Answer

asked

6 months ago

viewed

350 times

active

6 months ago

Technology Life / Arts Culture / Recreation Science Other
  1. Stack Overflow
  2. Server Fault
  3. Super User
  4. Web Applications
  5. Ask Ubuntu
  6. Webmasters
  7. Game Development
  8. TeX - LaTeX
  1. Programmers
  2. Unix & Linux
  3. Ask Different (Apple)
  4. WordPress Development
  5. Geographic Information Systems
  6. Electrical Engineering
  7. Android Enthusiasts
  8. Information Security
  1. Database Administrators
  2. Drupal Answers
  3. SharePoint
  4. User Experience
  5. Mathematica
  6. Salesforce
  7. ExpressionEngine® Answers
  8. more (13)
  1. Photography
  2. Science Fiction & Fantasy
  3. Graphic Design
  4. Movies & TV
  5. Seasoned Advice (cooking)
  6. Home Improvement
  7. Personal Finance & Money
  8. Academia
  9. more (9)
  1. English Language & Usage
  2. Skeptics
  3. Mi Yodeya (Judaism)
  4. Travel
  5. Christianity
  6. Arqade (gaming)
  7. Bicycles
  8. Role-playing Games
  9. more (21)
  1. Mathematics
  2. Cross Validated (stats)
  3. Theoretical Computer Science
  4. Physics
  5. MathOverflow
  6. Chemistry
  7. Biology
  8. more (5)
  1. Stack Apps
  2. Meta Stack Exchange
  3. Area 51
  4. Stack Overflow Careers
site design / logo © 2016 Stack Exchange Inc; user contributions licensed under cc by-sa 3.0 with attribution required
rev 2016.3.2.3314