To solve the problem can not copy the selected text vim

Reprinted from my independent blog: https://liushiming.cn/2020/01/18/vim-copy-issue-in-iterm2/

Outline

Recently discovered in iterm2the open vim, select the text with the mouse, and use command + ctext 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

  1. In iterm2use catcommand to print a file, and then use the mouse to select command + cnormal copy.
  2. But by vimopening the file, select the text with a command + ccopy, but not copy.
  3. And when the mouse to click on vimthe text, vimautomatically becomes the visualmode.

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

Guess you like

Origin www.cnblogs.com/huahuayu/p/12235240.html
Recommended