viai-editor / viai-doc-ja / pi_vimball

pi_vimball - ViAI日本語ドキュメント

メインヘルプファイルに戻る English | 日本語 | 編集 |
pi_vimball.txt        For ViAI バージョン 1.0.  Last change: 2026 Apr 16

                               ----------------
                               Vimball Archiver
                               ----------------

Author:  Charles E. Campbell  <NcampObell@SdrPchip.AorgM-NOSPAM>
          (まず Campbell のメールアドレスから NOSPAM を削除すること)
Copyright: (c) 2004-2015 by Charles E. Campbell         Vimball-copyright
        The VIM LICENSE (see copyright) applies to the files in this
        package, including vimballPlugin.vim, vimball.vim, and pi_vimball.txt.
        except use "vimball" instead of "VIM".  Like anything else that's
        free, vimball.vim and its associated files are provided *as is* and
        comes with no warranty of any kind, either expressed or implied.  No
        guarantees of merchantability.  No guarantees of suitability for any
        purpose.  By using this plugin, you agree that in no event will the
        copyright holder be liable for any damages resulting from the use of
        this software. Use at your own risk!

==============================================================================
1. 目次                                 vba vimball vimball-contents

        1. 目次..........................................: vimball-contents
        2. Vimball 入門..................................: vimball-intro
        3. Vimball マニュアル............................: vimball-manual
           MkVimball.....................................: :MkVimball
           UseVimball....................................: :UseVimball
           RmVimball.....................................: :RmVimball
        4. Vimball 履歴..................................: vimball-history


==============================================================================
2. Vimball 入門                                                 vimball-intro

        Vimball はプラグインユーザーの生活をより簡単にすることを意図している。
        ユーザーが vimball に対して行う必要があるのは、これだけである:
                vim someplugin.vba
                :so %
                :q
        すると、プラグインおよびそのすべての構成要素が、それぞれの適切なディレ
        クトリにインストールされる。Note これを行うときに、特定のディレクトリ
        にいる必要はないことに注意。さらに、プラグインのヘルプも自動的にインス
        トールされる。

        ユーザーが AsNeeded プラグインを使うことにしている場合、vimball は賢い
        ので、名目上 .vim/plugin/ 向けのスクリプトを、代わりに .vim/AsNeeded/
        に置く。

        vimball でインストールされたプラグインを削除するのは本当に簡単である:

                vim
                :RmVimball someplugin
        例えば、zip および tarball では、この操作はまったく簡単ではない。

        Vimball はユーザーの 'runtimepath' を調べて、スクリプトをどこに置くか
        を決める。可能なら、通常は runtimepath で最初に挙げられたディレクトリ
        が使われる。そのディレクトリを見るには
                :echo &rtp
        を使う。


==============================================================================
3. Vimball マニュアル                                   vimball-manual

Vimball の作成                                         :MkVimball
                :[range]MkVimball[!] filename [path]

        範囲は、新しい vimball に含めるファイルへのパスを保持する行で構成され、
        パスのうち、通常 runtimepath ('rtp') で指定される部分は省く。例として:

                plugin/something.vim
                doc/something.txt
        この範囲の行に対して
                :[range]MkVimball filename

        を使うと、"filename.vba" というファイルが作成され、それは Vimball.vim
        がこれらのファイルを再作成するのに使える。"filename.vba" ファイルが既
        に存在する場合は、MkVimball は警告を出し、ファイルを作成しない。Note
        これらのパスは .vim (vimfiles) ディレクトリからの相対パスであり、ファ
        イルはそのディレクトリにあるべきであることに注意。vimball プラグインは
        通常、存在する最初の 'runtimepath' ディレクトリをプリフィックスとして
        使う。ユーザーがそのようなパスを指定していない限り、絶対パスを使っては
        ならない。

        感嘆符 (!) を使うと、MkVimball は "filename.vba" ファイルを作成し、そ
        れが既に存在する場合は上書きする。この動作は :w のそれに似ている。

        ファイル名にスラッシュを強制的に入れたい場合も、感嘆符を使うことででき
        る (すなわち :MkVimball! path/filename)。

        http://vim.wikia.com/wiki/Using_VimBall_with_%27Make%27 の tip には、
        make を使って vimball の生成を自動化する方法についての良いアイデアがあ
        る。


