0

when I press the tab key or top arrow when I am in the first line, bottom arrow when I am in the last line, right arrow when I am at the end of the line and left arrow when I am at the start of the line background color change to a random color for a second must of the time the color is blue, red, white

here is a gif of my problem

enter image description here

and this is my .vimrc content

set nocompatible              " required
filetype off                  " required

" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()

" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')

" let Vundle manage Vundle, required
Plugin 'gmarik/Vundle.vim'
Plugin 'Valloric/YouCompleteMe'
Plugin 'vim-syntastic/syntastic'
Plugin 'nvie/vim-flake8'
"google code format plugin
Plugin 'google/vim-maktaba'
Plugin 'google/vim-codefmt'
Plugin 'google/vim-glaive'

" add all your plugins here (note older versions of Vundle
" used Bundle instead of Plugin)

" ...

" All of your Plugins must be added before the following line
call vundle#end()            " required
call glaive#Install()
Glaive codefmt plugin[mappings]
Glaive codefmt google_java_executable="java -jar /path/to/google-java-format-VERSION-all-deps.jar"

filetype plugin indent on    " required



au BufNewFile,BufRead *.py
            \set tabstop=4
            \set softtabstop=4
            \set shiftwidth=4
            \set textwidth=79
            \set expandtab
            \set autoindent
            \set fileformat=unix

Plugin 'vim-scripts/indentpython.vim'

au BufRead,BufNewFile *.py,*.pyw,*.c,*.h,*.php,*.js match BadWhitespace /\s\+$/
highlight BadWhitespace ctermbg=red guibg=darkred

set termbidi

let python_highlight_all=1
syntax on

set number
set showmatch
set history=1000
set undolevels=1000
set wildignore=*.swp,*.bak,*.pyc
set visualbell
set noerrorbells
set encoding=utf-8
set foldmethod=indent
set foldlevel=99
set backspace=indent,eol,start
se mouse+=a
set clipboard=unnamedplus
colorscheme koehler


"enabling auto format for google code formater 
augroup autoformat_settings
  autocmd FileType bzl AutoFormatBuffer buildifier
  autocmd FileType c,cpp,proto,javascript,arduino AutoFormatBuffer clang-format
  autocmd FileType dart AutoFormatBuffer dartfmt
  autocmd FileType go AutoFormatBuffer gofmt
  autocmd FileType gn AutoFormatBuffer gn
  autocmd FileType html,css,sass,scss,less,json AutoFormatBuffer js-beautify
  autocmd FileType java AutoFormatBuffer google-java-format
  autocmd FileType python AutoFormatBuffer autopep8
  " Alternative: autocmd FileType python AutoFormatBuffer autopep8
  autocmd FileType rust AutoFormatBuffer rustfmt
  autocmd FileType vue AutoFormatBuffer prettier
augroup END
5
  • 1
    Few things: First your plugin indentpython should be define above, with the other plugins. Not sure that's the reason, but if not, you'd have issues with that. Then, have you tried commenting each plugin one by one to see if one one them is the reason? Finally, have you tried with another colorscheme (again, in case it comes from this one. I could not find that scheme online so couldn't try with it)?
    – padawin
    Nov 10, 2020 at 7:54
  • 1
    Take a look at :h 'visualbell' (which you have enabled).
    – B Layer
    Nov 10, 2020 at 7:57
  • @BLayer thank you, this problem resolved by disabling visualbell , can you add an answer so I can accept your answer Nov 10, 2020 at 8:05
  • 1
    Welcome to Vi and Vim!
    – D. Ben Knoble
    Nov 10, 2020 at 14:36
  • @D.BenKnoble thank u Nov 11, 2020 at 8:13

1 Answer 1

2

That's going to be a result of you having 'visualbell' (alias 'vb') enabled, per your vimrc file. When that setting is enabled any illegal/invalid action that would normally cause a beep/bell sound will instead flash the screen (by briefly inverting the display).

The simple solution is, obviously, to disable it.

:set novb

You can also shorten the length of the flash. See :h 'vb' for details.

If you want to keep the visual bell for specific cases you may be able to disable it only for cases like you describe in your question using 'belloff' (alias 'bo'). An example of its use:

:set bo=backspace

That will prevent the flash only when "hitting <BS> or <Del> and deleting results in an error". Perhaps :set bo=backspace,cursor will do the trick. Check out :h 'bo' for the details. (I believe this requires a relatively modern version of Vim. 7.4.xxx or later where xxx is a value that I'll need to look up.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.