You need add following lines to bash and vim config,
1) Turn off bell for bash
vi ~/.inputrc
set bell-style none
2) Turn off bell for vi
vi ~/.vimrc
set visualbell
set t_vb=
Setting the visual bell turns off the audio bell and clearing the visual bell length deactivates flashing.