Loading ...
Sorry, an error occurred while loading the content.

New Vim plugin system (automatic installation of plugins)

Expand Messages
  • Marc Weber
    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
    Message 1 of 15 , Dec 26, 2009
    • 0 Attachment
      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@...>",
      'maintainer' : "Marc Weber <marco-oweber@...>",
      '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
    • Marc Weber
      ... There have been a lot of updates. Most important: renaming: vim-plugin-manager - vim-addon-manager installing .vba and .zip is supported installing and
      Message 2 of 15 , Jan 8, 2010
      • 0 Attachment
        Excerpts from Marc Weber's message of Sun Dec 27 05:01:27 +0100 2009:
        > Right now it does only support installing git hosted repositories (alias
        > plugin). However adding support for installing .zip repositories or such
        > should be easy.

        There have been a lot of updates. Most important:

        renaming: vim-plugin-manager -> vim-addon-manager

        installing .vba and .zip is supported

        installing and updating .svn and .git repositories is supported.

        So give it a try, please:
        http://github.com/MarcWeber/vim-addon-manager

        Goto the section "INSTALLING THIS VIM PLUGIN" to read about the
        recommended setup:
        http://github.com/MarcWeber/vim-addon-manager/blob/master/doc/vim-addon-manager.txt

        Tested on Linux only by now.

        Marc Weber
      • Christophe-Marie Duquesne
        Hi Marc, I use a builtin functionnality for handling automated installation/update of plugins. It is the :GetLatestVimScripts feature, by Dr Chip (I say buitin
        Message 3 of 15 , Jan 8, 2010
        • 0 Attachment
          Hi Marc,

          I use a builtin functionnality for handling automated
          installation/update of plugins. It is the :GetLatestVimScripts
          feature, by Dr Chip (I say buitin because even though it is an
          standalone plugin written in vimscript, it comes in the standard vim
          distribution).

          I understand that your plugin brings additional features compared to
          :GLVS (afaik :GLVS does not handle git/svn), but I just wonder why it
          was necessary to do it in a separated new plugin. Could not these
          features be integrated in what I believe to be "the standard way" of
          doing things? Why does it come as a new plugin and not as a patch to
          :GLVS?

          Thank you.
          Christophe-Marie
        • Marc Weber
          Hi Christophe-Marie, Let s have a look what would have happened if I did it: - amount of work recquired ========================== # wc
          Message 4 of 15 , Jan 8, 2010
          • 0 Attachment
            Hi Christophe-Marie,

            Let's have a look what would have happened if I did it:

            - amount of work recquired
            ==========================

            # wc /share/vim/vim72/autoload/getscript.vim share/vim/vim72/doc/pi_getscript.txt
            623 2283 21919 getscript.vim
            417 2243 18183 pi_getscript.txt
            1040 4526 40102 total

            So I would have head to read 1000 lines of code and discuss changes with
            maintainers. I also would have had to test changes on all supported
            platforms. I haven't had time to do so.

            My script is about 360 lines including docs. I have to admit that some
            features are still missing. It neither contains 100 lines of
            history

            Maybe this comparison isn't very fair.. I didn't check all details

            - GetScript doesn't exactly do what I have in mind
            ==================================================
            I want that technology and scripts go out of my way.
            Example: How to install a plugin using GetScript?
            a) goto www.vim.org the lookup it's name or spelling
            b) install the plugin yourself.
            c) At first you don't trust it. It may slow you down.
            So you install it into a directory and put
            set runtimepath+=new-plugin
            into your .vimrc
            c) You run GLVS to update all plugins (including the new one) (?)


            Maybe you can tell me how it copes with manual changes such as
            disabling mappings or removing plugins from the plugin/* directory?


            - vim-addon-mannager
            =====================================================

            a)
            :ActivatePlugin *tex*<tab>
            have a look at the list, install one, be done.
            b)
            If you want to continue using it add the name to your .vimrc

            Two steps, no browser. Much faster.

            Notes:

            If you no longer need a plugin run a command like this:
            :RemoveAddonsWhichArentLoadedInteractive (TODO)

            If you don't you can active the plugin at any given time by running
            :ActivatePlugin tex<tab>
            :ActivateInstalledPlugin tex<tab>
            again. In both cases you don't have to remeber it's location.

            So we have new 3 features:
            a) always put plugins into their own directories
            b) provide a list of installable plugins
            c) lazy loading. Load plugins as needed.
            This idea is old. But it's new that you can install and activate
            a plugin in one step.

            a) is a key feature of vim-addon-manager. It would have broken GetScript.

            Note:
            The completion is a TODO item as well as RemoveAddonsWhichArentLoadedInteractive
            Both can be done in 10min.




            Future plans:
            =====================================================
            I want to go further. I want to ask vim-addon-manager to customize
            plugins which actually means copying a runtimepath omitting some
            plugin/*.vim files you don't want. The destination will be added to
            runtimepath instead.

            This all is highly experimental and doesn't fit a stable script such as
            GetScript or many round trips of discussion.

            Of course if many people start using this plugin and ask for a merge I
            will collaborate with Charles E. Campbell and try to merge both scripts.


            If you Christophe-Marie can spend time on writing the patch you asked
            for and if you're going to help testing we can try merging both plugins.

            However keep in mind that I'd rather implement missing features such as
            async communication.

            Marc Weber
          • Christophe-Marie Duquesne
            Hi Marc, I think you made your point pretty clearly, and your plugin has promising features, so I ll have a look asap. ... -- Christophe-Marie Duquesne 06 84
            Message 5 of 15 , Jan 9, 2010
            • 0 Attachment
              Hi Marc,

              I think you made your point pretty clearly, and your plugin has
              promising features, so I'll have a look asap.

              On Fri, Jan 8, 2010 at 12:33 PM, Marc Weber <marco-oweber@...> wrote:
              > Hi Christophe-Marie,
              >
              > Let's have a look what would have happened if I did it:
              >
              > - amount of work recquired
              > ==========================
              >
              >  # wc /share/vim/vim72/autoload/getscript.vim share/vim/vim72/doc/pi_getscript.txt
              >    623  2283 21919 getscript.vim
              >    417  2243 18183 pi_getscript.txt
              >   1040  4526 40102 total
              >
              >  So I would have head to read 1000 lines of code and discuss changes with
              >  maintainers. I also would have had to test changes on all supported
              >  platforms. I haven't had time to do so.
              >
              >  My script is about 360 lines including docs. I have to admit that some
              >  features are still missing. It neither contains 100 lines of
              >  history
              >
              >  Maybe this comparison isn't very fair.. I didn't check all details
              >
              > - GetScript doesn't exactly do what I have in mind
              > ==================================================
              > I want that technology and scripts go out of my way.
              > Example: How to install a plugin using GetScript?
              >  a) goto www.vim.org the lookup it's name or spelling
              >  b) install the plugin yourself.
              >  c) At first you don't trust it. It may slow you down.
              >     So you install it into a directory and put
              >     set runtimepath+=new-plugin
              >     into your .vimrc
              >  c) You run GLVS to update all plugins (including the new one) (?)
              >
              >
              >  Maybe you can tell me how it copes with manual changes such as
              >  disabling mappings or removing plugins from the plugin/* directory?
              >
              >
              > - vim-addon-mannager
              > =====================================================
              >
              >  a)
              >    :ActivatePlugin *tex*<tab>
              >    have a look at the list, install one, be done.
              >  b)
              >    If you want to continue using it add the name to your .vimrc
              >
              > Two steps, no browser. Much faster.
              >
              > Notes:
              >
              > If you no longer need a plugin run a command like this:
              > :RemoveAddonsWhichArentLoadedInteractive (TODO)
              >
              > If you don't you can active the plugin at any given time by running
              >  :ActivatePlugin tex<tab>
              >  :ActivateInstalledPlugin tex<tab>
              > again. In both cases you don't have to remeber it's location.
              >
              > So we have new 3 features:
              >  a) always put plugins into their own directories
              >  b) provide a list of installable plugins
              >  c) lazy loading. Load plugins as needed.
              >     This idea is old. But it's new that you can install and activate
              >      a plugin in one step.
              >
              > a) is a key feature of vim-addon-manager. It would have broken GetScript.
              >
              > Note:
              >  The completion is a TODO item as well as RemoveAddonsWhichArentLoadedInteractive
              >  Both can be done in 10min.
              >
              >
              >
              >
              > Future plans:
              > =====================================================
              >  I want to go further. I want to ask vim-addon-manager to customize
              >  plugins which actually means copying a runtimepath omitting some
              >  plugin/*.vim files you don't want. The destination will be added to
              >  runtimepath instead.
              >
              > This all is highly experimental and doesn't fit a stable script such as
              > GetScript or many round trips of discussion.
              >
              > Of course if many people start using this plugin and ask for a merge I
              > will collaborate with Charles E. Campbell and try to merge both scripts.
              >
              >
              > If you Christophe-Marie can spend time on writing the patch you asked
              > for and if you're going to help testing we can try merging both plugins.
              >
              > However keep in mind that I'd rather implement missing features such as
              > async communication.
              >
              > Marc Weber
              >
              > --
              > You received this message from the "vim_use" maillist.
              > For more information, visit http://www.vim.org/maillist.php
              >



              --
              Christophe-Marie Duquesne
              06 84 14 26 82 - mobile
              04 76 57 48 06 - g-scop
              04 97 04 27 33 - amadeus
            • Christophe-Marie Duquesne
              Oops sorry for the top posting. -- You received this message from the vim_use maillist. For more information, visit http://www.vim.org/maillist.php
              Message 6 of 15 , Jan 9, 2010
              • 0 Attachment
                Oops sorry for the top posting.
              • Marc Weber
                If you have any trouble contact me on irc. I am supporting this plugin and fixing bugs. I just don t have time to test it on Windows. There is one known bug:
                Message 7 of 15 , Jan 10, 2010
                • 0 Attachment
                  If you have any trouble contact me on irc.
                  I am supporting this plugin and fixing bugs.
                  I just don't have time to test it on Windows.

                  There is one known bug: helptags isn't run yet.

                  Marc Weber
                • björn
                  ... Hi Marc, I found your plugin interesting so I decided to try it out so here are my initial thoughts. INSTALLATION: The instructions were sort of confusing
                  Message 8 of 15 , Jan 10, 2010
                  • 0 Attachment
                    On Jan 8, 9:33 am, Marc Weber wrote:
                    >
                    > Goto the section "INSTALLING THIS VIM PLUGIN" to read about the
                    > recommended setup:http://github.com/MarcWeber/vim-addon-manager/blob/master/doc/vim-add...

                    Hi Marc,

                    I found your plugin interesting so I decided to try it out so here are
                    my initial thoughts.

                    INSTALLATION:
                    The instructions were sort of confusing to me. First I had to browse
                    all the way to the help file on the Github site and then the
                    instructions were slightly confusing. I humbly suggest the following:

                    1. I'm don't know much about Github but most other projects have a
                    readme that is visible when you browse to the project. Could you add
                    one of those with the installation instructions?

                    2. The installation instructions should contain the minimal amount of
                    steps to get going. As it stands the instructions are somewhat hard
                    to follow. Things like this:

                    call scriptmanager#Activate(['vim-addon-
                    manager','JSON',"name1","name2"])

                    confused me. What are those extra "JSON", "name1", etc? I later saw
                    described further down, but it would be better to leave them out and
                    mention them in some other paragraph. Also this line:

                    set runtimepath+=PATH_TO_vim-addon-manager

                    was strange. Since you've already suggested the path ~/vim-plugins,
                    why not be explicit again and write

                    set runtimepath+=~/vim-plugins/vim-addon-manager

                    These may seem like minor things, but the less confusion the better.

                    3. The installation instructions mention nothing about help files. As
                    it is you have to realize yourself that you need to go

                    :helptags ~/vim-plugins/vim-addon-manager/doc

                    in order to see the help.


                    HELP:
                    It seems that there is no shortcut to getting a scripts help
                    "installed" at the moment. Do I have to ":helptags path-to-plugin/
                    doc" every time I install a new plugin? It would be nice if this
                    could be handled automatically.


                    OTHER:
                    I found one typo in the help:

                    call scriptmanager#Install("name")

                    should be:

                    call scriptmanager#Install(["name"])

                    Is there any way to get information on a plugin? I mean, I can get a
                    whole list of names with

                    ActivateAddons <c-d>

                    but that isn't very helpful.


                    Anyway, I realize the plugin is still very new and you've probably
                    thought about a lot of these things already, but I just thought I'd
                    share my initial impressions. All my testing was done on Mac OS X
                    10.6 so you'll be pleased to know that your plugin work there as well
                    (I tried installing vim-latex and the surround plugins, but not much
                    else).

                    Björn
                  • Marc Weber
                    Hi Björn, Thank you for you feedback. I tried improving the documentation now. About README: There is one catch: If all plugins contain a README you can t
                    Message 9 of 15 , Jan 10, 2010
                    • 0 Attachment
                      Hi Björn,

                      Thank you for you feedback.
                      I tried improving the documentation now.

                      About README: There is one catch:
                      If all plugins contain a README you can't install them into .vim without
                      causing conflicts. Tim Pope told me about this. That's why I removed the
                      README. But maybe I should readd it because getting started is more
                      important.

                      > Is there any way to get information on a plugin? I mean, I can get a
                      > whole list of names with
                      > ActivateAddons <c-d>
                      > but that isn't very helpful.

                      You made me feel lucky. This shows that you managed to install the
                      plugin and that you like it. You like it because it let's you getting
                      things done faster than using www.vim.org. That was one of my primary
                      goals. And now you want to have the features which www.vim.org provides.

                      How should this look like?
                      May I assist you implementing the missing feature?
                      Reimplementing the http://www.vim.org/search.php doesn't make much
                      sense. That's why I stopped thinking about it.

                      Marc Weber
                    • Tom Link
                      ... You could also create a page and then link to that page. Pages can be checked out as gh-pages branch. Anyway, since your plugin s goal also is to avoid
                      Message 10 of 15 , Jan 10, 2010
                      • 0 Attachment
                        > About README: There is one catch:
                        > If all plugins contain a README you can't install them into .vim without
                        > causing conflicts. Tim Pope told me about this. That's why I removed the
                        > README. But maybe I should readd it because getting started is more
                        > important.

                        You could also create a page and then link to that page. Pages can be
                        checked out as gh-pages branch.

                        Anyway, since your plugin's goal also is to avoid having to install
                        all plugins in the same directory, shouldn't this idea also be
                        applicable to vim-plugin-manager itself?
                      • björn
                        ... Ok, it looks a little bit better...but I insist that it can be even simpler: in the add to .vimrc section I think you should only mention the runtimepath
                        Message 11 of 15 , Jan 10, 2010
                        • 0 Attachment
                          On Jan 10, 7:08 pm, Marc Weber wrote:
                          >
                          > Thank you for you feedback.
                          > I tried improving the documentation now.

                          Ok, it looks a little bit better...but I insist that it can be even
                          simpler: in the "add to .vimrc" section I think you should only
                          mention the runtimepath setting and say "that's it!". Afterwards,
                          mention how to activate plugins...I still don't understand what
                          "name1", "name2" means (ok I do, but it's weird...it looks like I
                          should be able to cut&paste the lines in the help file, but that
                          currently would not work [unless there is are plugins called "name1"
                          and "name2"]).


                          > About README: There is one catch:
                          > If all plugins contain a README you can't install them into .vim without
                          > causing conflicts. Tim Pope told me about this. That's why I removed the
                          > README. But maybe I should readd it because getting started is more
                          > important.

                          I see...that is kind of unfortunate. However, following your
                          instructions the addon-manager plugin should go into its own folder
                          anyway so it's not really that much of a problem then, I guess.


                          > > Is there any way to get information on a plugin?  I mean, I can get a
                          > > whole list of names with
                          > >   ActivateAddons <c-d>
                          > > but that isn't very helpful.
                          >
                          > You made me feel lucky. This shows that you managed to install the
                          > plugin and that you like it. You like it because it let's you getting
                          > things done faster than usingwww.vim.org. That was one of my primary
                          > goals. And now you want to have the features whichwww.vim.orgprovides.
                          >
                          > How should this look like?
                          > May I assist you implementing the missing feature?
                          > Reimplementing thehttp://www.vim.org/search.phpdoesn't make much
                          > sense. That's why I stopped thinking about it.

                          Sorry, I don't really have any good ideas...but at least some minimal
                          information such as one line (a title) stating what the plugin is for
                          and a URL (pointing to vim.org most likely) where you could get more
                          info could be useful. I'm thinking of something like what MacPorts
                          does for you (ok, you don't run OS X so you probably won't know what
                          I'm talking about but I don't know any equivalent in the Linux world).


                          Anyway, I ran into some problems trying to install the LustyExplorer
                          plugin:

                          Error detected while processing function
                          scriptmanager#Activate..scriptmanager#ActivateRecursively..scriptmanager#Install..scriptmanager#Checkout:
                          line 43:
                          E605: Exception not caught: don't know how to checkout source
                          location: {'version': '2.1.1', 'url': 'http://www.vim.org/scripts/
                          download_script.php?src_id=11526', 'vim_version': '7.0', 'date':
                          '2009-10-13', 'vim_script_nr': 1890, 'type': 'archive', 'script-type':
                          'utility', 'archive_name': 'lusty-explorer.vim'}
                          Error detected while processing function
                          scriptmanager#Activate..scriptmanager#ActivateRecursively..scriptmanager#Install:
                          line 18:
                          E171: Missing :endif
                          Error detected while processing function
                          scriptmanager#Activate..scriptmanager#ActivateRecursively:
                          line 10:
                          E171: Missing :endif

                          I'm not sure what this means? Is it not possible to install
                          plain .vim scripts perhaps?

                          Björn
                        • Marc Weber
                          ... Why don t you provide a patch? May I show you how to create one? ... The comment say what name1 and what name2 is. ... There can t be an example which you
                          Message 12 of 15 , Jan 10, 2010
                          • 0 Attachment
                            Excerpts from björn's message of Sun Jan 10 19:45:21 +0100 2010:
                            > On Jan 10, 7:08 pm, Marc Weber wrote:
                            > >
                            > > Thank you for you feedback.
                            > > I tried improving the documentation now.
                            >
                            > Ok, it looks a little bit better...but I insist that it can be even
                            Why don't you provide a patch? May I show you how to create one?

                            > "name1", "name2" means (ok I do, but it's weird...it looks like I
                            The comment say what name1 and what name2 is.

                            > should be able to cut&paste the lines in the help file, but that
                            > currently would not work [unless there is are plugins called "name1"
                            > and "name2"]).

                            There can't be an example which you can cut & paste because I
                            don't know which plugins you're going to install. So best I can do is
                            call them name1 and name2. (I hope nobody's going to upload a plugin
                            called name1 doing nasty things..)

                            I can and I will expect that users think about lines they copy paste
                            into their .vimrc.

                            > I'm not sure what this means? Is it not possible to install
                            > plain .vim scripts perhaps?
                            You're right. the manager knows how to install .vim files only if
                            plugin-type is "syntax". Run git pull once. It will know how to install
                            LustyExplorer then.

                            Yours - Marc Weber
                          • Marc Weber
                            The list of Vim scripts from www.vim.org is updated using a cron job daily. Enjoy! -- You received this message from the vim_use maillist. For more
                            Message 13 of 15 , Jan 16, 2010
                            • 0 Attachment
                              The list of Vim scripts from www.vim.org is updated using a cron job
                              daily.

                              Enjoy!
                            • Marc Weber
                              Hi @ll. There are some news: vim-addon-manager supports marking addons as deprecated. So if you know some plugins which should not be used because they are
                              Message 14 of 15 , Jan 31, 2010
                              • 0 Attachment
                                Hi @ll.

                                There are some news:

                                vim-addon-manager supports marking addons as deprecated.

                                So if you know some plugins which should not be used because they are
                                superseded by another package I'd like to ask you telling me about them.

                                By the way does someone has a script which uploads new versions of
                                scripts to www.vim.org automatically?

                                Marc Weber

                                --
                                You received this message from the "vim_use" maillist.
                                For more information, visit http://www.vim.org/maillist.php
                              • Tom Link
                                ... There seems to be a perl-based script that achieves this: http://github.com/c9s/vim-packager I haven t tested it though. BTW, the name vim-addon-manager is
                                Message 15 of 15 , Feb 1, 2010
                                • 0 Attachment
                                  > By the way does someone has a script which uploads new versions of
                                  > scripts towww.vim.orgautomatically?

                                  There seems to be a perl-based script that achieves this:
                                  http://github.com/c9s/vim-packager

                                  I haven't tested it though.

                                  BTW, the name vim-addon-manager is potentially confusing since there
                                  already is a manager for linux with the same name:
                                  http://packages.debian.org/sid/vim-addon-manager

                                  --
                                  You received this message from the "vim_use" maillist.
                                  For more information, visit http://www.vim.org/maillist.php
                                Your message has been successfully submitted and would be delivered to recipients shortly.