Saturday, December 26, 2009

New Vim plugin system (automatic installation of plugins)

Hi,

I'd like to introduce you to the new vim plugin system I've written.

Some time ago I wrote about "theonevimlib". It was a library which
should solve some trouble about distributing vim repositories.
However I over engineered many things. So it got kind of bloated and I
even felt a little bit bad when recommending to install it.

That's why I've rewritten it from scratch. I'm following the linux way
now: Write one tool to solve one task and do that well.

So the script file basically does one thing: read a list of known
repositories you can install by

call scriptmanager#Activate(["commenter","Nerdtree"])

I chose the name commenter and Nerdtree because you may know those
plugins.

On the other hand: What is required to support this plugin system?

a) add it to the list of known repositories

b) it must be a directory hierarchy which can be added to runtimepath.

c) write a plugin-info.txt file which looks like this
{
'name' : 'vim-plugin-manager',
'version' : "0.0",
'author' : "Marc Weber <marco-oweber@gmx.de>",
'maintainer' : "Marc Weber <marco-oweber@gmx.de>",
'repository' : {'type': 'git', 'url': 'git://github.com/MarcWeber/vim-plugin-manager-known-repositories.git'},
'dependencies' : {},
'description' : 'this repository contains a list of known other repositories only'
}

done.

Right now it does only support installing git hosted repositories (alias
plugin). However adding support for installing .zip repositories or such
should be easy.


Updating all scripts can be done by iterating over the directories
running svn update, git pull, bzr .. or in case of .zip distributions:

diff . .orig > my_changes
curl new.zip
unzip new.zip
patch -p1 < my_changes

So you don't loose your customizations (unless there are conflicts)

Yes, this may lead to a huge runtimepath setting. But I don't feel
that's that bad.

Read all docs here: http://github.com/MarcWeber/vim-plugin-manager/blob/master/doc/vim-plugin-manager.txt

tested on Linux only!

Of course a lot of things are still missing such as version constraints.
They can be added later.

Feedback and patches are welcome.

Marc Weber

--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php

No comments:

Post a Comment