xref: /vim-8.2.3635/runtime/doc/pi_getscript.txt (revision 8024f936)
1*8024f936SBram Moolenaar*pi_getscript.txt*  For Vim version 8.2.  Last change: 2017 Aug 01
29964e468SBram Moolenaar>
3ff034194SBram Moolenaar		GETSCRIPT REFERENCE MANUAL  by Charles E. Campbell
49964e468SBram Moolenaar<
52963456fSBram MoolenaarAuthor:  Charles E. Campbell  <[email protected]>
69964e468SBram Moolenaar	 (remove NOSPAM from the email address)
79964e468SBram Moolenaar						*GetLatestVimScripts-copyright*
8ff034194SBram MoolenaarCopyright: (c) 2004-2012 by Charles E. Campbell	*glvs-copyright*
96be7f873SBram Moolenaar	The VIM LICENSE (see |copyright|) applies to the files in this
106be7f873SBram Moolenaar	package, including getscriptPlugin.vim, getscript.vim,
116be7f873SBram Moolenaar	GetLatestVimScripts.dist, and pi_getscript.txt, except use "getscript"
12*8024f936SBram Moolenaar	instead of "Vim".  Like anything else that's free, getscript and its
136be7f873SBram Moolenaar	associated files are provided *as is* and comes with no warranty of
146be7f873SBram Moolenaar	any kind, either expressed or implied.  No guarantees of
156be7f873SBram Moolenaar	merchantability.  No guarantees of suitability for any purpose.  By
166be7f873SBram Moolenaar	using this plugin, you agree that in no event will the copyright
176be7f873SBram Moolenaar	holder be liable for any damages resulting from the use of this
186be7f873SBram Moolenaar	software. Use at your own risk!
199964e468SBram Moolenaar
209964e468SBram MoolenaarGetscript is a plugin that simplifies retrieval of the latest versions of the
219964e468SBram Moolenaarscripts that you yourself use!  Typing |:GLVS| will invoke getscript; it will
229964e468SBram Moolenaarthen use the <GetLatestVimScripts.dat> (see |GetLatestVimScripts_dat|) file to
239964e468SBram Moolenaarget the latest versions of scripts listed therein from http://vim.sf.net/.
249964e468SBram Moolenaar
259964e468SBram Moolenaar==============================================================================
269964e468SBram Moolenaar1. Contents				*glvs-contents* *glvs* *getscript*
279964e468SBram Moolenaar   					*GetLatestVimScripts*
289964e468SBram Moolenaar
299964e468SBram Moolenaar	1. Contents........................................: |glvs-contents|
309964e468SBram Moolenaar	2. GetLatestVimScripts -- Getting Started..........: |glvs-install|
319964e468SBram Moolenaar	3. GetLatestVimScripts Usage.......................: |glvs-usage|
329964e468SBram Moolenaar	4. GetLatestVimScripts Data File...................: |glvs-data|
339964e468SBram Moolenaar	5. GetLatestVimScripts Friendly Plugins............: |glvs-plugins|
349964e468SBram Moolenaar	6. GetLatestVimScripts AutoInstall.................: |glvs-autoinstall|
359964e468SBram Moolenaar	7. GetLatestViMScripts Options.....................: |glvs-options|
369964e468SBram Moolenaar	8. GetLatestVimScripts Algorithm...................: |glvs-alg|
379964e468SBram Moolenaar	9. GetLatestVimScripts History.....................: |glvs-hist|
389964e468SBram Moolenaar
399964e468SBram Moolenaar
409964e468SBram Moolenaar==============================================================================
419964e468SBram Moolenaar2. GetLatestVimScripts -- Getting Started		*getscript-start*
429964e468SBram Moolenaar						*getlatestvimscripts-install*
439964e468SBram Moolenaar
449964e468SBram Moolenaar	VERSION FROM VIM DISTRIBUTION			*glvs-dist-install*
459964e468SBram Moolenaar
469964e468SBram MoolenaarVim 7.0 does not include the GetLatestVimScripts.dist file which
479964e468SBram Moolenaarserves as an example and a template.  So, you'll need to create
489964e468SBram Moolenaaryour own!  See |GetLatestVimScripts_dat|.
499964e468SBram Moolenaar
509964e468SBram Moolenaar	VERSION FROM VIM SF NET				*glvs-install*
519964e468SBram Moolenaar
529964e468SBram MoolenaarNOTE: The last step, that of renaming/moving the GetLatestVimScripts.dist
539964e468SBram Moolenaarfile, is for those who have just downloaded GetLatestVimScripts.tar.bz2 for
549964e468SBram Moolenaarthe first time.
559964e468SBram Moolenaar
569964e468SBram MoolenaarThe GetLatestVimScripts.dist file serves as an example and a template for your
579964e468SBram Moolenaarown personal list.  Feel free to remove all the scripts mentioned within it;
589964e468SBram Moolenaarthe "important" part of it is the first two lines.
599964e468SBram Moolenaar
608f3f58f2SBram MoolenaarYour computer needs to have wget or curl for GetLatestVimScripts to do its work.
619964e468SBram Moolenaar
629964e468SBram Moolenaar	1. if compressed:  gunzip getscript.vba.gz
639964e468SBram Moolenaar	2. Unix:
649964e468SBram Moolenaar		vim getscript.vba
659964e468SBram Moolenaar		:so %
669964e468SBram Moolenaar		:q
679964e468SBram Moolenaar		cd ~/.vim/GetLatest
689964e468SBram Moolenaar		mv GetLatestVimScripts.dist GetLatestVimScripts.dat
699964e468SBram Moolenaar		(edit GetLatestVimScripts.dat to install your own personal
709964e468SBram Moolenaar		list of desired plugins -- see |GetLatestVimScripts_dat|)
719964e468SBram Moolenaar
729964e468SBram Moolenaar	3. Windows:
739964e468SBram Moolenaar		vim getscript.vba
749964e468SBram Moolenaar		:so %
759964e468SBram Moolenaar		:q
769964e468SBram Moolenaar		cd **path-to-vimfiles**/GetLatest
779964e468SBram Moolenaar		mv GetLatestVimScripts.dist GetLatestVimScripts.dat
789964e468SBram Moolenaar		(edit GetLatestVimScripts.dat to install your own personal
799964e468SBram Moolenaar		list of desired plugins -- see |GetLatestVimScripts_dat|)
809964e468SBram Moolenaar
819964e468SBram Moolenaar
829964e468SBram Moolenaar==============================================================================
839964e468SBram Moolenaar3. GetLatestVimScripts Usage				*glvs-usage* *:GLVS*
849964e468SBram Moolenaar
858f3f58f2SBram MoolenaarUnless it has been defined elsewhere, >
86251e1912SBram Moolenaar
879964e468SBram Moolenaar	:GLVS
88251e1912SBram Moolenaar
899964e468SBram Moolenaarwill invoke GetLatestVimScripts().  If some other plugin has defined that
909964e468SBram Moolenaarcommand, then you may type
919964e468SBram Moolenaar>
929964e468SBram Moolenaar	:GetLatestVimScripts
939964e468SBram Moolenaar<
949964e468SBram MoolenaarThe script will attempt to update and, if permitted, will automatically
959964e468SBram Moolenaarinstall scripts from http://vim.sourceforge.net/.  To do so it will peruse a
969964e468SBram Moolenaarfile,
979964e468SBram Moolenaar>
989964e468SBram Moolenaar	.vim/GetLatest/GetLatestVimScripts.dat                    (unix)
999964e468SBram Moolenaar<
1009964e468SBram Moolenaaror >
1019964e468SBram Moolenaar	..wherever..\vimfiles\GetLatest\GetLatestVimScripts.dat   (windows)
1029964e468SBram Moolenaar(see |glvs-data|), and examine plugins in your [.vim|vimfiles]/plugin
1039964e468SBram Moolenaardirectory (see |glvs-plugins|).
1049964e468SBram Moolenaar
1059964e468SBram MoolenaarScripts which have been downloaded will appear in the
1069964e468SBram Moolenaar~/.vim/GetLatest (unix) or ..wherever..\vimfiles\GetLatest (windows)
1079964e468SBram Moolenaarsubdirectory.  GetLatestVimScripts will attempt to automatically
1089964e468SBram Moolenaarinstall them if you have the following line in your <.vimrc>: >
1099964e468SBram Moolenaar
1109964e468SBram Moolenaar	let g:GetLatestVimScripts_allowautoinstall=1
1119964e468SBram Moolenaar
1129964e468SBram MoolenaarThe <GetLatestVimScripts.dat> file will be automatically be updated to
1139964e468SBram Moolenaarreflect the latest version of script(s) so downloaded.
1149964e468SBram Moolenaar(also see |glvs-options|)
1159964e468SBram Moolenaar
1169964e468SBram Moolenaar
1179964e468SBram Moolenaar==============================================================================
1189964e468SBram Moolenaar4. GetLatestVimScripts Data File		*getscript-data* *glvs-data*
1199964e468SBram Moolenaar 						*:GetLatestVimScripts_dat*
1209964e468SBram MoolenaarThe data file <GetLatestVimScripts.dat> must have for its first two lines
1219964e468SBram Moolenaarthe following text:
1229964e468SBram Moolenaar>
1239964e468SBram Moolenaar	ScriptID SourceID Filename
1249964e468SBram Moolenaar	--------------------------
1259964e468SBram Moolenaar<
1269964e468SBram MoolenaarFollowing those two lines are three columns; the first two are numeric
1279964e468SBram Moolenaarfollowed by a text column.  The GetLatest/GetLatestVimScripts.dist file
1289964e468SBram Moolenaarcontains an example of such a data file.  Anything following a #... is
1299964e468SBram Moolenaarignored, so you may embed comments in the file.
1309964e468SBram Moolenaar
1319964e468SBram MoolenaarThe first number on each line gives the script's ScriptID.  When you're about
1329964e468SBram Moolenaarto use a web browser to look at scripts on http://vim.sf.net/, just before you
1339964e468SBram Moolenaarclick on the script's link, you'll see a line resembling
1349964e468SBram Moolenaar
1359964e468SBram Moolenaar	http://vim.sourceforge.net/scripts/script.php?script_id=40
1369964e468SBram Moolenaar
1379964e468SBram MoolenaarThe "40" happens to be a ScriptID that GetLatestVimScripts needs to
138251e1912SBram Moolenaardownload the associated page, and is assigned by vim.sf.net itself
139251e1912SBram Moolenaarduring initial uploading of the plugin.
1409964e468SBram Moolenaar
1419964e468SBram MoolenaarThe second number on each line gives the script's SourceID.  The SourceID
1429964e468SBram Moolenaarrecords the count of uploaded scripts as determined by vim.sf.net; hence it
1439964e468SBram Moolenaarserves to indicate "when" a script was uploaded.  Setting the SourceID to 1
1449964e468SBram Moolenaarinsures that GetLatestVimScripts will assume that the script it has is
1459964e468SBram Moolenaarout-of-date.
1469964e468SBram Moolenaar
1479964e468SBram MoolenaarThe SourceID is extracted by GetLatestVimScripts from the script's page on
1488f3f58f2SBram Moolenaarvim.sf.net; whenever it is greater than the one stored in the
1499964e468SBram MoolenaarGetLatestVimScripts.dat file, the script will be downloaded
1509964e468SBram Moolenaar(see |GetLatestVimScripts_dat|).
1519964e468SBram Moolenaar
1529964e468SBram MoolenaarIf your script's author has included a special comment line in his/her plugin,
1539964e468SBram Moolenaarthe plugin itself will be used by GetLatestVimScripts to build your
1549964e468SBram Moolenaar<GetLatestVimScripts.dat> file, including any dependencies on other scripts it
1559964e468SBram Moolenaarmay have.  As an example, consider: >
1569964e468SBram Moolenaar
1579964e468SBram Moolenaar	" GetLatestVimScripts: 884  1 :AutoInstall: AutoAlign.vim
1589964e468SBram Moolenaar
1599964e468SBram MoolenaarThis comment line tells getscript.vim to check vimscript #884 and that the
1609964e468SBram Moolenaarscript is automatically installable.  Getscript will also use this line to
1619964e468SBram Moolenaarhelp build the GetLatestVimScripts.dat file, by including a line such as: >
1629964e468SBram Moolenaar
163251e1912SBram Moolenaar	884 1 :AutoInstall: AutoAlign.vim
1649964e468SBram Moolenaar<
165251e1912SBram Moolenaarassuming that such a line isn't already in GetLatestVimScripts.dat file.
1669964e468SBram MoolenaarSee |glvs-plugins| for more.  Thus, GetLatestVimScripts thus provides a
1679964e468SBram Moolenaarcomprehensive ability to keep your plugins up-to-date!
1689964e468SBram Moolenaar
169251e1912SBram MoolenaarIn summary:
170251e1912SBram Moolenaar
171251e1912SBram Moolenaar  * Optionally tell getscript that it is allowed to build/append a
172251e1912SBram Moolenaar    GetLatestVimScripts.dat file based upon already installed plugins: >
173251e1912SBram Moolenaar	let g:GetLatestVimScripts_allowautoinstall=1
174251e1912SBram Moolenaar<
175251e1912SBram Moolenaar  * A line such as >
176251e1912SBram Moolenaar	" GetLatestVimScripts: 884  1 :AutoInstall: AutoAlign.vim
177251e1912SBram Moolenaar<   in an already-downloaded plugin constitutes the concurrence of the
178251e1912SBram Moolenaar    plugin author that getscript may do AutoInstall.  Not all plugins
179251e1912SBram Moolenaar    may be AutoInstall-able, and the plugin's author is best situated
180251e1912SBram Moolenaar    to know whether or not his/her plugin will AutoInstall properly.
181251e1912SBram Moolenaar
182251e1912SBram Moolenaar  * A line such as >
183251e1912SBram Moolenaar	884 1 :AutoInstall: AutoAlign.vim
184251e1912SBram Moolenaar<   in your GetLatestVimScripts.dat file constitutes your permission
185251e1912SBram Moolenaar    to getscript to do AutoInstall.  AutoInstall requires both your
186251e1912SBram Moolenaar    and the plugin author's permission.  See |GetLatestVimScripts_dat|.
187251e1912SBram Moolenaar
188251e1912SBram Moolenaar
1899964e468SBram Moolenaar						*GetLatestVimScripts_dat*
1909964e468SBram MoolenaarAs an example of a <GetLatestVimScripts.dat> file:
1919964e468SBram Moolenaar>
1929964e468SBram Moolenaar    ScriptID SourceID Filename
1939964e468SBram Moolenaar    --------------------------
194251e1912SBram Moolenaar    294 1 :AutoInstall: Align.vim
195251e1912SBram Moolenaar    120 2 Decho.vim
1969964e468SBram Moolenaar     40 3 DrawIt.tar.gz
1979964e468SBram Moolenaar    451 4 EasyAccents.vim
1989964e468SBram Moolenaar    195 5 engspchk.vim
1999964e468SBram Moolenaar    642 6 GetLatestVimScripts.vim
2009964e468SBram Moolenaar    489 7 Manpageview.vim
2019964e468SBram Moolenaar<
2029964e468SBram MoolenaarNote: the first two lines are required, but essentially act as comments.
2039964e468SBram Moolenaar
2049964e468SBram Moolenaar
2059964e468SBram Moolenaar==============================================================================
2069964e468SBram Moolenaar5. GetLatestVimScripts Friendly Plugins	*getscript-plugins* *glvs-plugins*
2079964e468SBram Moolenaar
2088f3f58f2SBram Moolenaar		(this section is for plugin authors)~
2098f3f58f2SBram Moolenaar
2109964e468SBram MoolenaarIf a plugin author includes the following comment anywhere in their plugin,
2119964e468SBram MoolenaarGetLatestVimScripts will find it and use it to automatically build the user's
2129964e468SBram MoolenaarGetLatestVimScripts.dat files:
2139964e468SBram Moolenaar>
2149964e468SBram Moolenaar	                         src_id
2159964e468SBram Moolenaar	                            v
2169964e468SBram Moolenaar	" GetLatestVimScripts: ### ### yourscriptname
2179964e468SBram Moolenaar	                        ^
2189964e468SBram Moolenaar	                    scriptid
2199964e468SBram Moolenaar<
2209964e468SBram MoolenaarAs an author, you should include such a line in to refer to your own script
2219964e468SBram Moolenaarplus any additional lines describing any plugin dependencies it may have.
2229964e468SBram MoolenaarSame format, of course!
2239964e468SBram Moolenaar
2249964e468SBram MoolenaarIf your command is auto-installable (see |glvs-autoinstall|), and most scripts
2258f3f58f2SBram Moolenaarare, then you may include :AutoInstall: just before "yourscriptname":
2268f3f58f2SBram Moolenaar>
2278f3f58f2SBram Moolenaar	                         src_id
2288f3f58f2SBram Moolenaar	                            v
2298f3f58f2SBram Moolenaar	" GetLatestVimScripts: ### ### :AutoInstall: yourscriptname
2308f3f58f2SBram Moolenaar	                        ^
2318f3f58f2SBram Moolenaar	                    scriptid
2328f3f58f2SBram Moolenaar<
233251e1912SBram MoolenaarNOTE: The :AutoInstall: feature requires both the plugin author's and~
234251e1912SBram Moolenaar      the user's permission to operate!~
2359964e468SBram Moolenaar
2369964e468SBram MoolenaarGetLatestVimScripts commands for those scripts are then appended, if not
2378f3f58f2SBram Moolenaaralready present, to the user's GetLatest/GetLatestVimScripts.dat file.  It is
2388f3f58f2SBram Moolenaara relatively painless way to automate the acquisition of any scripts your
2399964e468SBram Moolenaarplugins depend upon.
2409964e468SBram Moolenaar
2419964e468SBram MoolenaarNow, as an author, you probably don't want GetLatestVimScripts to download
242251e1912SBram Moolenaaryour own scripts atop your own copy, thereby overwriting your not-yet-released
2439964e468SBram Moolenaarhard work.  GetLatestVimScripts provides a solution for this:  put
2449964e468SBram Moolenaar>
2459964e468SBram Moolenaar	0 0 yourscriptname
2469964e468SBram Moolenaar<
2479964e468SBram Moolenaarinto your <GetLatestVimScripts.dat> file and GetLatestVimScripts will skip
2489964e468SBram Moolenaarexamining the "yourscriptname" scripts for those GetLatestVimScripts comment
2499964e468SBram Moolenaarlines.  As a result, those lines won't be inadvertently installed into your
2509964e468SBram Moolenaar<GetLatestVimScripts.dat> file and subsequently used to download your own
2519964e468SBram Moolenaarscripts.  This is especially important to do if you've included the
2529964e468SBram Moolenaar:AutoInstall: option.
2539964e468SBram Moolenaar
2549964e468SBram MoolenaarBe certain to use the same "yourscriptname" in the "0 0 yourscriptname" line
2559964e468SBram Moolenaaras you've used in your GetLatestVimScripts comment!
2569964e468SBram Moolenaar
2579964e468SBram Moolenaar
2589964e468SBram Moolenaar==============================================================================
2599964e468SBram Moolenaar6. GetLatestVimScripts AutoInstall			*getscript-autoinstall*
2609964e468SBram Moolenaar							*glvs-autoinstall*
2619964e468SBram Moolenaar
2629964e468SBram MoolenaarGetLatestVimScripts now supports "AutoInstall".  Not all scripts are
2639964e468SBram Moolenaarsupportive of auto-install, as they may have special things you need to do to
2649964e468SBram Moolenaarinstall them (please refer to the script's "install" directions).  On the
2659964e468SBram Moolenaarother hand, most scripts will be auto-installable.
2669964e468SBram Moolenaar
2679964e468SBram MoolenaarTo let GetLatestVimScripts do an autoinstall, the data file's comment field
2689964e468SBram Moolenaarshould begin with (surrounding blanks are ignored): >
2699964e468SBram Moolenaar
2709964e468SBram Moolenaar	:AutoInstall:
2719964e468SBram Moolenaar<
2729964e468SBram MoolenaarBoth colons are needed, and it should begin the comment (yourscriptname)
2739964e468SBram Moolenaarfield.
2749964e468SBram Moolenaar
2759964e468SBram MoolenaarOne may prevent any autoinstalling by putting the following line in your
2769964e468SBram Moolenaar<.vimrc>: >
2779964e468SBram Moolenaar
2789964e468SBram Moolenaar	let g:GetLatestVimScripts_allowautoinstall= 0
2799964e468SBram Moolenaar<
2809964e468SBram MoolenaarWith :AutoInstall: enabled, as it is by default, files which end with
2819964e468SBram Moolenaar
2829964e468SBram Moolenaar	---.tar.bz2  : decompressed & untarred in .vim/ directory
2839964e468SBram Moolenaar	---.vba.bz2  : decompressed in .vim/ directory, then vimball handles it
2849964e468SBram Moolenaar	---.vim.bz2  : decompressed & moved into .vim/plugin directory
2859964e468SBram Moolenaar	---.tar.gz   : decompressed & untarred in .vim/ directory
2869964e468SBram Moolenaar	---.vba.gz   : decompressed in .vim/ directory, then vimball handles it
2879964e468SBram Moolenaar	---.vim.gz   : decompressed & moved into .vim/plugin directory
2889964e468SBram Moolenaar	---.vba      : unzipped in .vim/ directory
2899964e468SBram Moolenaar	---.vim      : moved to .vim/plugin directory
2909964e468SBram Moolenaar	---.zip      : unzipped in .vim/ directory
2919964e468SBram Moolenaar
2929964e468SBram Moolenaarand which merely need to have their components placed by the untar/gunzip or
2939964e468SBram Moolenaarmove-to-plugin-directory process should be auto-installable.  Vimballs, of
2949964e468SBram Moolenaarcourse, should always be auto-installable.
2959964e468SBram Moolenaar
2969964e468SBram MoolenaarWhen is a script not auto-installable?  Let me give an example:
2979964e468SBram Moolenaar
2989964e468SBram Moolenaar	.vim/after/syntax/blockhl.vim
2999964e468SBram Moolenaar
3009964e468SBram MoolenaarThe <blockhl.vim> script provides block highlighting for C/C++ programs; it is
3019964e468SBram Moolenaaravailable at:
3029964e468SBram Moolenaar
3039964e468SBram Moolenaar	http://vim.sourceforge.net/scripts/script.php?script_id=104
3049964e468SBram Moolenaar
3059964e468SBram MoolenaarCurrently, vim's after/syntax only supports by-filetype scripts (in
3069964e468SBram Moolenaarblockhl.vim's case, that's after/syntax/c.vim).  Hence, auto-install would
3079964e468SBram Moolenaarpossibly overwrite the current user's after/syntax/c.vim file.
3089964e468SBram Moolenaar
3099964e468SBram MoolenaarIn my own case, I use <aftersyntax.vim> (renamed to after/syntax/c.vim) to
3109964e468SBram Moolenaarallow a after/syntax/c/ directory:
3119964e468SBram Moolenaar
3129964e468SBram Moolenaar	http://vim.sourceforge.net/scripts/script.php?script_id=1023
3139964e468SBram Moolenaar
3149964e468SBram MoolenaarThe script allows multiple syntax files to exist separately in the
3159964e468SBram Moolenaarafter/syntax/c subdirectory.  I can't bundle aftersyntax.vim in and build an
3169964e468SBram Moolenaarappropriate tarball for auto-install because of the potential for the
3179964e468SBram Moolenaarafter/syntax/c.vim contained in it to overwrite a user's c.vim.
3189964e468SBram Moolenaar
3199964e468SBram Moolenaar
3209964e468SBram Moolenaar==============================================================================
3219964e468SBram Moolenaar7. GetLatestVimScripts Options					*glvs-options*
3229964e468SBram Moolenaar>
3239964e468SBram Moolenaar	g:GetLatestVimScripts_wget
3249964e468SBram Moolenaar<	default= "wget"
3259964e468SBram Moolenaar		This variable holds the name of the command for obtaining
3269964e468SBram Moolenaar		scripts.
3279964e468SBram Moolenaar>
3289964e468SBram Moolenaar	g:GetLatestVimScripts_options
3299964e468SBram Moolenaar<	default= "-q -O"
3309964e468SBram Moolenaar		This variable holds the options to be used with the
3319964e468SBram Moolenaar		g:GetLatestVimScripts_wget command.
3329964e468SBram Moolenaar>
3338f3f58f2SBram Moolenaar 	g:GetLatestVimScripts_allowautoinstall
3349964e468SBram Moolenaar<	default= 1
3359964e468SBram Moolenaar		This variable indicates whether GetLatestVimScripts is allowed
3368f3f58f2SBram Moolenaar		to attempt to automatically install scripts.  Furthermore, the
3378f3f58f2SBram Moolenaar		plugin author has to have explicitly indicated that his/her
3388f3f58f2SBram Moolenaar		plugin is automatically installable (via the :AutoInstall:
3398f3f58f2SBram Moolenaar		keyword in the GetLatestVimScripts comment line).
3408f3f58f2SBram Moolenaar>
3418f3f58f2SBram Moolenaar	g:GetLatestVimScripts_autoinstalldir
3428f3f58f2SBram Moolenaar<	default= $HOME/.vim     (linux)
3438f3f58f2SBram Moolenaar	default= $HOME/vimfiles (windows)
3448f3f58f2SBram Moolenaar		Override where :AutoInstall: scripts will be installed.
3458f3f58f2SBram Moolenaar		Doesn't override vimball installation.
346ff034194SBram Moolenaar>
347ff034194SBram Moolenaar	g:GetLatestVimScripts_scriptaddr
348ff034194SBram Moolenaar<       default='http://vim.sourceforge.net/script.php?script_id='
349ff034194SBram Moolenaar		Override this if your system needs
350ff034194SBram Moolenaar	  ...  ='http://vim.sourceforge.net/script/script.php?script_id='
3519964e468SBram Moolenaar
3529964e468SBram Moolenaar==============================================================================
3539964e468SBram Moolenaar8. GetLatestVimScripts Algorithm		*glvs-algorithm* *glvs-alg*
3549964e468SBram Moolenaar
3559964e468SBram MoolenaarThe Vim sourceforge page dynamically creates a page by keying off of the
3569964e468SBram Moolenaarso-called script-id.  Within the webpage of
3579964e468SBram Moolenaar
3589964e468SBram Moolenaar	http://vim.sourceforge.net/scripts/script.php?script_id=40
3599964e468SBram Moolenaar
3609964e468SBram Moolenaaris a line specifying the latest source-id (src_id).  The source identifier
3619964e468SBram Moolenaarnumbers are always increasing, hence if the src_id is greater than the one
3627263a77bSBram Moolenaarrecorded for the script in GetLatestVimScripts then it's time to download a
3639964e468SBram Moolenaarnewer copy of that script.
3649964e468SBram Moolenaar
3659964e468SBram MoolenaarGetLatestVimScripts will then download the script and update its internal
3669964e468SBram Moolenaardatabase of script ids, source ids, and scriptnames.
3679964e468SBram Moolenaar
3689964e468SBram MoolenaarThe AutoInstall process will:
3699964e468SBram Moolenaar
3709964e468SBram Moolenaar	Move the file from GetLatest/ to the following directory
3719964e468SBram Moolenaar		Unix   : $HOME/.vim
3729964e468SBram Moolenaar		Windows: $HOME\vimfiles
3739964e468SBram Moolenaar	if the downloaded file ends with ".bz2"
3749964e468SBram Moolenaar		bunzip2 it
3759964e468SBram Moolenaar	else if the downloaded file ends with ".gz"
3769964e468SBram Moolenaar		gunzip it
3779964e468SBram Moolenaar	if the resulting file ends with ".zip"
3789964e468SBram Moolenaar		unzip it
3799964e468SBram Moolenaar	else if the resulting file ends with ".tar"
3809964e468SBram Moolenaar		tar -oxvf it
3819964e468SBram Moolenaar	else if the resulting file ends with ".vim"
3829964e468SBram Moolenaar		move it to the plugin subdirectory
3839964e468SBram Moolenaar
3849964e468SBram Moolenaar
3859964e468SBram Moolenaar==============================================================================
3869964e468SBram Moolenaar9. GetLatestVimScripts History		*getscript-history* *glvs-hist* {{{1
3879964e468SBram Moolenaar
3888d043171SBram Moolenaarv36 Apr 22, 2013 : * (glts) suggested use of plugin/**/*.vim instead of
3898d043171SBram Moolenaar		     plugin/*.vim in globpath() call.
3908d043171SBram Moolenaar		   * (Andy Wokula) got warning message when setting
3918d043171SBram Moolenaar		     g:loaded_getscriptPlugin
392*8024f936SBram Moolenaarv35 Apr 07, 2012 : * (MengHuan Yu) pointed out that the script URL has
393ff034194SBram Moolenaar		     changed (somewhat).  However, it doesn't work, and
394ff034194SBram Moolenaar		     the original one does (under Linux). I'll make it
395ff034194SBram Moolenaar		     yet-another-option.
396ff034194SBram Moolenaarv34 Jun 23, 2011 : * handles additional decompression options for tarballs
3976be7f873SBram Moolenaar                     (tgz taz tbz txz)
398251e1912SBram Moolenaarv33 May 31, 2011 : * using fnameescape() instead of escape()
399251e1912SBram Moolenaar		   * *.xz support
400251e1912SBram Moolenaarv32 Jun 19, 2010 : * (Jan Steffens) added support for xz compression
401c236c16dSBram Moolenaarv31 Jun 29, 2008 : * (Bill McCarthy) fixed having hls enabled with getscript
4028f3f58f2SBram Moolenaar		   * (David Schaefer) the acd option interferes with vimballs
4038f3f58f2SBram Moolenaar		     Solution: bypass the acd option
404c236c16dSBram Moolenaarv30 Jun 13, 2008 : * GLVS now checks for existence of fnameescape() and will
4058f3f58f2SBram Moolenaar		     issue an error message if it is not supported
4063577c6faSBram Moolenaarv29 Jan 07, 2008 : * Bram M pointed out that cpo is a global option and that
4073577c6faSBram Moolenaar                     getscriptPlugin.vim was setting it but not restoring it.
4083577c6faSBram Moolenaarv28 Jan 02, 2008 : * improved shell quoting character handling, cygwin
4093577c6faSBram Moolenaar		     interface, register-a bypass
4103577c6faSBram Moolenaar    Oct 29, 2007   * Bill McCarthy suggested a change to getscript that avoids
4113577c6faSBram Moolenaar                     creating pop-up windows
4127263a77bSBram Moolenaarv24 Apr 16, 2007 : * removed save&restore of the fo option during script
4137263a77bSBram Moolenaar                     loading
4149964e468SBram Moolenaarv23 Nov 03, 2006 : * ignores comments (#...)
4159964e468SBram Moolenaar                   * handles vimballs
4169964e468SBram Moolenaarv22 Oct 13, 2006 : * supports automatic use of curl if wget is not
4179964e468SBram Moolenaar                     available
4189964e468SBram Moolenaarv21 May 01, 2006 : * now takes advantage of autoloading.
4199964e468SBram Moolenaarv20 Dec 23, 2005 : * Eric Haarbauer found&fixed a bug with unzip use;
4209964e468SBram Moolenaar                     unzip needs the -o flag to overwrite.
4219964e468SBram Moolenaarv19 Nov 28, 2005 : * v18's GetLatestVimScript line accessed the wrong
4229964e468SBram Moolenaar                     script! Fixed.
4239964e468SBram Moolenaarv18 Mar 21, 2005 : * bugfix to automatic database construction
4249964e468SBram Moolenaar                   * bugfix - nowrapscan caused an error
4259964e468SBram Moolenaar                     (tnx to David Green for the fix)
4269964e468SBram Moolenaar    Apr 01, 2005   * if shell is bash, "mv" instead of "ren" used in
4279964e468SBram Moolenaar                     :AutoInstall:s, even though its o/s is windows
4289964e468SBram Moolenaar    Apr 01, 2005   * when downloading errors occurred, GLVS was
4299964e468SBram Moolenaar                     terminating early.  It now just goes on to trying
4309964e468SBram Moolenaar                     the next script (after trying three times to
4319964e468SBram Moolenaar                     download a script description page)
4329964e468SBram Moolenaar    Apr 20, 2005   * bugfix - when a failure to download occurred,
4339964e468SBram Moolenaar                     GetLatestVimScripts would stop early and claim that
4349964e468SBram Moolenaar                     everything was current.  Fixed.
4359964e468SBram Moolenaarv17 Aug 25, 2004 : * g:GetLatestVimScripts_allowautoinstall, which
4369964e468SBram Moolenaar                     defaults to 1, can be used to prevent all
4379964e468SBram Moolenaar                     :AutoInstall:
4389964e468SBram Moolenaarv16 Aug 25, 2004 : * made execution of bunzip2/gunzip/tar/zip silent
4399964e468SBram Moolenaar                   * fixed bug with :AutoInstall: use of helptags
4409964e468SBram Moolenaarv15 Aug 24, 2004 : * bugfix: the "0 0 comment" download prevention wasn't
4419964e468SBram Moolenaar                     always preventing downloads (just usually).  Fixed.
4429964e468SBram Moolenaarv14 Aug 24, 2004 : * bugfix -- helptags was using dotvim, rather than
4439964e468SBram Moolenaar                     s:dotvim.  Fixed.
4449964e468SBram Moolenaarv13 Aug 23, 2004 : * will skip downloading a file if its scriptid or srcid
4459964e468SBram Moolenaar                     is zero.  Useful for script authors; that way their
4469964e468SBram Moolenaar                     own GetLatestVimScripts activity won't overwrite
4479964e468SBram Moolenaar                     their scripts.
4489964e468SBram Moolenaarv12 Aug 23, 2004 : * bugfix - a "return" got left in the distribution that
4499964e468SBram Moolenaar                     was intended only for testing.  Removed, now works.
4509964e468SBram Moolenaar                   * :AutoInstall: implemented
4519964e468SBram Moolenaarv11 Aug 20, 2004 : * GetLatestVimScripts is now a plugin:
4529964e468SBram Moolenaar                   * :GetLatestVimScripts command
4539964e468SBram Moolenaar                   * (runtimepath)/GetLatest/GetLatestVimScripts.dat
4549964e468SBram Moolenaar                     now holds scripts that need updating
4559964e468SBram Moolenaarv10 Apr 19, 2004 : * moved history from script to doc
4569964e468SBram Moolenaarv9  Jan 23, 2004 :   windows (win32/win16/win95) will use
4579964e468SBram Moolenaar                     double quotes ("") whereas other systems will use
4589964e468SBram Moolenaar                     single quotes ('') around the urls in calls via wget
4599964e468SBram Moolenaarv8  Dec 01, 2003 :   makes three tries at downloading
4609964e468SBram Moolenaarv7  Sep 02, 2003 :   added error messages if "Click on..." or "src_id="
4619964e468SBram Moolenaar                     not found in downloaded webpage
4629964e468SBram Moolenaar                     Uses t_ti, t_te, and rs to make progress visible
4639964e468SBram Moolenaarv6  Aug 06, 2003 :   final status messages now display summary of work
4649964e468SBram Moolenaar                     ( "Downloaded someqty scripts" or
4659964e468SBram Moolenaar                       "Everything was current")
4669964e468SBram Moolenaar                     Now GetLatestVimScripts is careful about downloading
4679964e468SBram Moolenaar                     GetLatestVimScripts.vim itself!
4689964e468SBram Moolenaar                     (goes to <NEW_GetLatestVimScripts.vim>)
4699964e468SBram Moolenaarv5  Aug 04, 2003 :   missing an endif near bottom
4709964e468SBram Moolenaarv4  Jun 17, 2003 :   redraw! just before each "considering" message
4719964e468SBram Moolenaarv3  May 27, 2003 :   Protects downloaded files from errant shell
4729964e468SBram Moolenaar                     expansions with single quotes: '...'
4739964e468SBram Moolenaarv2  May 14, 2003 :   extracts name of item to be obtained from the
4749964e468SBram Moolenaar                     script file.  Uses it instead of comment field
4759964e468SBram Moolenaar                     for output filename; comment is used in the
4769964e468SBram Moolenaar                     "considering..." line and is now just a comment!
4779964e468SBram Moolenaar                   * Fixed a bug: a string-of-numbers is not the
4789964e468SBram Moolenaar                     same as a number, so I added zero to them
4799964e468SBram Moolenaar                     and they became numbers.  Fixes comparison.
4809964e468SBram Moolenaar
4819964e468SBram Moolenaar==============================================================================
482*8024f936SBram Moolenaarvim:tw=78:ts=8:noet:ft=help:fdm=marker
483