mirror of
https://github.com/neovim/neovim.git
synced 2025-09-07 11:58:17 +00:00
feat(checkhealth): check for slow shell #17829
Problem: I had some issues where multiple plugins (vim-fzf and fugitive) was slow because of my `.zshenv`. Solution: Check shell performance in :checkhealth. Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
This commit is contained in:
@@ -144,6 +144,16 @@ function! s:check_performance() abort
|
|||||||
\ ['Install a different Nvim package, or rebuild with `CMAKE_BUILD_TYPE=RelWithDebInfo`.',
|
\ ['Install a different Nvim package, or rebuild with `CMAKE_BUILD_TYPE=RelWithDebInfo`.',
|
||||||
\ s:suggest_faq])
|
\ s:suggest_faq])
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" check for slow shell invocation
|
||||||
|
let slow_cmd_time = 1.5
|
||||||
|
let start_time = reltime()
|
||||||
|
call system('echo')
|
||||||
|
let elapsed_time = reltimefloat(reltime(start_time))
|
||||||
|
if elapsed_time > slow_cmd_time
|
||||||
|
call health#report_warn(
|
||||||
|
\ 'Slow shell invocation (took '.printf('%.2f', elapsed_time).' seconds).')
|
||||||
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:get_tmux_option(option) abort
|
function! s:get_tmux_option(option) abort
|
||||||
|
Reference in New Issue
Block a user