GVim flickers where it would normally sound a bell

4

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.

John Hamelink

Posted 2011-06-30T08:37:09.550

Reputation: 153

Answers

5

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=

JdeBP

Posted 2011-06-30T08:37:09.550

Reputation: 23 855

This works, but no when I put it in my vimrc? How do I make it work from my vimrc? – John Hamelink – 2011-07-01T10:31:44.767

1Again, :help visualbell would have told you the answer to this one. You use .gvimrc. – JdeBP – 2011-07-01T11:22:51.813

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 – 2011-07-01T13:22:51.413

1

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=

John Hamelink

Posted 2011-06-30T08:37:09.550

Reputation: 153

0

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.

davidg

Posted 2011-06-30T08:37:09.550

Reputation: 389