Automatic plugin update *
* actually semi-automatic;)
Somehow quietly on VIM’s blog, apparently everyone is sleeping - or maybe huge .vimrc ended up on the Internet? ;) It is unknown, but it is clear that it is necessary to break this silence.
I’ll break it today with one good plugin, which I did not find mention of here. These are GetLatestVimScripts (http://vim.sourceforge.net/scripts/script.php?script_id=642).
First, a small outline
// FIXME : Habrahabr developers, guys. Well what kind of crap with links is going on? Is this XSS protection like that, does the word script distort everywhere? This was not the case before.
For everyone - the script in the links needs to be replaced with a script.
In principle, the name is already clear;) Deployed - in order to update some plugins at your request - either simply downloading new versions to a specific folder, or additionally automatically installing them.
Why does this plugin need someone? The answer is simple - because manually tracking everything is difficult enough, for this you need to remember what you have installed and which version. And this despite the fact that many useful scripts are not updated as often.
Most of all, wget is needed - without it, little happiness will not work. It is also very desirable to have an updated version of Vimball (which is also not simple and wants vim starting from version 7.0), but we will assume that it is already updated with us, because vim 7.2. If someone has not updated - write, we'll figure it out.
Since we have wget, we'll use it
After that, the GetLatest directory will appear in the .vim directory (vimfiles for win), in which GetLatestVimScripts.dist will lie. This file is supplied by default, as an example. To use it, you must rename it to GetLatestVimScripts.dat
His content is as follows
where
ScriptID is the id of the script at http://vim.sourceforge.net/ (for example, for GetLatestVimScripts it is 642, which can be seen just by hovering the link).
SourceID - for starters, it is better to set it to 1. In general, this is src_id for sourceforge, which changes for each new version of the script.
Filename - the name of the script, which may contain spaces (there may be confusion, so I’ll explain - in fact, the name can be anything and does not have to match the name of the downloaded file or the name of the script).
It is worth mentioning such a parameter as : AutoInstall: which is located between SourceID and Filename (I will give my GetLatestVimScripts.dat as an example)
This parameter, as many have already guessed, is needed so that the plug-in is automatically installed. GetLatestVimScripts is smart enough and can work with almost all kinds of files in which plugins for vim are supplied.
But enough explanations - I have already said quite a lot, the rest can be found out by asking a question, or by reading the description inside the plugin itself.
Using is extremely simple - you just need to run the command: GLVS. After that, the process will go - and at the end notify what happened. If there are plugins that just download, they will be placed in ~ / .vim / GetLatest /.
At the moment, most of all, there is not enough ability to specify the folder into which the files will be unpacked (by default, most archives are unpacked in ~ / .vim, and * .vim files in ~ / .vim / plugin) - which would be convenient for some scripts - for example, color schemes. Another inconvenience is that the plugin does not work with * .tgz - because of which my XPTemplate does not want to be updated. This is of course the most noticeable for me - and an occasion to contact the author.
That's enough;) Happy to work!
Somehow quietly on VIM’s blog, apparently everyone is sleeping - or maybe huge .vimrc ended up on the Internet? ;) It is unknown, but it is clear that it is necessary to break this silence.
I’ll break it today with one good plugin, which I did not find mention of here. These are GetLatestVimScripts (http://vim.sourceforge.net/scripts/script.php?script_id=642).
First, a small outline
- What is this plugin for?
- How to install and what is needed
- How to use
- What is missing
// FIXME : Habrahabr developers, guys. Well what kind of crap with links is going on? Is this XSS protection like that, does the word script distort everywhere? This was not the case before.
For everyone - the script in the links needs to be replaced with a script.
1. What is this plugin for?
In principle, the name is already clear;) Deployed - in order to update some plugins at your request - either simply downloading new versions to a specific folder, or additionally automatically installing them.
Why does this plugin need someone? The answer is simple - because manually tracking everything is difficult enough, for this you need to remember what you have installed and which version. And this despite the fact that many useful scripts are not updated as often.
2. How to install and what is needed
Most of all, wget is needed - without it, little happiness will not work. It is also very desirable to have an updated version of Vimball (which is also not simple and wants vim starting from version 7.0), but we will assume that it is already updated with us, because vim 7.2. If someone has not updated - write, we'll figure it out.
Since we have wget, we'll use it
wget http://vim.sourceforge.net/scripts/download_script.php?src_id=8136 -O getscript.vba.gz vim getscript.vba.gz : so% : q
After that, the GetLatest directory will appear in the .vim directory (vimfiles for win), in which GetLatestVimScripts.dist will lie. This file is supplied by default, as an example. To use it, you must rename it to GetLatestVimScripts.dat
mv ~ / .vim / GetLatest / GetLatestVimScripts.dist ~ / .vim / GetLatest / GetLatestVimScripts.dat
His content is as follows
ScriptID SourceID Filename -------------------------- 294 1 Align.vim 302 2 AnsiEsc.vim 122 3 astronaut.vim 104 4 blockhl.vim 120 5 decho.vim 40 6 DrawIt.tar.gz 451 7 EasyAccents.vim 195 8 engspchk.vim 642 9 GetLatestVimScripts.vim 489 10 Manpageview.vim 551 11 Mines.vim 514 12 mrswin.vim 670 13 visincr.vim 628 14 SeeTab.vim 508 15 ZoomWin.vim 877 16 gvcolor.vim
where
ScriptID is the id of the script at http://vim.sourceforge.net/ (for example, for GetLatestVimScripts it is 642, which can be seen just by hovering the link).
SourceID - for starters, it is better to set it to 1. In general, this is src_id for sourceforge, which changes for each new version of the script.
Filename - the name of the script, which may contain spaces (there may be confusion, so I’ll explain - in fact, the name can be anything and does not have to match the name of the downloaded file or the name of the script).
It is worth mentioning such a parameter as : AutoInstall: which is located between SourceID and Filename (I will give my GetLatestVimScripts.dat as an example)
ScriptID SourceID Filename -------------------------- 2611 11899: AutoInstall: XPTemplate 1658 11834: AutoInstall: NERDTree 159 3640: AutoInstall: MiniBufExplorer 69 6273: AutoInstall: Project 273 7701: AutoInstall: TagList 90 11049: AutoInstall: VCSCommand 489 9573: AutoInstall: ManPageView 39 8196: AutoInstall: MatchIt 642-8136: AutoInstall: getscript.vim
This parameter, as many have already guessed, is needed so that the plug-in is automatically installed. GetLatestVimScripts is smart enough and can work with almost all kinds of files in which plugins for vim are supplied.
But enough explanations - I have already said quite a lot, the rest can be found out by asking a question, or by reading the description inside the plugin itself.
3. How to use
Using is extremely simple - you just need to run the command: GLVS. After that, the process will go - and at the end notify what happened. If there are plugins that just download, they will be placed in ~ / .vim / GetLatest /.
4. What is missing
At the moment, most of all, there is not enough ability to specify the folder into which the files will be unpacked (by default, most archives are unpacked in ~ / .vim, and * .vim files in ~ / .vim / plugin) - which would be convenient for some scripts - for example, color schemes. Another inconvenience is that the plugin does not work with * .tgz - because of which my XPTemplate does not want to be updated. This is of course the most noticeable for me - and an occasion to contact the author.
That's enough;) Happy to work!