Visual bell in VIM

166 views
Skip to first unread message

George Potapov

unread,
Aug 3, 2010, 7:37:04 AM8/3/10
to v...@vim.org
Hello.
I don't like bell and visual bell so I decided to switch it off in my vim.
I looked it up in the documentation. It says:

== cut ==
When no beep or flash is wanted, use ":set vb t_vb=".
== /cut ==

All right. But there's a problem: this command works fine when entered from keyboard, but when I put it into my ~/.vimrc it has no effect. Screen flashes like regular visual bell.
What to do?

Version of vim is
VIM - Vi IMproved 7.2 (2008 Aug 9, compiled May 4 2010 12:31:00)
with GTK GUI


--
George Potapov <gog...@gmail.com>

Jürgen Krämer

unread,
Aug 3, 2010, 9:16:26 AM8/3/10
to vim...@googlegroups.com

Hi,

George Potapov wrote:
>
> I don't like bell and visual bell so I decided to switch it off in my vim.
> I looked it up in the documentation. It says:
>
> == cut ==
> When no beep or flash is wanted, use ":set vb t_vb=".
> == /cut ==
>
> All right. But there's a problem: this command works fine when entered from keyboard, but when I put it into my ~/.vimrc it has no effect. Screen flashes like regular visual bell.
> What to do?

you did not look at the whole documentation. ;-)

:help 'visualbell'

says that you have to put this command in your ~/.gvimrc, too, because
t_vb is reset at the start of the GUI.

Regards,
J�rgen

--
Sometimes I think the surest sign that intelligent life exists elsewhere
in the universe is that none of it has tried to contact us. (Calvin)

George Potapov

unread,
Aug 3, 2010, 9:25:58 AM8/3/10
to vim...@googlegroups.com
On Tue, 03 Aug 2010 15:16:26 +0200
Jürgen Krämer <jott...@googlemail.com> wrote:

> > I don't like bell and visual bell so I decided to switch it off in my vim.

> > What to do?
>
> you did not look at the whole documentation. ;-)
>
> :help 'visualbell'

Thanks a lot, that worked. It's kinda clumsy to have two files to configure one vim, though. :-)

--
George Potapov <gog...@gmail.com>

Christian Brabandt

unread,
Aug 3, 2010, 9:32:48 AM8/3/10
to vim...@googlegroups.com
Hi George!

On Di, 03 Aug 2010, George Potapov wrote:

> On Tue, 03 Aug 2010 15:16:26 +0200 J�rgen Kr�mer


> <jott...@googlemail.com> wrote:
>
> > > I don't like bell and visual bell so I decided to switch it off in
> > > my vim. What to do?
> >
> > you did not look at the whole documentation. ;-)
> >
> > :help 'visualbell'
>
> Thanks a lot, that worked. It's kinda clumsy to have two files to
> configure one vim, though. :-)

Alternatively, you could probably use an GUIEnter autocommand in your
.vimrc and then you should not need the .gvimrc.


regards,
Christian

Tony Mechelynck

unread,
Aug 3, 2010, 1:58:41 PM8/3/10
to vim...@googlegroups.com

Yes you can. I want the opposite (sound bell *and* visual bell) and I do
it all in the vimrc, with one value for console mode, and, in a GUIEnter
autocommand, a different value for GUI mode. My gvimrc is a zero-length
file. (If you're curious, I do it by prefixing a BEL character, 0x07, to
the visualbell termcap code in t_vb.)


Best regards,
Tony.
--
Nature and nature's laws lay hid in night,
God said, "Let Newton be," and all was light.

It did not last; the devil howling "Ho!
Let Einstein be!" restored the status quo.

Ricky J. Wu

unread,
Aug 4, 2010, 2:03:56 AM8/4/10
to vim_use
In my system, I add these two lines into vimrc:

set noerrorbells novisualbell
autocmd VimEnter * set vb t_vb=

Jeri Raye

unread,
Aug 9, 2010, 10:09:53 AM8/9/10
to vim...@googlegroups.com
2010/8/4 Ricky J. Wu <rich...@live.com>:

>
> In my system, I add these two lines into vimrc:
>
> set noerrorbells novisualbell
> autocmd VimEnter * set vb t_vb=
>
This does the trick for me also!
Thanks
Jeri

bill lam

unread,
Aug 10, 2010, 10:12:53 AM8/10/10
to vim_use
Втр, 03 Авг 2010, Ricky J. Wu писал(а):

But h: said 'errorbells' and 'visualbell' are default off.

--
regards,
====================================================
GPG key 1024D/4434BAB3 2008-08-24
gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3

Jürgen Krämer

unread,
Aug 10, 2010, 10:22:17 AM8/10/10
to vim...@googlegroups.com

Hi,

bill lam wrote:
>
> But h: said 'errorbells' and 'visualbell' are default off.
>

quote from :help 'errorbells' (note the second sentence):

| Ring the bell (beep or screen flash) for error messages. This only
| makes a difference for error messages, the bell will be used always
| for a lot of errors without a message (e.g., hitting <Esc> in Normal
| mode). See 'visualbell' on how to make the bell behave like a beep,
| screen flash or do nothing.

bill lam

unread,
Aug 10, 2010, 10:35:16 AM8/10/10
to vim...@googlegroups.com
Втр, 10 Авг 2010, Jürgen Krämer писал(а):

>
> Hi,
>
> bill lam wrote:
> >
> > But h: said 'errorbells' and 'visualbell' are default off.
> >
>
> quote from :help 'errorbells' (note the second sentence):
>
> | Ring the bell (beep or screen flash) for error messages. This only
> | makes a difference for error messages, the bell will be used always
> | for a lot of errors without a message (e.g., hitting <Esc> in Normal
> | mode). See 'visualbell' on how to make the bell behave like a beep,
> | screen flash or do nothing.

I can see ":set vb t_vb=" is needed, but does it need to ":set
noerrorbells" and ":set novisualbell" again if these are already
default off?

Reply all
Reply to author
Forward
0 new messages