The following 'vim-plug' commands would fail and/or display errors
when executed by VIM 8+ on a Windows platform with the 'shell' option
set to 'powershell' or 'pwsh':
- PlugInstall
- PlugUpdate
- PlugClean
- PlugStatus
- PlugDiff
There were two causes for these errors:
- A bug in VIM itself (resolved by patch 9.2.6) with how compound
PowerShell commands are handled by the 'system()' vimscript
function.
- A bug in the 's:vim8' branch of the private 'vim-plug' function
's:spawn()' where the actual command to be executed was escaped
for 'cmd.exe' but the 'cd' prefix added by 's:with_cd()" was escaped
for PowerShell.
In GUI Vim (gvim, MacVim), each system() call incurs significant
overhead due to command prompt window creation, making operations
like PlugDiff ~5x slower than in terminal Vim or Neovim.
Add s:system_job() which uses job_start with file-based output to
run commands without that overhead, and use it in s:system() when
running in GUI Vim with job support.
Since v:shell_error is read-only in Vim 9, introduce s:shell_error
which is set by both code paths and used at all call sites.
Fixes#1312
If you press 'q' while `PlugInstall` or `PlugUpdate` is in progress,
the current version of vim-plug immediately closes its window and aborts
all the running processes.
This commit enhances the 'q' map so that it doesn't close the window,
but instead displays the aborted tasks so that the user can press 'R' to
retry the tasks.
Fix#1285
* Open vim-plug window in a new tab not to disrupt the current window layout
* Open preview window on the right to better show the diff
If you prefer the old layout, use the following configuration:
let g:plug_window = 'vertical topleft new'
let g:plug_pwindow = 'above 12new'
Fix#1005
vim-plug will now run `git remote set-head origin -a` on PlugUpdate to
keep track of the default branch of the origin, so that it can still
update a plugin even if its default branch has changed.
This additional command will slow down the update process, but this is
an unavoidable price to pay for the correctness of the task. However,
vim-plug will run checkout and merge commands in parallel, so this
improvement will slightly offset the slowdown.
Neovim 0.5.0 allows lua files to be used in runtime files (such as
plugin, ftdetect, etc.) as well as vimscript files. Indeed, some
plugins have `plugin/*.lua` scripts only, but not `plugin/*.vim`;
such plugins cannot be sourced and work properly if it is lazy-loaded.