TaDaa / vimade

An eye friendly plugin that fades your inactive buffers and preserves your syntax highlighting!
MIT License
486 stars 8 forks source link

Suggest to support the lazy load officially. #38

Open kevinhwang91 opened 4 years ago

kevinhwang91 commented 4 years ago

When enabling vimade automatically, it will increase about 100ms during startup in my XPS 9370 i7 with ac mode. Here is my personal code to support the lazy load.

Plug 'TaDaa/vimade', {'on': 'VimadeEnable'}
let g:vimade = {
            \'fadelevel': 0.6,
            \'checkinterval': 100,
            \'enablefocusfading': 1
            \}
autocmd BufNew * ++once if !exists('g:vimade_loaded') |
            \execute 'VimadeEnable' | endif
autocmd FocusLost * ++once if !exists('g:vimade_loaded') |
            \execute 'VimadeEnable' |
            \call vimade#FocusLost() | endif

To be honest, I think vimade is not necessary to initialize during startup.

TaDaa commented 4 years ago

Love it. I only run vim with multiple buffers open simultaneously, but something like this would be a great improvement for anyone who may only edit within 1 window before quitting -- I'll get something out there to support this idea

kevinhwang91 commented 4 years ago

Your habit impulses me to append the WinNew to BufNew.