gpt4 book ai didi

vim - Vim 的配置文件 '_vimrc ' 中的设置是否遵循文档流的顺序(从上到下)?

转载 作者:行者123 更新时间:2023-12-01 13:35:31 27 4
gpt4 key购买 nike

有点奇怪,我想在保存时禁用 gVIM 中的自动备份,所以我将 set nobackup 放在文件 _vimrc 的顶部,但它没有用。然后我将该行放在以下行的下方:

set nocompatible
source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim
behave mswin

它奏效了。

基本上 set nobackup 不会像这样工作:

set nobackup

set nocompatible
source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim
behave mswin

但像这样工作:

 set nocompatible
source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim
behave mswin

set nobackup

这正常吗? VIM 设置会干扰其他设置吗?

最佳答案

source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim

意味着 vim 在加载之后的行之前运行这些文件中的配置。作为"just somebody" said ,在 vimrc_example.vim 中,备份被激活,所以,在你的第一个例子中,你首先设置 nobackup 然后它被 .vim 文件取消激活。

关于vim - Vim 的配置文件 '_vimrc ' 中的设置是否遵循文档流的顺序(从上到下)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2033546/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com