1.vim 與 neovim 使用系統(tǒng)剪切板的不同
vim支持clipboard和xterm_clipboard的特性,并且用"+"和"*"這兩個(gè)寄存器使用系統(tǒng)剪切板谷誓。而nvim并不支持這一特性。幫助文件中有如下敘述:
Nvim has no direct connection to the system clipboard. Instead it depends on
a provider which transparently uses shell commands to communicate with the
system clipboard or any other clipboard "backend".
2.想要使用系統(tǒng)剪切板捍歪,最簡(jiǎn)單的方法就是安裝xsel或xclip程序糙臼。
sudo apt install xclip
安裝完后啟動(dòng)nvim,復(fù)制一行('Y')变逃,檢查register揽乱,可以看到在"和+寄存器里已經(jīng)有這行內(nèi)容了。在終端中损拢,直接SHIFT+CTRL+V撒犀, 就可以粘貼了。反過(guò)來(lái)隧膏,在系統(tǒng)中復(fù)制完之后嚷那,可以看到'*'和'+'寄存器中已經(jīng)有復(fù)制的內(nèi)容魏宽,在nvim中直接"*p 或"+p就可以了决乎。