Vimball 展開ディレクトリの制御                 g:vimball_home

        変数 g:vimball_home を指定することで、'runtimepath' の使用を上書きでき
        る。

                                                        vimball-extract
                vim filename.vba

        Vimball を単に編集すると、Vimball.vim はユーザーに、内容を展開するため
        にそのファイルを読み込むよう伝える。

        展開は、vimball と思われるファイルの 1 行目に
        "Vimball Archiver by Charles E. Campbell" という行がある場合にのみ進
        む。

Vimball 内のファイルの一覧表示                         :VimballList

                :VimballList

        このコマンドは Vimball に、アーカイブ内のファイルを、行数で表したその
        長さとともに一覧表示させる。

Vimball 展開の手動呼び出し                                     :UseVimball

                :UseVimball [path]

        このコマンドは vimball 自体の中に含まれている。これは vimball の展開を
        担う vimball#Vimball() ルーチンを呼び出す。vimball を読み込む代わりに、
        手でそれを実行することを選んでもよい。また、インストールのためのパスを
        指定することを選んでもよく、それにより、'runtimepath' 上で最初に存在す
        るディレクトリという自動的な選択を上書きする。

Vimball の削除                                         :RmVimball

                :RmVimball vimballfile [path]

        このコマンドは、指定された vimball によって生成されたすべてのファイル
        を削除する (ただし、それが作成したかもしれないディレクトリは削除しな
        い)。アンインストールのためのパスを選ぶこともできる ('runtimepath' を
        参照)。そうでなければ、デフォルトは 'runtimepath' 上で最初に存在する
        ディレクトリである。
        これを実装するため、そのディレクトリにファイル (.VimballRecord) が作成
        され、これまでに使われたすべての vimball について、どのファイルを削除
        する必要があるかの記録を保持する。

読み込みの防止

        何らかの理由で、vimball を使ってプラグインを展開できないようにしたい場
        合は、以下の 2 つの変数を <.vimrc> に入れることで、vimball.vim の読み
        込みを防止できる:

                let g:loaded_vimballPlugin= 1
                let g:loaded_vimball      = 1

Windows                                                vimball-windows

        多くの vimball ファイルは gzip で圧縮されている。残念ながら、Windows
        には gzip されたファイルを展開するツールが付属していない。幸い、
        Windows ユーザーが利用できる、ファイルを un-gzip するためのツールがい
        くつかある:

            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/


