Reprinted from my independent blog: https://liushiming.cn/2020/01/18/vim-copy-issue-in-iterm2/
Outline
Recently discovered in iterm2
the open vim
, select the text with the mouse, and use command + c
text copy selected, but stick out is empty. Charles circle finally iterm2 the official gitlab issue library found a solution in. Enable mouse reporting this setting will be removed.
Version Information
Operating system
Mac os 10.15.2
iterm2
iterm2 3.3.6
iterm2 3.3.7
vim
Vi IMproved 8.1 (2018 May 18, compiled Dec 26 2018 02:33:06)
Steps to Reproduce
- In
iterm2
usecat
command to print a file, and then use the mouse to selectcommand + c
normal copy. - But by
vim
opening the file, select the text with acommand + c
copy, but not copy. - And when the mouse to click on
vim
the text,vim
automatically becomes thevisual
mode.
solution
iterm2 > Preferences > Profiles > Terminal > Enable mouse reporting 去掉勾选
mouse reporting
the role of mouse reporting is editing in vim recognize the mouse, mouse wheel support can view file contents (need to add support for mouse settings in your .vimrc set mouse=a
). Do not support the mouse wheel after closing the mouse reporting.
That you want to use the mouse wheel to how to do?
May be iterm2 > preferences > advance > 搜索mouse > scroll whell down 那里写\j > scroll whell up那里写\k
, is the role of transmitting j / k vim to implement key rolling effect.
More information
Mac comes with the terminal will have this problem, View > Allow Mouse Reporting 去掉勾选
you can