diff options
author | Philip Linell <linell@hey.com> | 2022-04-27 05:55:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-26 20:55:57 -0700 |
commit | d98e5357af1cd64b3e21196bc8e2408c724c0625 (patch) | |
tree | ac01450dd987e3b69c96fc423ee147eb30302fb9 | |
parent | 39d149752f5162eda8f2dbb990517c1db1c0c345 (diff) | |
download | rneovim-d98e5357af1cd64b3e21196bc8e2408c724c0625.tar.gz rneovim-d98e5357af1cd64b3e21196bc8e2408c724c0625.tar.bz2 rneovim-d98e5357af1cd64b3e21196bc8e2408c724c0625.zip |
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>
-rw-r--r-- | runtime/autoload/health/nvim.vim | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/runtime/autoload/health/nvim.vim b/runtime/autoload/health/nvim.vim index 961f83d926..f3732e012f 100644 --- a/runtime/autoload/health/nvim.vim +++ b/runtime/autoload/health/nvim.vim @@ -144,6 +144,16 @@ function! s:check_performance() abort \ ['Install a different Nvim package, or rebuild with `CMAKE_BUILD_TYPE=RelWithDebInfo`.', \ s:suggest_faq]) 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 function! s:get_tmux_option(option) abort |