sách gpt4 ai đã đi

ubuntu - 在选项卡或终端之间轻松复制/粘贴 vim

In lại 作者:行者123 更新时间:2023-12-04 18:44:42 25 4
mua khóa gpt4 Nike

我应该在 vimrc 中添加哪一行以便在终端之间或不同文件/选项卡之间轻松复制/粘贴?

我现在有:

" Better copy & paste
set pastetoggle=
set clipboard=unnamed

我将 vim 用作 Python IDE,到目前为止从未遇到过问题,但它似乎无法处理 2 个不同文件/选项卡之间的复制/粘贴。

我应该添加哪一行?你用什么在不同的终端或标签之间复制/粘贴?

1 Câu trả lời

这是个人喜好,但我使用标准:

"+y
"+p

我喜欢它默认工作,对我来说,它已成为一个“手指宏”,我可以轻松快速地输入。如果您愿意,您可以将它们分配给其他东西,但我发现这可以正常工作。

在下面的 wiki 中链接了一个 vimtip,它将序列重新映射到以下内容:
vmap  "ay
nmap "aP
imap "ap
nmap "ayiw

vimwiki 解释: https://vim.fandom.com/wiki/Copy,_cut_and_paste

unlike most text editors, Vim distinguishes between its own registers and the system clipboard. By default, Vim copies to, cuts to, and pastes from its own default register, called the unnamed register ("", also called quotequote) instead of the system clipboard.

Assuming Vim was compiled with clipboard access, it is possible to access the "+ or "* registers, which can modify the system clipboard. In this case, one can copy with e.g. "+y in visual mode, or "+y{motion} in normal mode, and paste with e.g. "+p.

If your installation of Vim was not compiled with clipboard support, you must either install a package that has clipboard support, or use an external command such as xclip as an intermediary. See Accessing the system clipboard for detailed information.

关于ubuntu - 在选项卡或终端之间轻松复制/粘贴 vim,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54872056/

25 4 0
行者123
Hồ sơ cá nhân

Tôi là một lập trình viên xuất sắc, rất giỏi!

Nhận phiếu giảm giá Didi Taxi miễn phí
Mã giảm giá Didi Taxi
Giấy chứng nhận ICP Bắc Kinh số 000000
Hợp tác quảng cáo: 1813099741@qq.com 6ren.com