pi_vimball.txt 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277
  1. *pi_vimball.txt* For Vim version 9.0. Last change: 2016 Apr 11
  2. ----------------
  3. Vimball Archiver
  4. ----------------
  5. Author: Charles E. Campbell <NcampObell@SdrPchip.AorgM-NOSPAM>
  6. (remove NOSPAM from Campbell's email first)
  7. Copyright: (c) 2004-2015 by Charles E. Campbell *Vimball-copyright*
  8. The VIM LICENSE (see |copyright|) applies to the files in this
  9. package, including vimballPlugin.vim, vimball.vim, and pi_vimball.txt.
  10. except use "vimball" instead of "VIM". Like anything else that's free,
  11. vimball.vim and its associated files are provided *as is* and comes with
  12. no warranty of any kind, either expressed or implied. No guarantees
  13. of merchantability. No guarantees of suitability for any purpose. By
  14. using this plugin, you agree that in no event will the copyright
  15. holder be liable for any damages resulting from the use of this
  16. software. Use at your own risk!
  17. ==============================================================================
  18. 1. Contents *vba* *vimball* *vimball-contents*
  19. 1. Contents......................................: |vimball-contents|
  20. 2. Vimball Introduction..........................: |vimball-intro|
  21. 3. Vimball Manual................................: |vimball-manual|
  22. MkVimball.....................................: |:MkVimball|
  23. UseVimball....................................: |:UseVimball|
  24. RmVimball.....................................: |:RmVimball|
  25. 4. Vimball History...............................: |vimball-history|
  26. ==============================================================================
  27. 2. Vimball Introduction *vimball-intro*
  28. Vimball is intended to make life simpler for users of plugins. All
  29. a user needs to do with a vimball is: >
  30. vim someplugin.vba
  31. :so %
  32. :q
  33. < and the plugin and all its components will be installed into their
  34. appropriate directories. Note that one doesn't need to be in any
  35. particular directory when one does this. Plus, any help for the
  36. plugin will also be automatically installed.
  37. If a user has decided to use the AsNeeded plugin, vimball is smart
  38. enough to put scripts nominally intended for .vim/plugin/ into
  39. .vim/AsNeeded/ instead.
  40. Removing a plugin that was installed with vimball is really easy: >
  41. vim
  42. :RmVimball someplugin
  43. < This operation is not at all easy for zips and tarballs, for example.
  44. Vimball examines the user's |'runtimepath'| to determine where to put
  45. the scripts. The first directory mentioned on the runtimepath is
  46. usually used if possible. Use >
  47. :echo &rtp
  48. < to see that directory.
  49. ==============================================================================
  50. 3. Vimball Manual *vimball-manual*
  51. MAKING A VIMBALL *:MkVimball*
  52. :[range]MkVimball[!] filename [path]
  53. The range is composed of lines holding paths to files to be included
  54. in your new vimball, omitting the portion of the paths that is
  55. normally specified by the runtimepath (|'rtp'|). As an example: >
  56. plugin/something.vim
  57. doc/something.txt
  58. < using >
  59. :[range]MkVimball filename
  60. <
  61. on this range of lines will create a file called "filename.vba" which
  62. can be used by Vimball.vim to re-create these files. If the
  63. "filename.vba" file already exists, then MkVimball will issue a
  64. warning and not create the file. Note that these paths are relative
  65. to your .vim (vimfiles) directory, and the files should be in that
  66. directory. The vimball plugin normally uses the first |'runtimepath'|
  67. directory that exists as a prefix; don't use absolute paths, unless
  68. the user has specified such a path.
  69. If you use the exclamation point (!), then MkVimball will create the
  70. "filename.vba" file, overwriting it if it already exists. This
  71. behavior resembles that for |:w|.
  72. If you wish to force slashes into the filename, that can also be done
  73. by using the exclamation mark (ie. :MkVimball! path/filename).
  74. The tip at http://vim.wikia.com/wiki/Using_VimBall_with_%27Make%27
  75. has a good idea on how to automate the production of vimballs using
  76. make.
  77. MAKING DIRECTORIES VIA VIMBALLS *g:vimball_mkdir*
  78. First, the |mkdir()| command is tried (not all systems support it).
  79. If it doesn't exist, then if g:vimball_mkdir doesn't exist, it is set
  80. as follows: >
  81. |g:netrw_localmkdir|, if it exists
  82. "mkdir" , if it is executable
  83. "makedir" , if it is executable
  84. Otherwise , it is undefined.
  85. < One may explicitly specify the directory making command using
  86. g:vimball_mkdir. This command is used to make directories that
  87. are needed as indicated by the vimball.
  88. CONTROLLING THE VIMBALL EXTRACTION DIRECTORY *g:vimball_home*
  89. You may override the use of the |'runtimepath'| by specifying a
  90. variable, g:vimball_home.
  91. *vimball-extract*
  92. vim filename.vba
  93. Simply editing a Vimball will cause Vimball.vim to tell the user to
  94. source the file to extract its contents.
  95. Extraction will only proceed if the first line of a putative vimball
  96. file holds the "Vimball Archiver by Charles E. Campbell" line.
  97. LISTING FILES IN A VIMBALL *:VimballList*
  98. :VimballList
  99. This command will tell Vimball to list the files in the archive, along
  100. with their lengths in lines.
  101. MANUALLY INVOKING VIMBALL EXTRACTION *:UseVimball*
  102. :UseVimball [path]
  103. This command is contained within the vimball itself; it invokes the
  104. vimball#Vimball() routine which is responsible for unpacking the
  105. vimball. One may choose to execute it by hand instead of sourcing
  106. the vimball; one may also choose to specify a path for the
  107. installation, thereby overriding the automatic choice of the first
  108. existing directory on the |'runtimepath'|.
  109. REMOVING A VIMBALL *:RmVimball*
  110. :RmVimball vimballfile [path]
  111. This command removes all files generated by the specified vimball
  112. (but not any directories it may have made). One may choose a path
  113. for de-installation, too (see |'runtimepath'|); otherwise, the
  114. default is the first existing directory on the |'runtimepath'|.
  115. To implement this, a file (.VimballRecord) is made in that directory
  116. containing a record of what files need to be removed for all vimballs
  117. used thus far.
  118. PREVENTING LOADING
  119. If for some reason you don't want to be able to extract plugins
  120. using vimballs: you may prevent the loading of vimball.vim by
  121. putting the following two variables in your <.vimrc>: >
  122. let g:loaded_vimballPlugin= 1
  123. let g:loaded_vimball = 1
  124. <
  125. WINDOWS *vimball-windows*
  126. Many vimball files are compressed with gzip. Windows, unfortunately,
  127. does not come provided with a tool to decompress gzip'ped files.
  128. Fortunately, there are a number of tools available for Windows users
  129. to un-gzip files:
  130. >
  131. Item Tool/Suite Free Website
  132. ---- ---------- ---- -------
  133. 7zip tool y http://www.7-zip.org/
  134. Winzip tool n http://www.winzip.com/downwz.htm
  135. unxutils suite y http://unxutils.sourceforge.net/
  136. cygwin suite y http://www.cygwin.com/
  137. GnuWin32 suite y http://gnuwin32.sourceforge.net/
  138. MinGW suite y http://www.mingw.org/
  139. <
  140. ==============================================================================
  141. 4. Vimball History *vimball-history* {{{1
  142. 37 : Jul 18, 2014 * (by request of T. Miedema) added augroup around
  143. the autocmds in vimballPlugin.vim
  144. Jul 06, 2015 * there are two uses of tabc; changed to tabc!
  145. 34 : Sep 22, 2011 * "UseVimball path" now supports a non-full path by
  146. prepending the current directory to it.
  147. 33 : Apr 02, 2011 * Gave priority to *.vmb over *.vba
  148. * Changed silent! to sil! (shorter)
  149. * Safed |'swf'| setting (during vimball extraction,
  150. its now turned off)
  151. 32 : May 19, 2010 * (Christian Brabrandt) :so someplugin.vba and
  152. :so someplugin.vba.gz (and the other supported
  153. compression types) now works
  154. * (Jan Steffens) added support for xz compression
  155. * fenc extraction was erroneously picking up the
  156. end of the line number when no file encoding
  157. was present. Fixed.
  158. * By request, beginning the switchover from the vba
  159. extension to vmb. Currently both are supported;
  160. MkVimball, however, now will create *.vmb files.
  161. Feb 11, 2011 * motoyakurotsu reported an error with vimball's
  162. handling of zero-length files
  163. Feb 18, 2016 * Changed =~ to =~# where appropriate
  164. 30 : Dec 08, 2008 * fnameescape() inserted to protect error
  165. messaging using corrupted filenames from
  166. causing problems
  167. * RmVimball supports filenames that would
  168. otherwise be considered to have "magic"
  169. characters (ie. Abc[1].vba)
  170. Feb 18, 2009 * s:Escape(), g:vimball_shq, and g:netrw_shq
  171. removed (shellescape() used directly)
  172. Oct 05, 2009 * (Nikolai Weibull) suggested that MkVimball
  173. be allowed to use slashes in the filename.
  174. 26 : May 27, 2008 * g:vimball_mkdir usage installed. Makes the
  175. $HOME/.vim (or $HOME\vimfiles) directory if
  176. necessary.
  177. May 30, 2008 * (tnx to Bill McCarthy) found and fixed a bug:
  178. vimball wasn't updating plugins to AsNeeded/
  179. when it should
  180. 25 : Mar 24, 2008 * changed vimball#Vimball() to recognize doc/*.??x
  181. files as help files, too.
  182. Apr 18, 2008 * RmVimball command is now protected by saving and
  183. restoring settings -- in particular, acd was
  184. causing problems as reported by Zhang Shuhan
  185. 24 : Nov 15, 2007 * g:vimball_path_escape used by s:Path() to
  186. prevent certain characters from causing trouble
  187. (defunct: |fnameescape()| and |shellescape()|
  188. now used instead)
  189. 22 : Mar 21, 2007 * uses setlocal instead of set during BufEnter
  190. 21 : Nov 27, 2006 * (tnx to Bill McCarthy) vimball had a header
  191. handling problem and it now changes \s to /s
  192. 20 : Nov 20, 2006 * substitute() calls have all had the 'e' flag
  193. removed.
  194. 18 : Aug 01, 2006 * vimballs now use folding to easily display their
  195. contents.
  196. * if a user has AsNeeded/somefile, then vimball
  197. will extract plugin/somefile to the AsNeeded/
  198. directory
  199. 17 : Jun 28, 2006 * changes all \s to /s internally for Windows
  200. 16 : Jun 15, 2006 * A. Mechelynck's idea to allow users to specify
  201. installation root paths implemented for
  202. UseVimball, MkVimball, and RmVimball.
  203. * RmVimball implemented
  204. 15 : Jun 13, 2006 * bugfix
  205. 14 : May 26, 2006 * bugfixes
  206. 13 : May 01, 2006 * exists("&acd") used to determine if the acd
  207. option exists
  208. 12 : May 01, 2006 * bugfix - the |'acd'| option is not always defined
  209. 11 : Apr 27, 2006 * VimballList would create missing subdirectories that
  210. the vimball specified were needed. Fixed.
  211. 10 : Apr 27, 2006 * moved all setting saving/restoration to a pair of
  212. functions. Included some more settings in them
  213. which frequently cause trouble.
  214. 9 : Apr 26, 2006 * various changes to support Windows' predilection
  215. for backslashes and spaces in file and directory
  216. names.
  217. 7 : Apr 25, 2006 * bypasses foldenable
  218. * uses more exe and less norm! (:yank :put etc)
  219. * does better at insuring a "Press ENTER" prompt
  220. appears to keep its messages visible
  221. 4 : Mar 31, 2006 * BufReadPost seems to fire twice; BufReadEnter
  222. only fires once, so the "Source this file..."
  223. message is now issued only once.
  224. 3 : Mar 20, 2006 * removed query, now requires sourcing to be
  225. extracted (:so %). Message to that effect
  226. included.
  227. * :VimballList now shows files that would be
  228. extracted.
  229. 2 : Mar 20, 2006 * query, :UseVimball included
  230. 1 : Mar 20, 2006 * initial release
  231. ==============================================================================
  232. vim:tw=78:ts=8:noet:ft=help:fdm=marker