mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
runtime(glvs): fix a few issues
Fix errors on #15640 that: * led to use the wrong vim runtime directory name if using powershell or bash on windows. * use a wrong pattern to detect the users runtime dir * allow to use global variables to specify un-archive commands closes: #15722 Signed-off-by: GuyBrush <miguel.barro@live.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
parent
2c41dad387
commit
c854efc6fe
@ -3,11 +3,14 @@
|
|||||||
" Maintainer: This runtime file is looking for a new maintainer.
|
" Maintainer: This runtime file is looking for a new maintainer.
|
||||||
" Original Author: Charles E. Campbell
|
" Original Author: Charles E. Campbell
|
||||||
" Date: Jan 21, 2014
|
" Date: Jan 21, 2014
|
||||||
" Version: 36
|
" Version: 37
|
||||||
" Installing: :help glvs-install
|
" Installing: :help glvs-install
|
||||||
" Usage: :help glvs
|
" Usage: :help glvs
|
||||||
" Last Change: {{{1
|
" Last Change: {{{1
|
||||||
" 2024 Sep 08 by Vim Project: several small fixes
|
" 2024 Sep 08 by Vim Project: several small fixes (#15640)
|
||||||
|
" 2024 Sep 23 by Vim Project: runtime dir selection fix (#15722)
|
||||||
|
" autoloading search path fix
|
||||||
|
" substitution of hardcoded commands with global variables
|
||||||
" }}}
|
" }}}
|
||||||
"
|
"
|
||||||
" GetLatestVimScripts: 642 1 :AutoInstall: getscript.vim
|
" GetLatestVimScripts: 642 1 :AutoInstall: getscript.vim
|
||||||
@ -19,7 +22,7 @@
|
|||||||
if exists("g:loaded_getscript")
|
if exists("g:loaded_getscript")
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
let g:loaded_getscript= "v36"
|
let g:loaded_getscript= "v37"
|
||||||
if &cp
|
if &cp
|
||||||
echoerr "GetLatestVimScripts is not vi-compatible; not loaded (you need to set nocp)"
|
echoerr "GetLatestVimScripts is not vi-compatible; not loaded (you need to set nocp)"
|
||||||
finish
|
finish
|
||||||
@ -87,6 +90,24 @@ if !exists("g:GetLatestVimScripts_downloadaddr")
|
|||||||
let g:GetLatestVimScripts_downloadaddr = 'https://www.vim.org/scripts/download_script.php?src_id='
|
let g:GetLatestVimScripts_downloadaddr = 'https://www.vim.org/scripts/download_script.php?src_id='
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" define decompression tools (on windows this allows redirection to wsl or git tools).
|
||||||
|
" Note tar is available as builtin since Windows 11.
|
||||||
|
if !exists("g:GetLatestVimScripts_bunzip2")
|
||||||
|
let g:GetLatestVimScripts_bunzip2= "bunzip2"
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !exists("g:GetLatestVimScripts_gunzip")
|
||||||
|
let g:GetLatestVimScripts_gunzip= "gunzip"
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !exists("g:GetLatestVimScripts_unxz")
|
||||||
|
let g:GetLatestVimScripts_unxz= "unxz"
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !exists("g:GetLatestVimScripts_unzip")
|
||||||
|
let g:GetLatestVimScripts_unzip= "unzip"
|
||||||
|
endif
|
||||||
|
|
||||||
"" For debugging:
|
"" For debugging:
|
||||||
"let g:GetLatestVimScripts_wget = "echo"
|
"let g:GetLatestVimScripts_wget = "echo"
|
||||||
"let g:GetLatestVimScripts_options = "options"
|
"let g:GetLatestVimScripts_options = "options"
|
||||||
@ -96,18 +117,16 @@ endif
|
|||||||
let s:autoinstall= ""
|
let s:autoinstall= ""
|
||||||
if g:GetLatestVimScripts_allowautoinstall
|
if g:GetLatestVimScripts_allowautoinstall
|
||||||
|
|
||||||
if (has("win32") || has("gui_win32") || has("gui_win32s") || has("win16") || has("win64") || has("win32unix") || has("win95")) && &shell !~ '\cbash\|pwsh\|powershell'
|
let s:is_windows = has("win32") || has("gui_win32") || has("gui_win32s") || has("win16") || has("win64") || has("win32unix") || has("win95")
|
||||||
" windows (but not cygwin/bash)
|
let s:dotvim= s:is_windows ? "vimfiles" : ".vim"
|
||||||
let s:dotvim= "vimfiles"
|
|
||||||
if !exists("g:GetLatestVimScripts_mv")
|
|
||||||
let g:GetLatestVimScripts_mv= "move"
|
|
||||||
endif
|
|
||||||
|
|
||||||
else
|
if !exists("g:GetLatestVimScripts_mv")
|
||||||
" unix
|
if s:is_windows && &shell !~ '\cbash\|pwsh\|powershell'
|
||||||
let s:dotvim= ".vim"
|
" windows (but not cygwin/bash)
|
||||||
if !exists("g:GetLatestVimScripts_mv")
|
let g:GetLatestVimScripts_mv= "move"
|
||||||
let g:GetLatestVimScripts_mv= "mv"
|
else
|
||||||
|
" unix
|
||||||
|
let g:GetLatestVimScripts_mv= "mv"
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -215,10 +234,15 @@ fun! getscript#GetLatestVimScripts()
|
|||||||
" call Decho("searching plugins for GetLatestVimScripts dependencies")
|
" call Decho("searching plugins for GetLatestVimScripts dependencies")
|
||||||
let lastline = line("$")
|
let lastline = line("$")
|
||||||
" call Decho("lastline#".lastline)
|
" call Decho("lastline#".lastline)
|
||||||
let firstdir = substitute(&rtp,',.{-}$','','')
|
let firstdir = substitute(&rtp,',.*$','','')
|
||||||
let plugins = split(globpath(firstdir,"plugin/**/*.vim"),'\n')
|
let plugins = split(globpath(firstdir,"plugin/**/*.vim"),'\n')
|
||||||
let plugins += split(globpath(firstdir,"ftplugin/**/*.vim"),'\n')
|
let plugins += split(globpath(firstdir,"ftplugin/**/*.vim"),'\n')
|
||||||
let plugins += split(globpath(firstdir,"AsNeeded/**/*.vim"),'\n')
|
let plugins += split(globpath(firstdir,"AsNeeded/**/*.vim"),'\n')
|
||||||
|
" extend the search to the packages too (this script predates the feature)
|
||||||
|
let plugins += split(globpath(firstdir,"pack/*/start/*/plugin/**/*.vim"),'\n')
|
||||||
|
let plugins += split(globpath(firstdir,"pack/*/opt/*/plugin/**/*.vim"),'\n')
|
||||||
|
let plugins += split(globpath(firstdir,"pack/*/start/*/ftplugin/**/*.vim"),'\n')
|
||||||
|
let plugins += split(globpath(firstdir,"pack/*/opt/*/ftplugin/**/*.vim"),'\n')
|
||||||
let foundscript = 0
|
let foundscript = 0
|
||||||
|
|
||||||
" this loop updates the GetLatestVimScripts.dat file
|
" this loop updates the GetLatestVimScripts.dat file
|
||||||
@ -564,17 +588,17 @@ fun! s:GetOneScript(...)
|
|||||||
" decompress
|
" decompress
|
||||||
if sname =~ '\.bz2$'
|
if sname =~ '\.bz2$'
|
||||||
" call Decho("decompress: attempt to bunzip2 ".sname)
|
" call Decho("decompress: attempt to bunzip2 ".sname)
|
||||||
exe "sil !bunzip2 ".shellescape(sname)
|
exe "sil !".g:GetLatestVimScripts_bunzip2." ".shellescape(sname)
|
||||||
let sname= substitute(sname,'\.bz2$','','')
|
let sname= substitute(sname,'\.bz2$','','')
|
||||||
" call Decho("decompress: new sname<".sname."> after bunzip2")
|
" call Decho("decompress: new sname<".sname."> after bunzip2")
|
||||||
elseif sname =~ '\.gz$'
|
elseif sname =~ '\.gz$'
|
||||||
" call Decho("decompress: attempt to gunzip ".sname)
|
" call Decho("decompress: attempt to gunzip ".sname)
|
||||||
exe "sil !gunzip ".shellescape(sname)
|
exe "sil !".g:GetLatestVimScripts_gunzip." ".shellescape(sname)
|
||||||
let sname= substitute(sname,'\.gz$','','')
|
let sname= substitute(sname,'\.gz$','','')
|
||||||
" call Decho("decompress: new sname<".sname."> after gunzip")
|
" call Decho("decompress: new sname<".sname."> after gunzip")
|
||||||
elseif sname =~ '\.xz$'
|
elseif sname =~ '\.xz$'
|
||||||
" call Decho("decompress: attempt to unxz ".sname)
|
" call Decho("decompress: attempt to unxz ".sname)
|
||||||
exe "sil !unxz ".shellescape(sname)
|
exe "sil !".g:GetLatestVimScripts_unxz." ".shellescape(sname)
|
||||||
let sname= substitute(sname,'\.xz$','','')
|
let sname= substitute(sname,'\.xz$','','')
|
||||||
" call Decho("decompress: new sname<".sname."> after unxz")
|
" call Decho("decompress: new sname<".sname."> after unxz")
|
||||||
else
|
else
|
||||||
@ -584,7 +608,7 @@ fun! s:GetOneScript(...)
|
|||||||
" distribute archive(.zip, .tar, .vba, .vmb, ...) contents
|
" distribute archive(.zip, .tar, .vba, .vmb, ...) contents
|
||||||
if sname =~ '\.zip$'
|
if sname =~ '\.zip$'
|
||||||
" call Decho("dearchive: attempt to unzip ".sname)
|
" call Decho("dearchive: attempt to unzip ".sname)
|
||||||
exe "silent !unzip -o ".shellescape(sname)
|
exe "silent !".g:GetLatestVimScripts_unzip." -o ".shellescape(sname)
|
||||||
elseif sname =~ '\.tar$'
|
elseif sname =~ '\.tar$'
|
||||||
" call Decho("dearchive: attempt to untar ".sname)
|
" call Decho("dearchive: attempt to untar ".sname)
|
||||||
exe "silent !tar -xvf ".shellescape(sname)
|
exe "silent !tar -xvf ".shellescape(sname)
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
*pi_getscript.txt* For Vim version 9.1. Last change: 2024 Sep 08
|
*pi_getscript.txt* For Vim version 9.1. Last change: 2024 Sep 26
|
||||||
>
|
>
|
||||||
GETSCRIPT REFERENCE MANUAL by Charles E. Campbell
|
GETSCRIPT REFERENCE MANUAL by Charles E. Campbell
|
||||||
<
|
<
|
||||||
Author: Charles E. Campbell <NcampObell@SdrPchip.AorgM-NOSPAM>
|
Original Author: Charles E. Campbell <NcampObell@SdrPchip.AorgM-NOSPAM>
|
||||||
(remove NOSPAM from the email address)
|
(remove NOSPAM from the email address)
|
||||||
*GetLatestVimScripts-copyright*
|
*GetLatestVimScripts-copyright*
|
||||||
Copyright: (c) 2004-2012 by Charles E. Campbell *glvs-copyright*
|
Copyright: (c) 2004-2012 by Charles E. Campbell *glvs-copyright*
|
||||||
@ -357,6 +357,35 @@ after/syntax/c.vim contained in it to overwrite a user's c.vim.
|
|||||||
Override this if your system needs
|
Override this if your system needs
|
||||||
... ='http://vim.sourceforge.net/scripts/download_script.php?src_id='
|
... ='http://vim.sourceforge.net/scripts/download_script.php?src_id='
|
||||||
>
|
>
|
||||||
|
g:GetLatestVimScripts_bunzip2
|
||||||
|
< default= bunzip2
|
||||||
|
This variable holds the name of the command to decompress .bz2
|
||||||
|
files
|
||||||
|
>
|
||||||
|
g:GetLatestVimScripts_gunzip
|
||||||
|
< default= gunzip
|
||||||
|
This variable holds the name of the command to decompress .gz
|
||||||
|
files
|
||||||
|
>
|
||||||
|
g:GetLatestVimScripts_unxz
|
||||||
|
< default= unxz
|
||||||
|
This variable holds the name of the command to decompress .xz
|
||||||
|
files
|
||||||
|
>
|
||||||
|
g:GetLatestVimScripts_unzip
|
||||||
|
< default= unzip
|
||||||
|
This variable holds the name of the command to decompress .zip
|
||||||
|
files
|
||||||
|
|
||||||
|
Note: The variables associated with decompression commands help workaround
|
||||||
|
crossplatform issues. For example, on Windows is possible to delegate this
|
||||||
|
calls into `wsl` by doing: >
|
||||||
|
|
||||||
|
let g:GetLatestVimScripts_bunzip2= "wsl -e bunzip2"
|
||||||
|
let g:GetLatestVimScripts_gunzip= "wsl -e gunzip"
|
||||||
|
let g:GetLatestVimScripts_unxz= "wsl -e unxz"
|
||||||
|
let g:GetLatestVimScripts_unzip= "wsl -e unzip"
|
||||||
|
<
|
||||||
==============================================================================
|
==============================================================================
|
||||||
8. GetLatestVimScripts Algorithm *glvs-algorithm* *glvs-alg*
|
8. GetLatestVimScripts Algorithm *glvs-algorithm* *glvs-alg*
|
||||||
|
|
||||||
@ -393,6 +422,11 @@ The AutoInstall process will:
|
|||||||
==============================================================================
|
==============================================================================
|
||||||
9. GetLatestVimScripts History *getscript-history* *glvs-hist* {{{1
|
9. GetLatestVimScripts History *getscript-history* *glvs-hist* {{{1
|
||||||
|
|
||||||
|
v37 Sep 23, 2024 : * Support for the new vimball's .vmb extension (old .vba
|
||||||
|
extension conflicted with visual basic).
|
||||||
|
* Support for |glvs-autoinstal| in ftplugins and packages.
|
||||||
|
* Allow platform driven customization of decompressing
|
||||||
|
commands.
|
||||||
v36 Apr 22, 2013 : * (glts) suggested use of plugin/**/*.vim instead of
|
v36 Apr 22, 2013 : * (glts) suggested use of plugin/**/*.vim instead of
|
||||||
plugin/*.vim in globpath() call.
|
plugin/*.vim in globpath() call.
|
||||||
* (Andy Wokula) got warning message when setting
|
* (Andy Wokula) got warning message when setting
|
||||||
|
@ -23,7 +23,7 @@ if &cp
|
|||||||
endif
|
endif
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
let g:loaded_getscriptPlugin = "v36"
|
let g:loaded_getscriptPlugin = "v37"
|
||||||
let s:keepcpo = &cpo
|
let s:keepcpo = &cpo
|
||||||
set cpo&vim
|
set cpo&vim
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user