sponsor Vim development Vim logo Vim Book Ad

GetLatestVimScripts : Keep your plugins up-to-date! (semi-automatic retrieval)

 script karma  Rating 215/74, Downloaded by 16067  Comments, bugs, improvements  Vim wiki

created by
Charles Campbell
 
script type
utility
 
description
GetLatestVimScripts is a plugin that automates retrieval of the latest versions of the scripts that you yourself use!

   * automatic up-to-date plugins
   * automatic installation for cooperating plugins
   * automatic constructions of GetLatestVimScripts.dat for cooperating plugins


-----
Usage:
-----

    :GetLatestVimScripts
-or-
    :GLVS

Downloaded files are placed in the .vim/GetLatest directory (vimfiles\GetLatest).  Those scripts that have an :AutoInstall: in their GetLatestVimScripts comment will be (you guessed it!) automatically installed.

GetLatestVimScripts depends on a file called GetLatest/GetLatestVimScripts.dat.  This file tells GetLatestVimScripts what plugins you're interested in and want to keep up-to-date.  Each line in the file has the form:

    ScriptID SrcID ScriptName

where

    ScriptID  : you'll see it on the top of your browser in its "Location:" box whenever you click on the script at http://vim.sf.net/ .
    SrcID     : start it off with a "1"; :GetLatestVimScripts will download the file and keep this entry updated automatically
    ScriptName: the name or title of the script (may have spaces, etc)

In the distribution is <GetLatestVimScripts.dist>; its an example of a <GetLatestVimScripts.dat> file.  In fact, you
can rename it to <GetLatestVimScripts.dat> and use it if you wish; it contains lines telling GetLatestVimScripts
to automate retrieval of <Align.vim>, <Mines.vim>, etc.  Please feel free to edit the file as you wish.

GetLatestVimScripts examines the plugins you currently have for lines that look like: (Align.vim's is shown)

    " GetLatestVimScripts: 294 1 :AutoInstall: Align.vim

Plugins that have such lines enable GetLatestVimScripts to automatically build the GetLatestVimScripts.dat file
for you.  The :AutoInstall: in the comment tells GetLatestVimScripts that the plugin is safe to automatically install, too.

------------
How It Works
------------

Vim.sf.net has a separate SrcID for every script that is uploaded.  With Netscape, Mozilla, and Internet-Explorer, when you move the cursor on top of the script you'd like to download, you'll see a line resembling ...src_id=###.  As new scripts and newly uploaded scripts are placed on vim.sf.net, the src_id is incremented.  Hence the newer ones will have greater SrcIDs, so GetLatestVimScripts compares the SrcID in your <GetLatestVimScripts.dat> file with what vim.sf.net has; if there's a newer one, GetLatestVimScripts will "wget" it.

The GetLatestVimScripts script will modify the GetLatestVimScripts.dat file whenever it downloads a new source file to reflect the latest SrcID, too.


----------------------------------------
Semi-Automatic Script Dependency Support
----------------------------------------

GetLatestVimScripts will examine your plugins for comment lines of the form

    " GetLatestVimScripts: ScriptID SrcID ScriptName

Such lines will be appropriately appended to the GetLatest/GetLatestVimScripts.dat file (if not already present) whenever :GetLatestVimScripts is invoked.  Thus if your newly downloaded script has such lines in it, thereby indicating that it depends upon the presence of specific scripts, GetLatestVimScripts will keep such dependent scripts up to date, too.


--------
Required
--------

    wget

ie. you'll need to have wget somewhere on your path for GetLatestVimScripts to work.

(alpha/beta version available at http://www.drchip.org/astronaut/vim/index.html#GETSCRIPT)
 
install details
(you will need an up-to-date install of vimball, vimscript#1502, although vim 7.1a or later's vimball is probably ok)

1. vim getscript.vba.gz
   :so %
   :q
2. a) Unix:
      cd ~/.vim/GetLatest
   b) Windows:
      cd ..wherever..\vimfiles\GetLatest
3. mv GetLatestVimScripts.dist GetLatestVimScripts.dat
4. Edit GetLatestVimScripts.dat to install the plugins in which you're interested.  To the extent that plugin authors have included lines such as

     " GetLatestVimScripts: [scriptid] 1 [:AutoInstall:] PluginName.vim

   in their plugins, GetLatestVimScripts will be able to construct the GetLatestVimScripts.dat file itself.
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
getscript.vba.gz 33 2011-05-31 7.3 Charles Campbell *.xz compression supported
Bug fixes: acd option bypass, fnameescape used instead of escape(), hls problem fixed
getscript.vba.gz 29 2008-01-08 7.0 Charles Campbell Another bugfix.
getscript.vba.gz 28 2008-01-07 7.0 Charles Campbell Getscript has improved shell quote handling and avoids pop-up windows under WinXP more often
getscript.vba.gz 25 2007-05-08 7.0 Charles Campbell removed save&restore of the fo option during script loading
ignores comments (#...) in GetLatestVimScripts.dat file
supports vimballs (*.vba, *.vba.gz)
getscript.vba.gz 23 2007-04-04 7.0 Charles Campbell Autoinstall handles vimballs and ignores #... as comments
getscript.vba.gz 22 2006-10-13 7.0 Charles Campbell * Now takes advantage of autoloading.
* Supports automatic use of curl if wget is not available.
GetLatestVimScripts.tar.gz 20 2006-02-15 6.0 Charles Campbell bugfix -- unzip needed the -o flag to overwrite
GetLatestVimScripts.tar.gz 18 2005-10-11 6.0 Charles Campbell Bugfix release: improvement to automatic downloading database construction; nowrapscan no longer throws an error; with bash, mv instead of ren is used; and downloading problems are handled better.
g:GetLatestVimScripts_autoinstall (default=1) can be used to prevent any :AutoInstall:s.
GetLatestVimScripts.tar.bz2 16 2004-08-25 6.0 Charles Campbell :GLVS command made available if not already present
Made execution of bunzip2/gunzip/tar/zip silent.
bugfix: With :AutoInstall: use of helptags.  Fixed!
GetLatestVimScripts.tar.bz2 11 2004-08-20 6.0 Charles Campbell The newest GetLatestVimScripts is a plugin!  Use :GetLatestVimScripts to get the latest versions of the scripts you're interested in.  Scriptnames and ids are now in a GetLatest/GetLatestVimScripts.dat datafile.  GetLatestVimScripts also examines cooperating plugins for dependencies, helps build the datafile, and keeps them up-to-date too!
ip used for rating: 142.132.191.50

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github