From b0d74e15226669217e86e6da9eb688a95d9d2172 Mon Sep 17 00:00:00 2001 From: Ilya Tumaykin Date: Fri, 6 Nov 2026 23:47:51 +0300 Subject: [PATCH] Skip unnecessary loading of Python and Ruby DLLs Vim with python/dyn, python3/dyn, or ruby/dyn doesn't load the interpreter core DLL until the first command is issued to that interpreter. Running has('python'), has('python3'), or has('ruby') pulls the respective interpreter core DLL. This is described in `:h has-python` for Python. For Ruby it isn't mentioned in docs, but confirmed directly. With Neovim or modern Vim with jobs, vim-plug doesn't need to use either Python or Ruby, so avoid pulling their core DLLs by placing the has() checks later in their conditions. This avoids pulling those DLLs at all. --- plug.vim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plug.vim b/plug.vim index 58a894e..5572b05 100644 --- a/plug.vim +++ b/plug.vim @@ -1196,8 +1196,8 @@ function! s:update_impl(pull, force, args) abort endif let use_job = s:nvim || s:vim8 - let python = (has('python') || has('python3')) && !use_job - let ruby = has('ruby') && !use_job && (v:version >= 703 || v:version == 702 && has('patch374')) && !(s:is_win && has('gui_running')) && threads > 1 && s:check_ruby() + let python = !use_job && (has('python') || has('python3')) + let ruby = !use_job && (v:version >= 703 || v:version == 702 && has('patch374')) && !(s:is_win && has('gui_running')) && threads > 1 && has('ruby') && s:check_ruby() let s:update = { \ 'start': reltime(), @@ -1233,7 +1233,7 @@ function! s:update_impl(pull, force, args) abort let s:submodule_opt = s:git_version_requirement(2, 8) ? ' --jobs='.threads : '' " Python version requirement (>= 2.7) - if python && !has('python3') && !ruby && !use_job && s:update.threads > 1 + if python && !ruby && !use_job && s:update.threads > 1 && !has('python3') redir => pyv silent python import platform; print platform.python_version() redir END