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

what is the advantage to use the vimball to get plugins?

Expand Messages
  • yixiaodafang@gmail.com
    Hi, As an average user, I sometime to get plugins for vim. For most computer users, we download the files and unzip them. Now, there are plugins distributed
    Message 1 of 15 , Mar 4, 2010
    • 0 Attachment
      Hi,

      As an average user, I sometime to get plugins for vim. For most
      computer users, we download the files and unzip them. Now, there are
      plugins distributed required users to install another plugin vimball.
      It is confused and causing problems for casual users. So here is the
      question, what is the advantages to use vimball? Is it possible the
      zip packages been distributed also?

      Thanks

      Frank

      --
      You received this message from the "vim_use" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php
    • Marc Weber
      ... Have a look at :h GetLatestVimScripts. But I haven read all the code. It wasn t good enough for me for various reasons anyway. Than s why I wrote
      Message 2 of 15 , Mar 4, 2010
      • 0 Attachment
        Excerpts from yixiaodafang@...'s message of Thu Mar 04 18:40:28 +0100 2010:
        > Hi,
        >
        > As an average user, I sometime to get plugins for vim. For most
        > computer users, we download the files and unzip them. Now, there are
        > plugins distributed required users to install another plugin vimball.
        > It is confused and causing problems for casual users. So here is the
        > question, what is the advantages to use vimball? Is it possible the
        > zip packages been distributed also?

        Have a look at :h GetLatestVimScripts. But I haven' read all the code.
        It wasn't good enough for me for various reasons anyway.
        Than's why I wrote vim-addon-manager. You can find the link on
        www.vim.org (Get the .git version).

        advantages:
        - a copy of the original code is made if the plugin is not installed
        using a VCS. This way you can happily edit the code and create a diff
        later.
        - git, hg, svn is supported. So you can install latest script versions

        - simple dependency managament. (I'd like to make Vim plugins share more
        code)

        - each plugin is installed into its own directory. So you can rm or
        make it no longer load on startup easily.

        Note: vim-addon-manager is using the vimball libraries to install
        vimball scripts.

        Note: There is also Vimana. But you can't add plugins at runtime.

        If you're on Linux it should be easy to setup. On Windows you have to
        install curl and git etc.. So it might not be the fastest option at them
        moment.

        If you want to try it and if you have any trouble contact me. I'll fix
        problems ASAP.

        Marc Weber

        --
        You received this message from the "vim_use" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php
      • Tom Link
        ... vimball is part of the vim. You already have it installed. vba is a simple format for smaller plugins that don t include binary files. What could cause
        Message 3 of 15 , Mar 4, 2010
        • 0 Attachment
          > Now, there are
          > plugins distributed required users to install another plugin vimball.

          vimball is part of the vim. You already have it installed. vba is a
          simple format for smaller plugins that don't include binary files.

          What could cause problems on windows is that most vimballs are
          compressed with gzip, which windows doesn't support out of the box.
          Since you suggest zip, I assume you're running windows. You could,
          e.g., use 7zip to uncompress gz files -- or install some gzip port.

          --
          You received this message from the "vim_use" maillist.
          Do not top-post! Type your reply below the text you are replying to.
          For more information, visit http://www.vim.org/maillist.php
        • Charles Campbell
          ... * vimballs have :RmVimball, which allows one to remove vimball-installed plugins * vimball knows where to put plugins; one does not need to determine
          Message 4 of 15 , Mar 4, 2010
          • 0 Attachment
            yixiaodafang@... wrote:
            > As an average user, I sometime to get plugins for vim. For most
            > computer users, we download the files and unzip them. Now, there are
            > plugins distributed required users to install another plugin vimball.
            > It is confused and causing problems for casual users. So here is the
            > question, what is the advantages to use vimball? Is it possible the
            > zip packages been distributed also?
            >
            * vimballs have :RmVimball, which allows one to remove vimball-installed
            plugins
            * vimball "knows" where to put plugins; one does not need to determine
            where to do the unzipping or to move the vimball somewhere first. Ie.
            one can use :so % on a vimball anywhere; the vimball's contents
            will be placed correctly based on your runtimepath.
            * vimball sets up the help (if any) automatically
            * you do not need to install another plugin -- vimball comes with vim,
            so if you've got vim (since vim v7.1), you've got vimball. You do need
            to enable noncompatibility mode (:set nocp) and to enable plugins
            (filetype plugin on). Of course, if one is intending to use plugins
            from vim.sf.net, at the least these two things need to be done anyway.

            Regards,
            Chip Campbell

            --
            You received this message from the "vim_use" maillist.
            Do not top-post! Type your reply below the text you are replying to.
            For more information, visit http://www.vim.org/maillist.php
          • Tony Mechelynck
            ... WinZip is not exactly freeware, but when I was on Windows some years ago it could unzip *.gz (but not *.bz2) compressed files. In the case of *.tar.gz it
            Message 5 of 15 , Mar 4, 2010
            • 0 Attachment
              On 04/03/10 19:01, Tom Link wrote:
              >> Now, there are
              >> plugins distributed required users to install another plugin vimball.
              >
              > vimball is part of the vim. You already have it installed. vba is a
              > simple format for smaller plugins that don't include binary files.
              >
              > What could cause problems on windows is that most vimballs are
              > compressed with gzip, which windows doesn't support out of the box.
              > Since you suggest zip, I assume you're running windows. You could,
              > e.g., use 7zip to uncompress gz files -- or install some gzip port.
              >

              WinZip is not exactly freeware, but when I was on Windows some years ago
              it could unzip *.gz (but not *.bz2) compressed files. In the case of
              *.tar.gz it even said there was just one archive inside the compressed
              file and asked if I wanted to extract it.

              Installing 7zip (which IIUC is freeware, and, I've been told, knows
              about bz2 format) is also possible, or you could indeed download gzip
              and gunzip (and possibly other Unix utilities) from unxutils, GnuWin32,
              MinGW or Cygwin.


              Best regards,
              Tony.
              --
              An architect's first work is apt to be spare and clean. He
              knows he doesn't know what he's doing, so he does it carefully and with
              great restraint.
              As he designs the first work, frill after frill and
              embellishment after embellishment occur to him. These get stored away
              to be used "next time". Sooner or later the first system is finished,
              and the architect, with firm confidence and a demonstrated mastery of
              that class of systems, is ready to build a second system.
              This second is the most dangerous system a man ever designs.
              When he does his third and later ones, his prior experiences will
              confirm each other as to the general characteristics of such systems,
              and their differences will identify those parts of his experience that
              are particular and not generalizable.
              The general tendency is to over-design the second system, using
              all the ideas and frills that were cautiously sidetracked on the first
              one. The result, as Ovid says, is a "big pile".
              -- Frederick Brooks, "The Mythical Man Month"

              --
              You received this message from the "vim_use" maillist.
              Do not top-post! Type your reply below the text you are replying to.
              For more information, visit http://www.vim.org/maillist.php
            • Charles Campbell
              ... I d like to add a note to vimball (:help vimball-windows) which will provide Windows users information on how to get gzip. Here s a synopsis of what Tony
              Message 6 of 15 , Mar 5, 2010
              • 0 Attachment
                Tony Mechelynck wrote:
                > On 04/03/10 19:01, Tom Link wrote:
                >>> Now, there are
                >>> plugins distributed required users to install another plugin vimball.
                >>
                >> vimball is part of the vim. You already have it installed. vba is a
                >> simple format for smaller plugins that don't include binary files.
                >>
                >> What could cause problems on windows is that most vimballs are
                >> compressed with gzip, which windows doesn't support out of the box.
                >> Since you suggest zip, I assume you're running windows. You could,
                >> e.g., use 7zip to uncompress gz files -- or install some gzip port.
                >>
                >
                > WinZip is not exactly freeware, but when I was on Windows some years
                > ago it could unzip *.gz (but not *.bz2) compressed files. In the case
                > of *.tar.gz it even said there was just one archive inside the
                > compressed file and asked if I wanted to extract it.
                >
                > Installing 7zip (which IIUC is freeware, and, I've been told, knows
                > about bz2 format) is also possible, or you could indeed download gzip
                > and gunzip (and possibly other Unix utilities) from unxutils,
                > GnuWin32, MinGW or Cygwin.
                >
                >
                > Best regards,
                > Tony.

                I'd like to add a note to vimball (:help vimball-windows) which will
                provide Windows users information on how to get gzip. Here's a synopsis
                of what Tony has provided so far:

                Item Tool/Suite Free Website
                ---- ---------- ---- -------
                7zip tool y http://www.7-zip.org/
                Winzip tool n http://www.winzip.com/downwz.htm
                unxutils suite y http://unxutils.sourceforge.net/
                cygwin suite y http://www.cygwin.com/
                GnuWin32 suite y http://gnuwin32.sourceforge.net/
                MinGW suite y http://www.mingw.org/

                (looks best in a fixed-width font)

                I am quite willing to add more tools/suites to the list, if y'all would
                care to contribute.

                Regards,
                Chip Campbell



                --
                You received this message from the "vim_use" maillist.
                Do not top-post! Type your reply below the text you are replying to.
                For more information, visit http://www.vim.org/maillist.php
              • Tom Link
                ... Built-in support for zlib would be better of course. Anyway, I d suggest to restrict the above list to OSS. See also:
                Message 7 of 15 , Mar 5, 2010
                • 0 Attachment
                  >         Item     Tool/Suite   Free   Website
                  >         ----     ----------   ----   -------
                  >         Winzip      tool       n    http://www.winzip.com/downwz.htm

                  Built-in support for zlib would be better of course. Anyway, I'd
                  suggest to restrict the above list to OSS.

                  See also:
                  http://en.wikipedia.org/wiki/Comparison_of_file_archivers

                  It should also be mentioned that many programming languages have
                  support for zlib in their standard library[1]. At least with ruby,
                  handling gz compressed files is rather trivial (see e.g. [2]). Maybe
                  vim's own gzip plugin could be augmented with methods that use
                  compiled-in ruby/python on windows? This would probably require that
                  users can express their preference in a global configuration variable,
                  e.g. g:gzip_method = "external" (= the current behaviour) | "ruby" |
                  "python" | ... Just an idea.


                  [1] http://ruby-doc.org/stdlib/libdoc/zlib/rdoc/index.html
                  http://www.python.org/doc/2.5.2/lib/module-zlib.html
                  [2] http://github.com/tomtom/vimtlib/blob/master/ruby/vimball.rb
                  around line 420

                  --
                  You received this message from the "vim_use" maillist.
                  Do not top-post! Type your reply below the text you are replying to.
                  For more information, visit http://www.vim.org/maillist.php
                • Tony Mechelynck
                  ... [...] If you re on Windows (which was the question that triggered my list of possible methods) the OSS question looks like a trifle: the whole OS is
                  Message 8 of 15 , Mar 6, 2010
                  • 0 Attachment
                    On 06/03/10 06:32, Tom Link wrote:
                    >> Item Tool/Suite Free Website
                    >> ---- ---------- ---- -------
                    >> Winzip tool n http://www.winzip.com/downwz.htm
                    >
                    > Built-in support for zlib would be better of course. Anyway, I'd
                    > suggest to restrict the above list to OSS.
                    [...]

                    If you're on Windows (which was the question that triggered my list of
                    possible methods) the OSS question looks like a trifle: the whole OS is
                    neither free nor open-source, so mentioning one non-free closed-source
                    (but frequently already installed) alternative among several
                    free-and-open ones doesn't look to me like an important issue by
                    comparison, especially since free and non-free choices are clearly
                    marked as such (by Dr. Chip) and that if the non-free choice is already
                    installed, then it might still be the "best" choice after all.

                    Of course, in _my_ opinion going over to Linux (which is FOSS) is the
                    best solution in the long run, but I don't expect to convince many
                    Windows users to make the switch any time soon, and for some (e.g. IIUC
                    in South Korea, where IE enjoys a kind of state-enforced monopoly) it
                    might not even be a possibility right now.


                    Best regards,
                    Tony.
                    --
                    Nine megs for the secretaries fair,
                    Seven megs for the hackers scarce,
                    Five megs for the grads in smoky lairs,
                    Three megs for system source;

                    One disk to rule them all,
                    One disk to bind them,
                    One disk to hold the files
                    And in the darkness grind 'em.

                    --
                    You received this message from the "vim_use" maillist.
                    Do not top-post! Type your reply below the text you are replying to.
                    For more information, visit http://www.vim.org/maillist.php
                  • mmarko
                    ... Since Vim supports Python on multiple platforms, it could be used to add support for multiple archive types. The functions below can pack/unpack gz, bz2
                    Message 9 of 15 , Mar 7, 2010
                    • 0 Attachment
                      On Mar 6, 6:32 am, Tom Link <micat...@...> wrote:
                      > >         Item     Tool/Suite   Free   Website
                      > >         ----     ----------   ----   -------
                      > >         Winzip      tool       n    http://www.winzip.com/downwz.htm
                      >
                      > Built-in support for zlib would be better of course. Anyway, I'd
                      > suggest to restrict the above list to OSS.
                      >

                      Since Vim supports Python on multiple platforms, it could be used
                      to add support for multiple archive types. The functions below can
                      pack/unpack gz, bz2 and zip (files can only be added "incrementally").
                      The code is just a proof of concept and may be the starting point
                      for a real vim-packer.

                      Marko

                      # file: vimpack.py
                      import os, sys
                      import shutil
                      import optparse
                      from string import Template
                      import zlib, gzip, bz2, zipfile

                      def copyfile(fin, fout, chunksize=4096):
                      while True:
                      buf = fin.read(chunksize)
                      fout.write(buf)
                      if len(buf) < chunksize: break

                      def gzip_compress(fname, fnameOut, level=6):
                      fin = open(fname, 'rb')
                      fout = gzip.GzipFile(fnameOut, 'wb', level)
                      copyfile(fin, fout)
                      fin.close()
                      fout.close()

                      def gzip_expand(fname, fnameOut):
                      fin = gzip.GzipFile(fname, 'rb')
                      fout = open(fnameOut, 'wb')
                      copyfile(fin, fout)
                      fin.close()
                      fout.close()

                      def bzip2_compress(fname, fnameOut, level=9):
                      fin = open(fname, 'rb')
                      fout = bz2.BZ2File(fnameOut, 'w', compresslevel=level)
                      copyfile(fin, fout)
                      fin.close()
                      fout.close()

                      def bzip2_expand(fname, fnameOut):
                      fin = bz2.BZ2File(fname, 'r')
                      fout = open(fnameOut, 'wb')
                      copyfile(fin, fout)
                      fin.close()
                      fout.close()

                      # TODO: Find latest versioned file
                      def zip_expand(archive, fnameArchive, fnameFs, level=9):
                      arch = zipfile.ZipFile(archive, 'r')
                      fin = arch.open(fnameArchive, 'r')
                      fout = open(fnameFs, 'wb')
                      copyfile(fin, fout)
                      fin.close()
                      fout.close()
                      arch.close()

                      # If a file fnameArchive is already in zip, a suffix ;N will be added
                      # Otherwise we'd have to rewrite the whole zip file.
                      def zip_compress(archive, fnameFs, fnameArchive, level=9):
                      arch = zipfile.ZipFile(archive, 'a', zipfile.ZIP_DEFLATED)
                      namelist = arch.namelist()
                      if fnameArchive in namelist:
                      n=1
                      while "%s;%d" % (fnameArchive, n) in namelist: n+=1
                      fnameArchive = "%s;%d" % (fnameArchive, n)
                      arch.write(fnameFs, fnameArchive)
                      arch.close()

                      # TODO: Copy to a new zip keeping only latest versioned files
                      def zip_pack(archive):
                      arch = zipfile.ZipFile(archive, 'r')
                      namelist = arch.namelist()
                      for name in namelist:
                      if name.find(";") >= 0: print name
                      arch.close()

                      def test():
                      gzip_expand("example/example1c.txt.gz", "xdata/example1c.txt")
                      gzip_compress("example/example1.txt", "xdata/example1.txt.gz")
                      gzip_expand("xdata/example1.txt.gz", "xdata/example1.txt")

                      bzip2_expand("example/example2c.txt.bz2", "xdata/example2c.txt")
                      bzip2_compress("example/example2.txt", "xdata/example2.txt.bz2")
                      bzip2_expand("xdata/example2.txt.bz2", "xdata/example2.txt")

                      # example3c.zip contains exampleX.txt (X=1..3)
                      zip_expand("example/example3c.zip", "example3.txt", "xdata/
                      example3c.txt")
                      zip_compress("xdata/example3.zip", "example/example3.txt",
                      "example3.txt")
                      zip_expand("xdata/example3.zip", "example3.txt", "xdata/
                      example3.txt")
                      zip_pack("xdata/example3.zip")

                      if __name__ == "__main__": test()

                      --
                      You received this message from the "vim_use" maillist.
                      Do not top-post! Type your reply below the text you are replying to.
                      For more information, visit http://www.vim.org/maillist.php
                    • mmarko
                      ... Below is an untested piece of code that implements a file interface that could be used to unpack files directly into vim buffers: Marko import vim class
                      Message 10 of 15 , Mar 7, 2010
                      • 0 Attachment
                        On Mar 7, 9:31 am, mmarko <marko.mah...@...> wrote:
                        > Since Vim supports Python on multiple platforms, it could be used
                        > to add support for multiple archive types. The functions below can
                        > pack/unpack gz, bz2 and zip (files can only be added "incrementally").
                        > The code is just a proof of concept and may be the starting point
                        > for a real vim-packer.
                        >
                        > Marko

                        Below is an untested piece of code that implements a file interface
                        that could be used to unpack files directly into vim buffers:

                        Marko

                        import vim

                        class VimBufferStream:
                        def __init__(self, bufnr, mode):
                        self.vimbuf = vim.buffers[bufnr]
                        self.lastline = None
                        if mode == 'w': del self.vimbuf[:]
                        elif mode == 'a': pass
                        else: pass # unknown mode, raise error

                        def __del__(self):
                        self.close()

                        def close(self):
                        if self.lastline != None:
                        self.vimbuf.append(self.lastline)

                        def write(self, data):
                        if len(data) < 1: return
                        EOL = "\n" #TODO: system dependant
                        lines = data.split(EOL)
                        if self.lastline != None:
                        lines[0] = self.lastline + lines[0]
                        self.lastline = None
                        if not data.endswith(EOL):
                        self.lastline = lines[-1]
                        lines = lines[:-1]
                        for line in lines: self.vimbuf.append(line + EOL)

                        To use:

                        def gzip_expand_to_buffer(fname, bufnr):
                        fin = gzip.GzipFile(fname, 'rb')
                        fout = VimBufferStream(bufnr, 'w')
                        copyfile(fin, fout)
                        fin.close()
                        fout.close()

                        --
                        You received this message from the "vim_use" maillist.
                        Do not top-post! Type your reply below the text you are replying to.
                        For more information, visit http://www.vim.org/maillist.php
                      • Marc Weber
                        ... So we do have tho code. How should it be distributed? Marc Weber -- You received this message from the vim_use maillist. Do not top-post! Type your reply
                        Message 11 of 15 , Mar 7, 2010
                        • 0 Attachment
                          > The code is just a proof of concept and may be the starting point
                          > for a real vim-packer.

                          So we do have tho code.
                          How should it be distributed?

                          Marc Weber

                          --
                          You received this message from the "vim_use" maillist.
                          Do not top-post! Type your reply below the text you are replying to.
                          For more information, visit http://www.vim.org/maillist.php
                        • mmarko
                          ... I can make a vim plugin from the code, but it will take some time, probably a month since I currently don t have much spare time. I would put the python
                          Message 12 of 15 , Mar 7, 2010
                          • 0 Attachment
                            On Mar 7, 1:17 pm, Marc Weber <marco-owe...@...> wrote:
                            > > The code is just a proof of concept and may be the starting point
                            > > for a real vim-packer.
                            >
                            > So we do have tho code.
                            > How should it be distributed?
                            >
                            > Marc Weber

                            I can make a vim plugin from the code, but it will take some time,
                            probably a month since I currently don't have much spare time.

                            I would put the python code in a module (eg. vimarchive) that would
                            be installed in ~/.vim/modpython
                            (like here: http://vimuiex.sourceforge.net/vimdoc/vxlib_utils.html#vxlib-python).
                            Then I would modify or add the plugins for gzip, bzip, zip, etc. to
                            use the module.

                            Another possibility would be to write executable frontends for each
                            program
                            and just change augroup gzip to use the new frontends:

                            #!python
                            # file pygzip.py
                            import vimpack, sys
                            if sys.argv[1][:2] == '-d': gzip_expand(...)
                            else: gzip_compress(...)

                            #file pygzip.bat
                            python gzip.py %1 %2 %3 ...

                            Marko

                            --
                            You received this message from the "vim_use" maillist.
                            Do not top-post! Type your reply below the text you are replying to.
                            For more information, visit http://www.vim.org/maillist.php
                          • Marc Weber
                            Indeed this works reasonable well. Python lets you add paths to sys.path on the fly. So you can use s:file magic to get to know current path and make python
                            Message 13 of 15 , Mar 7, 2010
                            • 0 Attachment
                              Indeed this works reasonable well.
                              Python lets you add paths to sys.path on the fly.

                              So you can use s:file magic to get to know current path and make python
                              know about this all.

                              Basically your code is not a "plugin". It's a library which should be
                              used by plugins.

                              If it ships with Vim everything is fine. If it's not I'd like you to
                              have a look at vim-addon-manager because it can install plugins like
                              this on the fly. And it let's other plugins specify dependencies.

                              I think we should try hard to make everything as easy as possible for
                              the average user.

                              Marc Weber

                              --
                              You received this message from the "vim_use" maillist.
                              Do not top-post! Type your reply below the text you are replying to.
                              For more information, visit http://www.vim.org/maillist.php
                            • Tom Link
                              ... IMHO it should be integrated with vim s gzip plugin with an option to alternatively plug-in versions written (but not yet implemented) in ruby, tcl, perl
                              Message 14 of 15 , Mar 7, 2010
                              • 0 Attachment
                                > I can make a vim plugin from the code, but it will take some time,
                                > probably a month since I currently don't have much spare time.

                                IMHO it should be integrated with vim's gzip plugin with an option to
                                alternatively plug-in versions written (but not yet implemented) in
                                ruby, tcl, perl or whatever. Assuming this were an acceptable approach
                                for C Campbell.

                                --
                                You received this message from the "vim_use" maillist.
                                Do not top-post! Type your reply below the text you are replying to.
                                For more information, visit http://www.vim.org/maillist.php
                              • mmarko
                                ... Maybe it will become a part of vxlib from vimuiex. ... I will take a look at it. ... I agree. Marko -- You received this message from the vim_use
                                Message 15 of 15 , Mar 7, 2010
                                • 0 Attachment
                                  On Mar 7, 2:42 pm, Marc Weber <marco-owe...@...> wrote:
                                  > Basically your code is not a "plugin". It's a library which should be
                                  > used by plugins.
                                  >
                                  Maybe it will become a part of vxlib from vimuiex.

                                  > If it ships with Vim everything is fine. If it's not I'd like you to
                                  > have a look at vim-addon-manager because it can install plugins like
                                  > this on the fly. And it let's other plugins specify dependencies.
                                  >
                                  I will take a look at it.

                                  > I think we should try hard to make everything as easy as possible for
                                  > the average user.
                                  I agree.

                                  Marko

                                  --
                                  You received this message from the "vim_use" maillist.
                                  Do not top-post! Type your reply below the text you are replying to.
                                  For more information, visit http://www.vim.org/maillist.php
                                Your message has been successfully submitted and would be delivered to recipients shortly.