25

How can I disable bells/visualbells in vim?

I've tried:

set noeb
set novb

.. but nothing has changed afaik.

Just to be clear, I'm referring to the visual bell I get in vim when I do something that doesn't do anything, for exmaple pressing ESC in normal mode, or pressing h in on col 0.

Gilles 'SO- stop being evil'
  • 807,993
  • 194
  • 1,674
  • 2,175
Prody
  • 353
  • 1
  • 3
  • 6

1 Answers1

34

To disable the bell altogether, you need to

  • enable vim's internal visual bell¹, with set visualbell (= set vb);
  • set the effect of the vim visual bell to do nothing, with set t_vb=

(This is explained in the documentation of 'visualbell', but not very clearly.)

¹ Even with novisualbell, you might see a visual bell if vim emits a bell control sequence (usually \a) and the terminal is configured to flash rather than make a sound.

Gilles 'SO- stop being evil'
  • 807,993
  • 194
  • 1,674
  • 2,175