Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable blinking at the first/last line of the file

Tags:

vim

So for me this is very annoying

I am at the first/last line of the file and when I hit k/j all text screen blinks. I know this is stupid but it is possible to disable this.

like image 622
PaulP Avatar asked May 09 '11 06:05

PaulP


2 Answers

To disable visual bell completely: set t_vb= in vimrc or gvimrc (if you use gvim, you must put it into gvimrc because &t_vb option is reset after vimrc is sourced).

To turn visual bell into beep: set novisualbell. I find it more annoying, but it also answers the question: disabling screen blinking.

To turn off visual bell for j/k commands you will have to remap them:

noremap <expr> k ((line('.')==1)?'':'k')
noremap <expr> j ((line('.')==line('$'))?'':'j')
like image 140
ZyX Avatar answered Nov 15 '22 23:11

ZyX


You can add the line below to your .vimrc:

autocmd GUIEnter * set vb t_vb= " for your GUI
autocmd VimEnter * set vb t_vb=

It will disable both the bell and the visual flash.

like image 36
Michael Foukarakis Avatar answered Nov 15 '22 23:11

Michael Foukarakis