From cea30dfbb220f7a8d04a83dcef45937d95f14129 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Mon, 15 Nov 2021 23:07:06 +0900 Subject: vim: speed Vim startup --- .vimrc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.vimrc b/.vimrc index 401337c..768ae1e 100644 --- a/.vimrc +++ b/.vimrc @@ -1600,8 +1600,13 @@ let g:lightline = { \ } function! s:lightline_mode() - if get(g:, 'loaded_eskk', v:false) && eskk#is_enabled() - let skk = ' (' . eskk#statusline('%s') . ')' + " Calling `eskk#statusline()` makes Vim autoload eskk. If you call it + " without checking `g:loaded_autoload_eskk`, eskk is loaded on an early + " stage of the initialization (probably the first rendering of status line), + " which slows down Vim startup. Loading eskk can be delayed by checking both + " of `g:loaded_eskk` and `g:loaded_autoload_eskk`. + if exists('g:loaded_eskk') && exists('g:loaded_autoload_eskk') + let skk = eskk#statusline(' (%s)', '') else let skk = '' endif -- cgit v1.2.3-70-g09d2