Solution to "VI/VIM cannot use the system clipboard (clipboard)" in the Docker container

The configuration file in the docker container cannot be pasted by vim, and ( insert ) VISUAL is displayed at the bottom . Normally it should display insert! ! !

The operating system in the docker container is ubuntu . There is no vim by default. You need to install it yourself;

Option 1: Install source

1. Update source

apt-get update

2. Install vim

apt-get install vim

At this time, the system does not support the clipboard

vim --version | grep clipboard

3. Installation

apt-get install vim vim-scripts vim-gtk

View again

vim --version | grep clipboard
Note: The plus sign (+) in front of clipboard and xterm_clipboard
means support;
the minus sign (-) means not supported.

Option 2: Change the configuration

vim /usr/share/vim/vim80/defaults.vim

Line 70

在mouse=a的=前面加个-1

as follows:

ifhas(‘mouse’)
set mouse-=a
endif

Guess you like

Origin blog.csdn.net/weixin_54514751/article/details/129724017