Debian中vim的Bug怎么解决


这篇“Debian中vim的Bug怎么解决”文章的知识点大部分人都不太理解,所以小编给大家总结了以下内容,内容详细,步骤清晰,具有一定的借鉴价值,希望大家阅读完这篇文章能有所收获,下面我们一起来看看这篇“Debian中vim的Bug怎么解决”文章吧。

我一直在想,为什么我服务器上 vim 为什么在鼠标方面表现得如此愚蠢:不能像平时那样跳转、复制、粘贴。尽管在 /etc/vim/vimrc.local 中已经设置了。

set mouse=

最后我终于知道为什么了,多谢 bug #864074 并且修复了它。原因是,当没有 ~/.vimrc 的时候,vim 在 vimrc.local 之后加载 defaults.vim,从而覆盖了几个设置。

在 /etc/vim/vimrc 中有一个注释(虽然我没有看到)解释了这一点:

" 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, ument the below line to prevent" defaults.vim from being loaded." let g:skip_defaults_vim = 1

我同意这是在正常安装 vim 后设置 vim 的好方法,但 Debian 包可以做得更好。在错误报告中清楚地说明了这个问题:如果没有 ~/.vimrc,/etc/vim/vimrc.local 中的设置被覆盖。这在Debian中是违反直觉的 – 而且我也不知道其他包中是否采用类似的方法。

由于 defaults.vim 中的设置非常合理,所以我希望使用它,但只修改了一些我不同意的项目,比如鼠标。最后,我在 /etc/vim/vimrc.local 中做了以下操作:

if filereadable("/usr/share/vim/vim80/defaults.vim") source /usr/share/vim/vim80/defaults.vimendif" now set the line that the defaults file is not reloaded afterwards!let g:skip_defaults_vim = 1" turn of mouseset mouse=" other override settings go here

以上就是关于“Debian中vim的Bug怎么解决”这篇文章的内容,相信大家都有了一定的了解,希望小编分享的内容对大家有帮助,若想了解更多相关的知识内容,请关注主机评测网行业资讯频道。


上一篇:Centos8怎么更改运行级别

下一篇:Centos中怎么安装NTP


Copyright © 2002-2019 测速网 www.inhv.cn 皖ICP备2023010105号
测速城市 测速地区 测速街道 网速测试城市 网速测试地区 网速测试街道
温馨提示:部分文章图片数据来源与网络,仅供参考!版权归原作者所有,如有侵权请联系删除!

热门搜索 城市网站建设 地区网站制作 街道网页设计 大写数字 热点城市 热点地区 热点街道 热点时间 房贷计算器