==============================================================================
4. Vimball 履歴                                         vimball-history {{{1

        unreleased:
             Feb 28, 2025 * add support for bzip3 (#16755)
             Apr 05, 2026 * Detect path traversal attacks
             Apr 09, 2026 * Detect more path traversal attacks
             Apr 16, 2026 * Block Windows drive letter paths
        37 : Jul 18, 2014 * (by request of T. Miedema) added augroup around
                            the autocmds in vimballPlugin.vim
             Jul 06, 2015 * there are two uses of tabc; changed to tabc!
        34 : Sep 22, 2011 * "UseVimball path" now supports a non-full path by
                            prepending the current directory to it.
        33 : Apr 02, 2011 * Gave priority to *.vmb over *.vba
                          * Changed silent! to sil! (shorter)
                          * Safed 'swf' setting (during vimball extraction,
                            its now turned off)
        32 : May 19, 2010 * (Christian Brabrandt) :so someplugin.vba and
                            :so someplugin.vba.gz (and the other supported
                            compression types) now works
                          * (Jan Steffens) added support for xz compression
                          * fenc extraction was erroneously picking up the
                            end of the line number when no file encoding
                            was present.  Fixed.
                          * By request, beginning the switchover from the vba
                            extension to vmb.  Currently both are supported;
                            MkVimball, however, now will create *.vmb files.
             Feb 11, 2011 * motoyakurotsu reported an error with vimball's
                            handling of zero-length files
             Feb 18, 2016 * Changed =~ to =~# where appropriate
        30 : Dec 08, 2008 * fnameescape() inserted to protect error
                            messaging using corrupted filenames from
                            causing problems
                          * RmVimball supports filenames that would
                            otherwise be considered to have "magic"
                            characters (ie. Abc[1].vba)
             Feb 18, 2009 * s:Escape(), g:vimball_shq, and g:netrw_shq
                            removed (shellescape() used directly)
             Oct 05, 2009 * (Nikolai Weibull) suggested that MkVimball
                            be allowed to use slashes in the filename.
        26 : May 27, 2008 * g:vimball_mkdir usage installed.  Makes the
                            $HOME/.vim (or $HOME\vimfiles) directory if
                            necessary.
             May 30, 2008 * (tnx to Bill McCarthy) found and fixed a bug:
                            vimball wasn't updating plugins to AsNeeded/
                            when it should
        25 : Mar 24, 2008 * changed vimball#Vimball() to recognize doc/*.??x
                            files as help files, too.
             Apr 18, 2008 * RmVimball command is now protected by saving and
                            restoring settings -- in particular, acd was
                            causing problems as reported by Zhang Shuhan
        24 : Nov 15, 2007 * g:vimball_path_escape used by s:Path() to
                            prevent certain characters from causing trouble
                            (defunct: fnameescape() and shellescape()
                            now used instead)
        22 : Mar 21, 2007 * uses setlocal instead of set during BufEnter
        21 : Nov 27, 2006 * (tnx to Bill McCarthy) vimball had a header
                            handling problem and it now changes \s to /s
        20 : Nov 20, 2006 * substitute() calls have all had the 'e' flag
                            removed.
        18 : Aug 01, 2006 * vimballs now use folding to easily display their
                            contents.
                          * if a user has AsNeeded/somefile, then vimball
                            will extract plugin/somefile to the AsNeeded/
                            directory
        17 : Jun 28, 2006 * changes all \s to /s internally for Windows
        16 : Jun 15, 2006 * A. Mechelynck's idea to allow users to specify
                            installation root paths implemented for
                            UseVimball, MkVimball, and RmVimball.
                          * RmVimball implemented
        15 : Jun 13, 2006 * bugfix
        14 : May 26, 2006 * bugfixes
        13 : May 01, 2006 * exists("&acd") used to determine if the acd
                            option exists
        12 : May 01, 2006 * bugfix - the 'acd' option is not always defined
        11 : Apr 27, 2006 * VimballList would create missing subdirectories
                            that the vimball specified were needed.  Fixed.
        10 : Apr 27, 2006 * moved all setting saving/restoration to a pair of
                            functions.  Included some more settings in them
                            which frequently cause trouble.
        9  : Apr 26, 2006 * various changes to support Windows' predilection
                            for backslashes and spaces in file and directory
                            names.
        7  : Apr 25, 2006 * bypasses foldenable
                          * uses more exe and less norm! (:yank :put etc)
                          * does better at insuring a "Press ENTER" prompt
                            appears to keep its messages visible
        4  : Mar 31, 2006 * BufReadPost seems to fire twice; BufReadEnter
                            only fires once, so the "Source this file..."
                            message is now issued only once.
        3  : Mar 20, 2006 * removed query, now requires sourcing to be
                            extracted (:so %).  Message to that effect
                            included.
                          * :VimballList  now shows files that would be
                            extracted.
        2  : Mar 20, 2006 * query, :UseVimball included
        1  : Mar 20, 2006 * initial release


==============================================================================
vim:tw=78:ts=8:noet:ft=help:fdm=marker