vim:无法在 Debian Stretch 中复制和粘贴

Rui*_*iro 4 vim debian

升级到 Debian Stretch 后,我们无法在 MacOS Sierra 和 Windows 客户端中使用鼠标进行复制和粘贴。

我尝试了多种解决方案,包括来自该线程的解决方案,但没有取得多大成功。当鼠标 (:set mouse=a) 打开时,vim 的复制粘贴不起作用?

我尝试将其放入/etc/vim/vimrc.local以下几行:

set vb t_vb=
set mouse="" 
Run Code Online (Sandbox Code Playgroud)

此外mouse=""mouse="a" mouse="r"以及mouse="v",并且没有一个解决方案有效。

做什么似乎有效,它在文件中注释/usr/share/vim/vim80/defaults.vim以下几行:

"if has('mouse')
"  set mouse=a
"endif
Run Code Online (Sandbox Code Playgroud)

一旦这些行被注释掉,我们就可以再次复制和粘贴。

但是,这些更改将在下次vim升级中丢失。

对于更永久的解决方案有什么建议吗?

小智 5

做:

sudo touch /etc/vim/vimrc.local
Run Code Online (Sandbox Code Playgroud)

然后编辑文件:

" This file loads the default vim options at the beginning and prevents
" that they are being loaded again later. All other options that will be set,
" are added, or overwrite the default settings. Add as many options as you
" whish at the end of this file.

" Load the defaults
source /usr/share/vim/vim80/defaults.vim

" Prevent the defaults from being loaded again later, if the user doesn't
" have a local vimrc (~/.vimrc)
let skip_defaults_vim = 1


" Set more options (overwrites settings from /usr/share/vim/vim80/defaults.vim)
" Add as many options as you whish

" Set the mouse mode to 'r'
if has('mouse')
  set mouse=r
endif
Run Code Online (Sandbox Code Playgroud)

这会将规则应用于整个系统和所有用户。在 Debian 9.3 上测试。


归档时间:

查看次数:

14323 次

最近记录:

6 年,5 月 前