Redraw screen on BufWinEneter instead of BufReadPost.
function! AutoEncoding()
if &modified && &fileencoding != ""
call SetupEncoding(&fileencoding)
+ else
+ redraw
endif
autocmd! auto-encoding
augroup! auto-encoding
endif
" ----------
-augroup redraw-once
-autocmd!
-" Redraw screen after all macros in ~/.vimrc and ~/.vim/
-autocmd BufReadPost * redraw
-" Remove the redraw autocommand (it's only needed once) and the group
-autocmd BufReadPost * autocmd! redraw-once
-autocmd BufReadPost * augroup! redraw-once
-augroup END
-
" This has to go to the very end of ~/.vimrc to allow reading the .vimrc
set secure " safer working with script files in the current directory