blob: 4d5a23716cd1e3147223c3a4252716200c078348 [file] [log] [blame]
Bram Moolenaar251e1912011-06-19 05:09:16 +02001*pi_vimball.txt* For Vim version 7.3. Last change: 2011 Apr 02
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 Moolenaar3577c6f2008-06-24 21:16:56 +000019 3. Vimball Manual................................: |vimball-manual|
Bram Moolenaar9964e462007-05-05 17:54:07 +000020 MkVimball.....................................: |:MkVimball|
21 UseVimball....................................: |:UseVimball|
22 RmVimball.....................................: |:RmVimball|
Bram Moolenaar3577c6f2008-06-24 21:16:56 +000023 4. Vimball History...............................: |vimball-history|
Bram Moolenaar25e2c9e2006-04-27 21:40:34 +000024
25
26==============================================================================
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000272. Vimball Introduction *vimball-intro*
28
29 Vimball is intended to make life simpler for users of plugins. All
30 a user needs to do with a vimball is: >
31 vim someplugin.vba
32 :so %
33 :q
34< and the plugin and all its components will be installed into their
35 appropriate directories. Note that one doesn't need to be in any
36 particular directory when one does this. Plus, any help for the
37 plugin will also be automatically installed.
38
39 If a user has decided to use the AsNeeded plugin, vimball is smart
40 enough to put scripts nominally intended for .vim/plugin/ into
41 .vim/AsNeeded/ instead.
42
43 Removing a plugin that was installed with vimball is really easy: >
44 vim
45 :RmVimball someplugin
46< This operation is not at all easy for zips and tarballs, for example.
47
48 Vimball examines the user's |'runtimepath'| to determine where to put
49 the scripts. The first directory mentioned on the runtimepath is
50 usually used if possible. Use >
51 :echo &rtp
52< to see that directory.
53
54
55==============================================================================
563. Vimball Manual *vimball-manual*
Bram Moolenaar25e2c9e2006-04-27 21:40:34 +000057
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +010058MAKING A VIMBALL *:MkVimball*
Bram Moolenaar9964e462007-05-05 17:54:07 +000059 :[range]MkVimball[!] filename [path]
Bram Moolenaar25e2c9e2006-04-27 21:40:34 +000060
Bram Moolenaar9964e462007-05-05 17:54:07 +000061 The range is composed of lines holding paths to files to be included
Bram Moolenaar3577c6f2008-06-24 21:16:56 +000062 in your new vimball, omitting the portion of the paths that is
63 normally specified by the runtimepath (|'rtp'|). As an example: >
Bram Moolenaar25e2c9e2006-04-27 21:40:34 +000064 plugin/something.vim
65 doc/something.txt
Bram Moolenaar9964e462007-05-05 17:54:07 +000066< using >
67 :[range]MkVimball filename
68<
69 on this range of lines will create a file called "filename.vba" which
70 can be used by Vimball.vim to re-create these files. If the
Bram Moolenaar25e2c9e2006-04-27 21:40:34 +000071 "filename.vba" file already exists, then MkVimball will issue a
72 warning and not create the file. Note that these paths are relative
73 to your .vim (vimfiles) directory, and the files should be in that
Bram Moolenaar9964e462007-05-05 17:54:07 +000074 directory. The vimball plugin normally uses the first |'runtimepath'|
75 directory that exists as a prefix; don't use absolute paths, unless
76 the user has specified such a path.
Bram Moolenaar25e2c9e2006-04-27 21:40:34 +000077
78 If you use the exclamation point (!), then MkVimball will create the
79 "filename.vba" file, overwriting it if it already exists. This
80 behavior resembles that for |:w|.
81
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +010082 If you wish to force slashes into the filename, that can also be done
83 by using the exclamation mark (ie. :MkVimball! path/filename).
84
85 The tip at http://vim.wikia.com/wiki/Using_VimBall_with_%27Make%27
86 has a good idea on how to automate the production of vimballs using
87 make.
88
89
90MAKING DIRECTORIES VIA VIMBALLS *g:vimball_mkdir*
91
Bram Moolenaar3577c6f2008-06-24 21:16:56 +000092 First, the |mkdir()| command is tried (not all systems support it).
93
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +010094 If it doesn't exist, then if g:vimball_mkdir doesn't exist, it is set
95 as follows: >
Bram Moolenaar3577c6f2008-06-24 21:16:56 +000096 |g:netrw_local_mkdir|, if it exists
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +010097 "mkdir" , if it is executable
98 "makedir" , if it is executable
99 Otherwise , it is undefined.
100< One may explicitly specify the directory making command using
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000101 g:vimball_mkdir. This command is used to make directories that
102 are needed as indicated by the vimball.
103
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100104
105CONTROLLING THE VIMBALL EXTRACTION DIRECTORY *g:vimball_home*
106
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000107 You may override the use of the |'runtimepath'| by specifying a
108 variable, g:vimball_home.
109
Bram Moolenaar25e2c9e2006-04-27 21:40:34 +0000110 *vimball-extract*
111 vim filename.vba
112
113 Simply editing a Vimball will cause Vimball.vim to tell the user to
114 source the file to extract its contents.
115
116 Extraction will only proceed if the first line of a putative vimball
117 file holds the "Vimball Archiver by Charles E. Campbell, Jr., Ph.D."
118 line.
119
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100120LISTING FILES IN A VIMBALL *:VimballList*
121
122 :VimballList
Bram Moolenaarc9b4b052006-04-30 18:54:39 +0000123
Bram Moolenaar25e2c9e2006-04-27 21:40:34 +0000124 This command will tell Vimball to list the files in the archive, along
125 with their lengths in lines.
126
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100127MANUALLY INVOKING VIMBALL EXTRACTION *:UseVimball*
128
129 :UseVimball [path]
Bram Moolenaar9964e462007-05-05 17:54:07 +0000130
131 This command is contained within the vimball itself; it invokes the
132 vimball#Vimball() routine which is responsible for unpacking the
133 vimball. One may choose to execute it by hand instead of sourcing
134 the vimball; one may also choose to specify a path for the
135 installation, thereby overriding the automatic choice of the first
136 existing directory on the |'runtimepath'|.
137
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100138REMOVING A VIMBALL *:RmVimball*
139
140 :RmVimball vimballfile [path]
Bram Moolenaar9964e462007-05-05 17:54:07 +0000141
142 This command removes all files generated by the specified vimball
143 (but not any directories it may have made). One may choose a path
144 for de-installation, too (see |'runtimepath'|); otherwise, the
145 default is the first existing directory on the |'runtimepath'|.
146 To implement this, a file (.VimballRecord) is made in that directory
147 containing a record of what files need to be removed for all vimballs
148 used thus far.
149
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100150PREVENTING LOADING
151
152 If for some reason you don't want to be able to extract plugins
153 using vimballs: you may prevent the loading of vimball.vim by
154 putting the following two variables in your <.vimrc>: >
155
156 let g:loaded_vimballPlugin= 1
157 let g:loaded_vimball = 1
158<
Bram Moolenaar00a927d2010-05-14 23:24:24 +0200159WINDOWS *vimball-windows*
160
161 Many vimball files are compressed with gzip. Windows, unfortunately,
162 does not come provided with a tool to decompress gzip'ped files.
163 Fortunately, there are a number of tools available for Windows users
164 to un-gzip files:
165>
166 Item Tool/Suite Free Website
167 ---- ---------- ---- -------
168 7zip tool y http://www.7-zip.org/
169 Winzip tool n http://www.winzip.com/downwz.htm
170 unxutils suite y http://unxutils.sourceforge.net/
171 cygwin suite y http://www.cygwin.com/
172 GnuWin32 suite y http://gnuwin32.sourceforge.net/
173 MinGW suite y http://www.mingw.org/
174<
Bram Moolenaar25e2c9e2006-04-27 21:40:34 +0000175
176==============================================================================
Bram Moolenaar3577c6f2008-06-24 21:16:56 +00001774. Vimball History *vimball-history* {{{1
Bram Moolenaar25e2c9e2006-04-27 21:40:34 +0000178
Bram Moolenaar251e1912011-06-19 05:09:16 +0200179 33 : Apr 02, 2011 * Gave priority to *.vmb over *.vba
180 * Changed silent! to sil! (shorter)
181 * Safed |'swf'| setting (during vimball extraction,
182 its now turned off)
183 32 : May 19, 2010 * (Christian Brabrandt) :so someplugin.vba and
184 :so someplugin.vba.gz (and the other supported
185 compression types) now works
186 * (Jan Steffens) added support for xz compression
187 * fenc extraction was erroneously picking up the
188 end of the line number when no file encoding
189 was present. Fixed.
190 * By request, beginning the switchover from the vba
191 extension to vmb. Currently both are supported;
192 MkVimball, however, now will create *.vmb files.
193 Feb 11, 2011 * motoyakurotsu reported an error with vimball's
194 handling of zero-length files
Bram Moolenaar8f3f58f2010-01-06 20:52:26 +0100195 30 : Dec 08, 2008 * fnameescape() inserted to protect error
196 messaging using corrupted filenames from
197 causing problems
198 * RmVimball supports filenames that would
199 otherwise be considered to have "magic"
200 characters (ie. Abc[1].vba)
201 Feb 18, 2009 * s:Escape(), g:vimball_shq, and g:netrw_shq
202 removed (shellescape() used directly)
203 Oct 05, 2009 * (Nikolai Weibull) suggested that MkVimball
204 be allowed to use slashes in the filename.
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000205 26 : May 27, 2008 * g:vimball_mkdir usage installed. Makes the
206 $HOME/.vim (or $HOME\vimfiles) directory if
207 necessary.
208 May 30, 2008 * (tnx to Bill McCarthy) found and fixed a bug:
209 vimball wasn't updating plugins to AsNeeded/
210 when it should
211 25 : Mar 24, 2008 * changed vimball#Vimball() to recognize doc/*.??x
212 files as help files, too.
213 Apr 18, 2008 * RmVimball command is now protected by saving and
214 restoring settings -- in particular, acd was
215 causing problems as reported by Zhang Shuhan
Bram Moolenaar945e2db2010-06-05 17:43:32 +0200216 24 : Nov 15, 2007 * g:vimball_path_escape used by s:Path() to
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000217 prevent certain characters from causing trouble
Bram Moolenaar251e1912011-06-19 05:09:16 +0200218 (defunct: |fnameescape()| and |shellescape()|
219 now used instead)
Bram Moolenaar7263a772007-05-10 17:35:54 +0000220 22 : Mar 21, 2007 * uses setlocal instead of set during BufEnter
Bram Moolenaar9964e462007-05-05 17:54:07 +0000221 21 : Nov 27, 2006 * (tnx to Bill McCarthy) vimball had a header
222 handling problem and it now changes \s to /s
223 20 : Nov 20, 2006 * substitute() calls have all had the 'e' flag
224 removed.
225 18 : Aug 01, 2006 * vimballs now use folding to easily display their
226 contents.
227 * if a user has AsNeeded/somefile, then vimball
228 will extract plugin/somefile to the AsNeeded/
229 directory
230 17 : Jun 28, 2006 * changes all \s to /s internally for Windows
Bram Moolenaarc236c162008-07-13 17:41:49 +0000231 16 : Jun 15, 2006 * A. Mechelynck's idea to allow users to specify
Bram Moolenaar9964e462007-05-05 17:54:07 +0000232 installation root paths implemented for
233 UseVimball, MkVimball, and RmVimball.
234 * RmVimball implemented
235 15 : Jun 13, 2006 * bugfix
236 14 : May 26, 2006 * bugfixes
Bram Moolenaard68071d2006-05-02 22:08:30 +0000237 13 : May 01, 2006 * exists("&acd") used to determine if the acd
238 option exists
239 12 : May 01, 2006 * bugfix - the |'acd'| option is not always defined
Bram Moolenaar25e2c9e2006-04-27 21:40:34 +0000240 11 : Apr 27, 2006 * VimballList would create missing subdirectories that
Bram Moolenaar9964e462007-05-05 17:54:07 +0000241 the vimball specified were needed. Fixed.
Bram Moolenaar25e2c9e2006-04-27 21:40:34 +0000242 10 : Apr 27, 2006 * moved all setting saving/restoration to a pair of
Bram Moolenaar9964e462007-05-05 17:54:07 +0000243 functions. Included some more settings in them
Bram Moolenaar25e2c9e2006-04-27 21:40:34 +0000244 which frequently cause trouble.
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000245 9 : Apr 26, 2006 * various changes to support Windows' predilection
Bram Moolenaarc9b4b052006-04-30 18:54:39 +0000246 for backslashes and spaces in file and directory
Bram Moolenaar25e2c9e2006-04-27 21:40:34 +0000247 names.
248 7 : Apr 25, 2006 * bypasses foldenable
Bram Moolenaarc9b4b052006-04-30 18:54:39 +0000249 * uses more exe and less norm! (:yank :put etc)
Bram Moolenaar25e2c9e2006-04-27 21:40:34 +0000250 * does better at insuring a "Press ENTER" prompt
251 appears to keep its messages visible
252 4 : Mar 31, 2006 * BufReadPost seems to fire twice; BufReadEnter
Bram Moolenaarc9b4b052006-04-30 18:54:39 +0000253 only fires once, so the "Source this file..."
Bram Moolenaar25e2c9e2006-04-27 21:40:34 +0000254 message is now issued only once.
255 3 : Mar 20, 2006 * removed query, now requires sourcing to be
Bram Moolenaar9964e462007-05-05 17:54:07 +0000256 extracted (:so %). Message to that effect
Bram Moolenaar25e2c9e2006-04-27 21:40:34 +0000257 included.
258 * :VimballList now shows files that would be
259 extracted.
260 2 : Mar 20, 2006 * query, :UseVimball included
261 1 : Mar 20, 2006 * initial release
262
263
264==============================================================================
265vim:tw=78:ts=8:ft=help:fdm=marker