新聞中心
我一直在想,為什么我服務(wù)器上 vim 為什么在鼠標(biāo)方面表現(xiàn)得如此愚蠢:不能像平時(shí)那樣跳轉(zhuǎn)、復(fù)制、粘貼。盡管在 /etc/vim/vimrc.local 中已經(jīng)設(shè)置了。

武陵源ssl適用于網(wǎng)站、小程序/APP、API接口等需要進(jìn)行數(shù)據(jù)傳輸應(yīng)用場(chǎng)景,ssl證書(shū)未來(lái)市場(chǎng)廣闊!成為創(chuàng)新互聯(lián)建站的ssl證書(shū)銷(xiāo)售渠道,可以享受市場(chǎng)價(jià)格4-6折優(yōu)惠!如果有意向歡迎電話(huà)聯(lián)系或者加微信:18982081108(備注:SSL證書(shū)合作)期待與您的合作!
set mouse=
最后我終于知道為什么了,多謝 bug #864074 并且修復(fù)了它。原因是,當(dāng)沒(méi)有 ~/.vimrc 的時(shí)候,vim 在 vimrc.local 之后加載 defaults.vim,從而覆蓋了幾個(gè)設(shè)置。
在 /etc/vim/vimrc 中有一個(gè)注釋?zhuān)m然我沒(méi)有看到)解釋了這一點(diǎn):
" Vim will load $VIMRUNTIME/defaults.vim if the user does not have a vimrc. " This happens after /etc/vim/vimrc(.local) are loaded, so it will override
" any settings in these files. " If you don't want that to happen, uncomment the below line to prevent " defaults.vim from being loaded. " let g:skip_defaults_vim = 1
我同意這是在正常安裝 vim 后設(shè)置 vim 的好方法,但 Debian 包可以做得更好。在錯(cuò)誤報(bào)告中清楚地說(shuō)明了這個(gè)問(wèn)題:如果沒(méi)有 ~/.vimrc,/etc/vim/vimrc.local 中的設(shè)置被覆蓋。這在Debian中是違反直覺(jué)的 – 而且我也不知道其他包中是否采用類(lèi)似的方法。
由于 defaults.vim 中的設(shè)置非常合理,所以我希望使用它,但只修改了一些我不同意的項(xiàng)目,比如鼠標(biāo)。最后,我在 /etc/vim/vimrc.local 中做了以下操作:
if filereadable("/usr/share/vim/vim80/defaults.vim")
source /usr/share/vim/vim80/defaults.vim
endif
" now set the line that the defaults file is not reloaded afterwards! let g:skip_defaults_vim = 1 " turn of mouse
set mouse=
" other override settings go here
可能有更好的方式來(lái)獲得一個(gè)不依賴(lài)于 vim 版本的通用加載語(yǔ)句, 但現(xiàn)在我對(duì)此很滿(mǎn)意。
本文名稱(chēng):關(guān)于Debian中的vimBug解決方案
分享鏈接:http://www.dlmjj.cn/article/dpphssc.html


咨詢(xún)
建站咨詢(xún)
