Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When I try to (for example) scroll down past the "end" of the file, using pageDown or the down arrow key, GVim would traditionally make a sound. I have disabled this, but another annoying thing it does, is it flickers (presumably to "alert" the user). How can I turn this off?

I'm using ubuntu 11.04 with the Gnome-3 PPA installed. I have a "ATI Technologies Inc M880G [Mobility Radeon HD 4200]" graphics card.

Cheers, John H.

share|improve this question
up vote 5 down vote accepted

GVim would traditionally make a sound. I have disabled this, [...]

You've discovered what :help visualbell tells you. The visualbell setting does not disable the bell. It changes the bell so that instead of outputting the bel terminfo sequence (termcap code bl) it outputs the flash terminfo sequence (termcap code vb).

To disable the bell you must actually null out one of those terminfo sequences, since vim has no way to specify that you don't actually want a "bell" of either sort at all, but only has a way to change between two types of bell.

You can override a terminal's capabilities from within vim with the :set command. The settable variables in vim that override terminal capabilities are named after the termcap names, not the terminfo names, and vim doesn't have a t_bl variable. So you have to null out the flash capability, with the variable named after its termcap code vb, since one cannot null out the bel capability, and also select that as the bell that you are using.

:set visualbell t_vb=
share|improve this answer
This works, but no when I put it in my vimrc? How do I make it work from my vimrc? – John Hamelink Jul 1 '11 at 10:31
Again, :help visualbell would have told you the answer to this one. You use .gvimrc. – JdeBP Jul 1 '11 at 11:22
I've been trying to avoid .gvimrc on purpose. I found the answer by adapting yours and merging with something I found on the internet. Thanks :) – John Hamelink Jul 1 '11 at 13:22

Ok, so thanks to JdeBP for his answer which worked great when inserted into GVIM during runtime, but not when put into the .vimrc. I found the way round here. The answer is to put this in your .vimrc:

" - Stop the bell ringing all the time when you do something dumb
" - or unnecessary.
set visualbell t_vb=
au GuiEnter * set visualbell t_vb=
share|improve this answer

It sounds like you have the vim "visual bell" feature enabled, which alerts the user with a flash each time the bell would traditionally sound (as you suspected).

You can disable it for the current session by typing:

:set novb

or more permanently disable it by adding the line set novb in your .vimrc.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .