How to disable Vim bells sounds?

前端 未结 6 696
一整个雨季
一整个雨季 2021-02-01 12:30

I am trying to disable the error bells on vim, both visual and audio. However I cannot get them to stay off.

I have the following in my vimrc:



        
相关标签:
6条回答
  • 2021-02-01 13:14

    Assuming you have that problem in GVim, adding the following line

    autocmd GUIEnter * set vb t_vb=
    

    in your if has("gui_running") conditional block should help.

    From :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.
    
    0 讨论(0)
  • 2021-02-01 13:30

    After trying all the options mentioned(that haven't worked for me) i figured out this solution and that worked for me(windows). The beep sound is related to the git bash terminal settings: (3 simple steps)

    Follow these steps :-

    1. Right click on the terminal/git bash or whatever you are using .
    2. click on options
    3. select Terminal
    4. from Bell drop-down select "no beep" .enter image description here

    Thanks

    0 讨论(0)
  • 2021-02-01 13:30

    I tried several times with different configurations but none worked. It seems that gVim resets the visual bell when the GUI starts. The only way it works for me is this snippet at the end of your .vimrc (or _vimrc if you are using Windows):

    set visualbell t_vb=
    if has("autocmd") && has("gui")
        au GUIEnter * set t_vb=
    endif
    
    0 讨论(0)
  • 2021-02-01 13:30

    To disable visual bell in Visual Studio 2019 with VsVim extension:

    VsVim detects the presence of _vimrc, so add the following to it:

    C:\Users\YourName\_vimrc

    set vb t_vb=
    

    Setting other options like errorbells or beloff had no effect in VsVim.

    0 讨论(0)
  • 2021-02-01 13:32

    Try to use the following line in your .vimrc, .gvimrc files:

    set belloff=all
    
    0 讨论(0)
  • 2021-02-01 13:36

    For me with gVim it works if I put

    set noerrorbells
    set vb t_vb=
    

    in ~/.gvimrc, not ~/.vimrc.

    0 讨论(0)
提交回复
热议问题