如何禁用Vim铃声? [英] How to disable Vim bells sounds?
问题描述
我正在尝试在vim上禁用视觉和音频上的错误提示.但是我不能让他们离开.
I am trying to disable the error bells on vim, both visual and audio. However I cannot get them to stay off.
我的vimrc
中包含以下内容:
" Disable annoying beeping
set noerrorbells
set vb t_vb=
那是行不通的,我发现某个插件或其他设置正在对其进行重置,因此我再次将其添加到了vimrc
的末尾,仍然没有运气.
That doesn't work, I figured some plugin or another setting was resetting it so I added it again to the end of my vimrc
, still no luck.
我将其关闭的唯一方法是,在所有内容加载完毕后手动调用set vb t_vb=
.我想我可以通过在plugin/after
文件夹中添加脚本来模拟此情况,但是我试图避免这种情况,因为这意味着每当我切换到另一台计算机时,我都必须进行设置.
The only way I can get it to turn off is if I manually call set vb t_vb=
after everything has loaded. I guess I could emulate this by adding a script to the plugin/after
folder but I am trying to avoid that as it means it's another thing I have to set up whenever I switch to another machine.
您可以在此处查看我的完整vimrc
: https://github.com/lerp/dotfiles/blob/master/vimrc
You can see my full vimrc
here: https://github.com/lerp/dotfiles/blob/master/vimrc
推荐答案
假设您在GVim中遇到该问题,请添加以下行
Assuming you have that problem in GVim, adding the following line
autocmd GUIEnter * set vb t_vb=
您的if has("gui_running")
条件块中的
应该会有所帮助.
in your if has("gui_running")
conditional block should help.
来自:help 'visualbell'
:
Note: When the GUI starts, 't_vb' is reset to its default value.
You might want to set it again in your gvimrc.
这篇关于如何禁用Vim铃声?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!