blob: 73e3e66698408707a8946be04725304641ab8a4e [file] [log] [blame]
Bram Moolenaar5302d9e2011-09-14 17:55:08 +02001*pi_vimball.txt* For Vim version 7.3. Last change: 2011 Aug 14
Bram Moolenaar25e2c9e2006-04-27 21:40:34 +00002
3 ----------------
4 Vimball Archiver
5 ----------------
6
7Author: Charles E. Campbell, Jr. <NdrOchip@ScampbellPfamily.AbizM>
8 (remove NOSPAM from Campbell's email first)
Bram Moolenaar251e1912011-06-19 05:09:16 +02009Copyright: (c) 2004-2011 by Charles E. Campbell, Jr. *Vimball-copyright*
Bram Moolenaarc9b4b052006-04-30 18:54:39 +000010 The VIM LICENSE applies to Vimball.vim, and Vimball.txt
11 (see |copyright|) except use "Vimball" instead of "Vim".
Bram Moolenaar25e2c9e2006-04-27 21:40:34 +000012 No warranty, express or implied.
13 Use At-Your-Own-Risk!
14
15==============================================================================
Bram Moolenaar9964e462007-05-05 17:54:07 +0000161. Contents *vba* *vimball* *vimball-contents*
Bram Moolenaar25e2c9e2006-04-27 21:40:34 +000017
18 1. Contents......................................: |vimball-contents|
Bram Moolenaar5302d9e2011-09-14 17:55:08 +020019 2. Vimball Introduction..........................: |vimball-intro|
Bram Moolenaar3577c6f2008-06-24 21:16:56 +000020 3. Vimball Manual................................: |vimball-manual|
Bram Moolenaar9964e462007-05-05 17:54:07 +000021 MkVimball.....................................: |:MkVimball|
22 UseVimball....................................: |:UseVimball|
23 RmVimball.....................................: |:RmVimball|
Bram Moolenaar3577c6f2008-06-24 21:16:56 +000024 4. Vimball History...............................: |vimball-history|
Bram Moolenaar25e2c9e2006-04-27 21:40:34 +000025
26
27==============================================================================
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000282. Vimball Introduction *vimball-intro*
29
30 Vimball is intended to make life simpler for users of plugins. All
31 a user needs to do with a vimball is: >
32 vim someplugin.vba
33 :so %
34 :q
35< and the plugin and all its components will be installed into their
36 appropriate directories. Note that one doesn't need to be in any
37 particular directory when one does this. Plus, any help for the
38 plugin will also be automatically installed.
39
40 If a user has decided to use the AsNeeded plugin, vimball is smart
41 enough to put scripts nominally intended for .vim/plugin/ into
42 .vim/AsNeeded/ instead.
43
44 Removing a plugin that was installed with vimball is really easy: >
45 vim
46 :RmVimball someplugin
47< This operation is not at all easy for zips and tarballs, for example.
48
49 Vimball examines the user's |'runtimepath'| to determine where to put
50 the scripts. The first directory mentioned on the runtimepath is
51 usually used if possible. Use >
52 :echo &rtp
53< to see that directory.
54
55
56==============================================================================
573. Vimball Manual *vimball-manual*
Bram Moolenaar25e2c9e2006-04-27 21:40:34 +000058
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +010059MAKING A VIMBALL *:MkVimball*
Bram Moolenaar9964e462007-05-05 17:54:07 +000060 :[range]MkVimball[!] filename [path]
Bram Moolenaar25e2c9e2006-04-27 21:40:34 +000061
Bram Moolenaar9964e462007-05-05 17:54:07 +000062 The range is composed of lines holding paths to files to be included
Bram Moolenaar3577c6f2008-06-24 21:16:56 +000063 in your new vimball, omitting the portion of the paths that is
64 normally specified by the runtimepath (|'rtp'|). As an example: >
Bram Moolenaar25e2c9e2006-04-27 21:40:34 +000065 plugin/something.vim
66 doc/something.txt
Bram Moolenaar9964e462007-05-05 17:54:07 +000067< using >
68 :[range]MkVimball filename
69<
70 on this range of lines will create a file called "filename.vba" which
71 can be used by Vimball.vim to re-create these files. If the
Bram Moolenaar25e2c9e2006-04-27 21:40:34 +000072 "filename.vba" file already exists, then MkVimball will issue a
73 warning and not create the file. Note that these paths are relative
74 to your .vim (vimfiles) directory, and the files should be in that
Bram Moolenaar9964e462007-05-05 17:54:07 +000075 directory. The vimball plugin normally uses the first |'runtimepath'|
76 directory that exists as a prefix; don't use absolute paths, unless
77 the user has specified such a path.
Bram Moolenaar25e2c9e2006-04-27 21:40:34 +000078
79 If you use the exclamation point (!), then MkVimball will create the
80 "filename.vba" file, overwriting it if it already exists. This
81 behavior resembles that for |:w|.
82
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +010083 If you wish to force slashes into the filename, that can also be done
84 by using the exclamation mark (ie. :MkVimball! path/filename).
85
86 The tip at http://vim.wikia.com/wiki/Using_VimBall_with_%27Make%27
87 has a good idea on how to automate the production of vimballs using
88 make.
89
90
91MAKING DIRECTORIES VIA VIMBALLS *g:vimball_mkdir*
92
Bram Moolenaar3577c6f2008-06-24 21:16:56 +000093 First, the |mkdir()| command is tried (not all systems support it).
94
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +010095 If it doesn't exist, then if g:vimball_mkdir doesn't exist, it is set
96 as follows: >
Bram Moolenaar3577c6f2008-06-24 21:16:56 +000097 |g:netrw_local_mkdir|, if it exists
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +010098 "mkdir" , if it is executable
99 "makedir" , if it is executable
100 Otherwise , it is undefined.
101< One may explicitly specify the directory making command using
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000102 g:vimball_mkdir. This command is used to make directories that
103 are needed as indicated by the vimball.
104
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100105
106CONTROLLING THE VIMBALL EXTRACTION DIRECTORY *g:vimball_home*
107
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000108 You may override the use of the |'runtimepath'| by specifying a
109 variable, g:vimball_home.
110
Bram Moolenaar25e2c9e2006-04-27 21:40:34 +0000111 *vimball-extract*
112 vim filename.vba
113
114 Simply editing a Vimball will cause Vimball.vim to tell the user to
115 source the file to extract its contents.
116
117 Extraction will only proceed if the first line of a putative vimball
118 file holds the "Vimball Archiver by Charles E. Campbell, Jr., Ph.D."
119 line.
120
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100121LISTING FILES IN A VIMBALL *:VimballList*
122
123 :VimballList
Bram Moolenaarc9b4b052006-04-30 18:54:39 +0000124
Bram Moolenaar25e2c9e2006-04-27 21:40:34 +0000125 This command will tell Vimball to list the files in the archive, along
126 with their lengths in lines.
127
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100128MANUALLY INVOKING VIMBALL EXTRACTION *:UseVimball*
129
130 :UseVimball [path]
Bram Moolenaar9964e462007-05-05 17:54:07 +0000131
132 This command is contained within the vimball itself; it invokes the
133 vimball#Vimball() routine which is responsible for unpacking the
134 vimball. One may choose to execute it by hand instead of sourcing
135 the vimball; one may also choose to specify a path for the
136 installation, thereby overriding the automatic choice of the first
137 existing directory on the |'runtimepath'|.
138
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100139REMOVING A VIMBALL *:RmVimball*
140
141 :RmVimball vimballfile [path]
Bram Moolenaar9964e462007-05-05 17:54:07 +0000142
143 This command removes all files generated by the specified vimball
144 (but not any directories it may have made). One may choose a path
145 for de-installation, too (see |'runtimepath'|); otherwise, the
146 default is the first existing directory on the |'runtimepath'|.
147 To implement this, a file (.VimballRecord) is made in that directory
148 containing a record of what files need to be removed for all vimballs
149 used thus far.
150
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100151PREVENTING LOADING
152
153 If for some reason you don't want to be able to extract plugins
154 using vimballs: you may prevent the loading of vimball.vim by
155 putting the following two variables in your <.vimrc>: >
156
157 let g:loaded_vimballPlugin= 1
158 let g:loaded_vimball = 1
159<
Bram Moolenaar00a927d2010-05-14 23:24:24 +0200160WINDOWS *vimball-windows*
161
162 Many vimball files are compressed with gzip. Windows, unfortunately,
163 does not come provided with a tool to decompress gzip'ped files.
164 Fortunately, there are a number of tools available for Windows users
165 to un-gzip files:
166>
167 Item Tool/Suite Free Website
168 ---- ---------- ---- -------
169 7zip tool y http://www.7-zip.org/
170 Winzip tool n http://www.winzip.com/downwz.htm
171 unxutils suite y http://unxutils.sourceforge.net/
172 cygwin suite y http://www.cygwin.com/
173 GnuWin32 suite y http://gnuwin32.sourceforge.net/
174 MinGW suite y http://www.mingw.org/
175<
Bram Moolenaar25e2c9e2006-04-27 21:40:34 +0000176
177==============================================================================
Bram Moolenaar3577c6f2008-06-24 21:16:56 +00001784. Vimball History *vimball-history* {{{1
Bram Moolenaar25e2c9e2006-04-27 21:40:34 +0000179
Bram Moolenaar251e1912011-06-19 05:09:16 +0200180 33 : Apr 02, 2011 * Gave priority to *.vmb over *.vba
181 * Changed silent! to sil! (shorter)
182 * Safed |'swf'| setting (during vimball extraction,
183 its now turned off)
184 32 : May 19, 2010 * (Christian Brabrandt) :so someplugin.vba and
185 :so someplugin.vba.gz (and the other supported
186 compression types) now works
187 * (Jan Steffens) added support for xz compression
188 * fenc extraction was erroneously picking up the
189 end of the line number when no file encoding
190 was present. Fixed.
191 * By request, beginning the switchover from the vba
192 extension to vmb. Currently both are supported;
193 MkVimball, however, now will create *.vmb files.
194 Feb 11, 2011 * motoyakurotsu reported an error with vimball's
195 handling of zero-length files
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100196 30 : Dec 08, 2008 * fnameescape() inserted to protect error
197 messaging using corrupted filenames from
198 causing problems
199 * RmVimball supports filenames that would
200 otherwise be considered to have "magic"
201 characters (ie. Abc[1].vba)
202 Feb 18, 2009 * s:Escape(), g:vimball_shq, and g:netrw_shq
203 removed (shellescape() used directly)
204 Oct 05, 2009 * (Nikolai Weibull) suggested that MkVimball
205 be allowed to use slashes in the filename.
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000206 26 : May 27, 2008 * g:vimball_mkdir usage installed. Makes the
207 $HOME/.vim (or $HOME\vimfiles) directory if
208 necessary.
209 May 30, 2008 * (tnx to Bill McCarthy) found and fixed a bug:
210 vimball wasn't updating plugins to AsNeeded/
211 when it should
212 25 : Mar 24, 2008 * changed vimball#Vimball() to recognize doc/*.??x
213 files as help files, too.
214 Apr 18, 2008 * RmVimball command is now protected by saving and
215 restoring settings -- in particular, acd was
216 causing problems as reported by Zhang Shuhan
Bram Moolenaar945e2db2010-06-05 17:43:32 +0200217 24 : Nov 15, 2007 * g:vimball_path_escape used by s:Path() to
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000218 prevent certain characters from causing trouble
Bram Moolenaar251e1912011-06-19 05:09:16 +0200219 (defunct: |fnameescape()| and |shellescape()|
220 now used instead)
Bram Moolenaar7263a772007-05-10 17:35:54 +0000221 22 : Mar 21, 2007 * uses setlocal instead of set during BufEnter
Bram Moolenaar9964e462007-05-05 17:54:07 +0000222 21 : Nov 27, 2006 * (tnx to Bill McCarthy) vimball had a header
223 handling problem and it now changes \s to /s
224 20 : Nov 20, 2006 * substitute() calls have all had the 'e' flag
225 removed.
226 18 : Aug 01, 2006 * vimballs now use folding to easily display their
227 contents.
228 * if a user has AsNeeded/somefile, then vimball
229 will extract plugin/somefile to the AsNeeded/
230 directory
231 17 : Jun 28, 2006 * changes all \s to /s internally for Windows
Bram Moolenaarc236c162008-07-13 17:41:49 +0000232 16 : Jun 15, 2006 * A. Mechelynck's idea to allow users to specify
Bram Moolenaar9964e462007-05-05 17:54:07 +0000233 installation root paths implemented for
234 UseVimball, MkVimball, and RmVimball.
235 * RmVimball implemented
236 15 : Jun 13, 2006 * bugfix
237 14 : May 26, 2006 * bugfixes
Bram Moolenaard68071d2006-05-02 22:08:30 +0000238 13 : May 01, 2006 * exists("&acd") used to determine if the acd
239 option exists
240 12 : May 01, 2006 * bugfix - the |'acd'| option is not always defined
Bram Moolenaar25e2c9e2006-04-27 21:40:34 +0000241 11 : Apr 27, 2006 * VimballList would create missing subdirectories that
Bram Moolenaar9964e462007-05-05 17:54:07 +0000242 the vimball specified were needed. Fixed.
Bram Moolenaar25e2c9e2006-04-27 21:40:34 +0000243 10 : Apr 27, 2006 * moved all setting saving/restoration to a pair of
Bram Moolenaar9964e462007-05-05 17:54:07 +0000244 functions. Included some more settings in them
Bram Moolenaar25e2c9e2006-04-27 21:40:34 +0000245 which frequently cause trouble.
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000246 9 : Apr 26, 2006 * various changes to support Windows' predilection
Bram Moolenaarc9b4b052006-04-30 18:54:39 +0000247 for backslashes and spaces in file and directory
Bram Moolenaar25e2c9e2006-04-27 21:40:34 +0000248 names.
249 7 : Apr 25, 2006 * bypasses foldenable
Bram Moolenaarc9b4b052006-04-30 18:54:39 +0000250 * uses more exe and less norm! (:yank :put etc)
Bram Moolenaar25e2c9e2006-04-27 21:40:34 +0000251 * does better at insuring a "Press ENTER" prompt
252 appears to keep its messages visible
253 4 : Mar 31, 2006 * BufReadPost seems to fire twice; BufReadEnter
Bram Moolenaarc9b4b052006-04-30 18:54:39 +0000254 only fires once, so the "Source this file..."
Bram Moolenaar25e2c9e2006-04-27 21:40:34 +0000255 message is now issued only once.
256 3 : Mar 20, 2006 * removed query, now requires sourcing to be
Bram Moolenaar9964e462007-05-05 17:54:07 +0000257 extracted (:so %). Message to that effect
Bram Moolenaar25e2c9e2006-04-27 21:40:34 +0000258 included.
259 * :VimballList now shows files that would be
260 extracted.
261 2 : Mar 20, 2006 * query, :UseVimball included
262 1 : Mar 20, 2006 * initial release
263
264
265==============================================================================
266vim:tw=78:ts=8:ft=help:fdm=marker