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=
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.813I'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