自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

修復(fù)Debian中的vim奇怪行為

系統(tǒng) Linux
我一直在想,為什么我服務(wù)器上 vim 為什么在鼠標(biāo)方面表現(xiàn)得如此愚蠢:不能像平時那樣跳轉(zhuǎn)、復(fù)制、粘貼。盡管在 /etc/vim/vimrc.local 中已經(jīng)設(shè)置了。最后我終于知道為什么了,多謝 bug #864074 并且修復(fù)了它。

https://s1.51cto.com/oss/201801/24/98e510be5d2098ab91f2b88a1a32ab20.jpeg

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

  1. set mouse=

***我終于知道為什么了,多謝 bug #864074 并且修復(fù)了它。

原因是,當(dāng)沒有 ~/.vimrc 的時候,vim 在 vimrc.local 之后加載 defaults.vim,從而覆蓋了幾個設(shè)置。

/etc/vim/vimrc 中有一個注釋(雖然我沒有看到)解釋了這一點(diǎn):

  1. " Vim will load $VIMRUNTIME/defaults.vim if the user does not have a vimrc.
  2. " This happens after /etc/vim/vimrc(.local) are loaded, so it will override
  3. " any settings in these files.
  4. " If you don't want that to happen, uncomment the below line to prevent
  5. " defaults.vim from being loaded.
  6. " let g:skip_defaults_vim = 1

我同意這是在正常安裝 vim 后設(shè)置 vim 的好方法,但 Debian 包可以做得更好。在錯誤報告中清楚地說明了這個問題:如果沒有 ~/.vimrc,/etc/vim/vimrc.local 中的設(shè)置被覆蓋。

這在Debian中是違反直覺的 - 而且我也不知道其他包中是否采用類似的方法。

由于 defaults.vim 中的設(shè)置非常合理,所以我希望使用它,但只修改了一些我不同意的項目,比如鼠標(biāo)。***,我在 /etc/vim/vimrc.local 中做了以下操作:

  1. if filereadable("/usr/share/vim/vim80/defaults.vim")
  2. source /usr/share/vim/vim80/defaults.vim
  3. endif
  4. " now set the line that the defaults file is not reloaded afterwards!
  5. let g:skip_defaults_vim = 1
  6.  
  7. " turn of mouse
  8. set mouse=
  9. " other override settings go here

可能有更好的方式來獲得一個不依賴于 vim 版本的通用加載語句, 但現(xiàn)在我對此很滿意。 

責(zé)任編輯:龐桂玉 來源: Linux中國
相關(guān)推薦

2022-03-31 11:46:00

Go傳輸編碼標(biāo)準(zhǔn)庫

2015-09-16 16:51:21

2020-09-09 07:55:51

TS開源符號

2010-05-06 15:35:14

Unix操作系統(tǒng)

2021-02-02 11:02:20

React任務(wù)饑餓行為優(yōu)先級任務(wù)

2023-08-14 09:59:31

Debian操作系統(tǒng)

2021-02-05 09:18:33

VS CodeVim操作

2009-06-08 20:05:14

Eclipse deb

2012-11-23 16:46:12

LinuxVim

2021-02-24 15:20:43

Windows 10Python命令

2022-08-07 21:17:27

微軟Windows 11

2009-11-23 09:34:05

WPF本質(zhì)

2019-10-24 12:13:59

Android APP后臺動畫

2022-08-27 14:14:06

Spring事務(wù)開發(fā)

2020-03-22 11:20:16

Vue開發(fā)前端

2018-03-05 19:20:49

LinuxWordPressHTTP

2013-04-17 10:34:55

.NET大對象堆

2015-08-11 08:51:40

游戲死亡

2023-03-14 07:23:48

ReactJSX語法

2010-08-06 13:34:54

Debian NFS
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號