vim-jp / vimdoc-ja / pi_vimball

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

メインヘルプファイルに戻る English | 日本語 | 編集
pi_vimball.txt        For Vim バージョン 9.1.  Last change: 2016 Apr 11

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

Author:  Charles E. Campbell  <NcampObell@SdrPchip.AorgM-NOSPAM>
          (まずメールアドレスから 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-intro
        3. マニュアル....................................: vimball-manual
           MkVimball.....................................: :MkVimball
           UseVimball....................................: :UseVimball
           RmVimball.....................................: :RmVimball
        4. 開発履歴......................................: vimball-history


==============================================================================
2. はじめに                                                     vimball-intro

        Vimball はプラグインの利用方法をシンプルにします。vimball は次のように
        実行するだけで利用できます: >
                vim someplugin.vba
                :so %
                :q
<       すると、プラグインが適切なディレクトリにインストールされます。実行前に
        適切なディレクトリに移動する必要なんてありません。プラグインのヘルプも
        自動的にインストールされます。

        AsNeeded プラグインを使っている場合、vimball は .vim/plugin/ に入る予
        定のものを適切に .vim/AsNeeded/ に入れます。

        vimball でインストールしたプラグインを削除するのは簡単です: >
                vim
                :RmVimball someplugin
<       例えば zip や tarball でインストールした場合はこのように簡単ではありま
        せん。

        Vimball はユーザーの 'runtimepath' 設定を見てスクリプトのインストー
        ル場所を決定します。通常は runtimepath の最初の使用可能なディレクトリ
        が使われます。次のコマンドでディレクトリを確認できます >
                :echo &rtp
<

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

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

        作成する vimball に含めるファイルのパスを書き、それらの行を範囲指定し
        て実行します。パスは runtimepath ('rtp') からの相対パスです。例: >
                plugin/something.vim
                doc/something.txt
<       この 2 行を範囲指定して次のように実行すると >
                :[range]MkVimball filename
<
        "filename.vba" という名前のファイルが作成されます。Vimball.vim を使う
        ことでこのファイルから元のファイルを再構成できます。"filename.vba" が
        既に存在する場合は警告が表示され、ファイルは作成されません。ファイルの
        パスは .vim (vimfiles) ディレクトリからの相対パスで、ファイルが存在し
        ている必要があります。通常は 'runtimepath' の最初のディレクトリが相
        対パスのルートとして使われます。特別な理由がない限り絶対パスを使わない
        でください。

        感嘆符 (!) を指定すると、既存の "filename.vba" は上書きされます。
        :w コマンドの動作と同じようなものです。

        ファイル名にスラッシュを含めたい場合も感嘆符を付ける必要があります
        (例: :MkVimball! path/filename)。

        http://vim.wikia.com/wiki/Using_VimBall_with_%27Make%27 に、vimball の
        生成を make を使って自動化するための tip が掲載されています。


VIMBALL によるディレクトリの作成                        g:vimball_mkdir

        最初に mkdir() コマンドが試されます (それをサポートしていないシステ
        ムもあります)。

        mkdir() が使えず、g:vimball_mkdir が設定されていない場合は、次の順番
        で設定されます: >
          |g:netrw_localmkdir| (変数が存在するなら)
          "mkdir"              (コマンドが存在するなら)
          "makedir"            (コマンドが存在するなら)
          すべてだめなら       (未定義)
<       g:vimball_mkdir にはディレクトリ作成コマンドを指定します。自分で設定す
        ることもできます。このコマンドは vimball 展開時にディレクトリを作成す
        るために使われます。


VIMBALL を展開するディレクトリの設定                    g:vimball_home

        vimball によって使用される 'runtimepath' を指定したい場合は
        g:vimball_home 変数を設定してください。

                                                        vimball-extract
                vim filename.vba

        ファイルを展開するには、Vimball ファイルを Vim で開き、そのファイルを
        実行 (:source %) してください。

        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 によってインス
        トールされたファイル) が記録されます。

ロードの無効化

        もしなんらかの理由で vimballs プラグインを使いたくない場合は、次の二つ
        の変数を <.vimrc> で設定すると、vimball.vim の読み込みを無効化できま
        す: >

                let g:loaded_vimballPlugin= 1
                let g:loaded_vimball      = 1
<
WINDOWS                                                 vimball-windows

        多くの vimball ファイルは gzip で圧縮されています。残念ながら Windows
        には gzip 圧縮されたファイルを展開するためのツールが含まれていません。
        しかし幸運にも、Windows ユーザーにも使える 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-history {{{1

        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