vimball.txt 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  1. *vimball.txt* For Vim version 7.4. Last change: 2012 Jan 17
  2. ----------------
  3. Vimball Archiver
  4. ----------------
  5. Author: Charles E. Campbell, Jr. <NdrOchip@ScampbellPfamily.AbizM>
  6. (remove NOSPAM from Campbell's email first)
  7. Copyright: (c) 2004-2012 by Charles E. Campbell, Jr. *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 https://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_local_mkdir|, 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, Jr., Ph.D."
  97. line.
  98. LISTING FILES IN A VIMBALL *:VimballList*
  99. :VimballList
  100. This command will tell Vimball to list the files in the archive, along
  101. with their lengths in lines.
  102. MANUALLY INVOKING VIMBALL EXTRACTION *:UseVimball*
  103. :UseVimball [path]
  104. This command is contained within the vimball itself; it invokes the
  105. vimball#Vimball() routine which is responsible for unpacking the
  106. vimball. One may choose to execute it by hand instead of sourcing
  107. the vimball; one may also choose to specify a path for the
  108. installation, thereby overriding the automatic choice of the first
  109. existing directory on the |'runtimepath'|.
  110. REMOVING A VIMBALL *:RmVimball*
  111. :RmVimball vimballfile [path]
  112. This command removes all files generated by the specified vimball
  113. (but not any directories it may have made). One may choose a path
  114. for de-installation, too (see |'runtimepath'|); otherwise, the
  115. default is the first existing directory on the |'runtimepath'|.
  116. To implement this, a file (.VimballRecord) is made in that directory
  117. containing a record of what files need to be removed for all vimballs
  118. used thus far.
  119. PREVENTING LOADING
  120. If for some reason you don't want to be able to extract plugins
  121. using vimballs: you may prevent the loading of vimball.vim by
  122. putting the following two variables in your <.vimrc>: >
  123. let g:loaded_vimballPlugin= 1
  124. let g:loaded_vimball = 1
  125. <
  126. WINDOWS *vimball-windows*
  127. Many vimball files are compressed with gzip. Windows, unfortunately,
  128. does not come provided with a tool to decompress gzip'ped files.
  129. Fortunately, there are a number of tools available for Windows users
  130. to un-gzip files:
  131. >
  132. Item Tool/Suite Free Website
  133. ---- ---------- ---- -------
  134. 7zip tool y https://www.7-zip.org/
  135. Winzip tool n https://www.winzip.com/downwz.htm
  136. unxutils suite y https://unxutils.sourceforge.net/
  137. cygwin suite y https://www.cygwin.com/
  138. GnuWin32 suite y https://gnuwin32.sourceforge.net/
  139. MinGW suite y https://www.mingw.org/
  140. <
  141. ==============================================================================
  142. 4. Vimball History *vimball-history* {{{1
  143. 34 : Sep 22, 2011 * "UseVimball path" now supports a non-full path by
  144. prepending the current directory to it.
  145. 33 : Apr 02, 2011 * Gave priority to *.vmb over *.vba
  146. * Changed silent! to sil! (shorter)
  147. * Safed |'swf'| setting (during vimball extraction,
  148. its now turned off)
  149. 32 : May 19, 2010 * (Christian Brabandt) :so someplugin.vba and
  150. :so someplugin.vba.gz (and the other supported
  151. compression types) now works
  152. * (Jan Steffens) added support for xz compression
  153. * fenc extraction was erroneously picking up the
  154. end of the line number when no file encoding
  155. was present. Fixed.
  156. * By request, beginning the switchover from the vba
  157. extension to vmb. Currently both are supported;
  158. MkVimball, however, now will create *.vmb files.
  159. Feb 11, 2011 * motoyakurotsu reported an error with vimball's
  160. handling of zero-length files
  161. 30 : Dec 08, 2008 * fnameescape() inserted to protect error
  162. messaging using corrupted filenames from
  163. causing problems
  164. * RmVimball supports filenames that would
  165. otherwise be considered to have "magic"
  166. characters (ie. Abc[1].vba)
  167. Feb 18, 2009 * s:Escape(), g:vimball_shq, and g:netrw_shq
  168. removed (shellescape() used directly)
  169. Oct 05, 2009 * (Nikolai Weibull) suggested that MkVimball
  170. be allowed to use slashes in the filename.
  171. 26 : May 27, 2008 * g:vimball_mkdir usage installed. Makes the
  172. $HOME/.vim (or $HOME\vimfiles) directory if
  173. necessary.
  174. May 30, 2008 * (tnx to Bill McCarthy) found and fixed a bug:
  175. vimball wasn't updating plugins to AsNeeded/
  176. when it should
  177. 25 : Mar 24, 2008 * changed vimball#Vimball() to recognize doc/*.??x
  178. files as help files, too.
  179. Apr 18, 2008 * RmVimball command is now protected by saving and
  180. restoring settings -- in particular, acd was
  181. causing problems as reported by Zhang Shuhan
  182. 24 : Nov 15, 2007 * g:vimball_path_escape used by s:Path() to
  183. prevent certain characters from causing trouble
  184. (defunct: |fnameescape()| and |shellescape()|
  185. now used instead)
  186. 22 : Mar 21, 2007 * uses setlocal instead of set during BufEnter
  187. 21 : Nov 27, 2006 * (tnx to Bill McCarthy) vimball had a header
  188. handling problem and it now changes \s to /s
  189. 20 : Nov 20, 2006 * substitute() calls have all had the 'e' flag
  190. removed.
  191. 18 : Aug 01, 2006 * vimballs now use folding to easily display their
  192. contents.
  193. * if a user has AsNeeded/somefile, then vimball
  194. will extract plugin/somefile to the AsNeeded/
  195. directory
  196. 17 : Jun 28, 2006 * changes all \s to /s internally for Windows
  197. 16 : Jun 15, 2006 * A. Mechelynck's idea to allow users to specify
  198. installation root paths implemented for
  199. UseVimball, MkVimball, and RmVimball.
  200. * RmVimball implemented
  201. 15 : Jun 13, 2006 * bugfix
  202. 14 : May 26, 2006 * bugfixes
  203. 13 : May 01, 2006 * exists("&acd") used to determine if the acd
  204. option exists
  205. 12 : May 01, 2006 * bugfix - the |'acd'| option is not always defined
  206. 11 : Apr 27, 2006 * VimballList would create missing subdirectories that
  207. the vimball specified were needed. Fixed.
  208. 10 : Apr 27, 2006 * moved all setting saving/restoration to a pair of
  209. functions. Included some more settings in them
  210. which frequently cause trouble.
  211. 9 : Apr 26, 2006 * various changes to support Windows' predilection
  212. for backslashes and spaces in file and directory
  213. names.
  214. 7 : Apr 25, 2006 * bypasses foldenable
  215. * uses more exe and less norm! (:yank :put etc)
  216. * does better at insuring a "Press ENTER" prompt
  217. appears to keep its messages visible
  218. 4 : Mar 31, 2006 * BufReadPost seems to fire twice; BufReadEnter
  219. only fires once, so the "Source this file..."
  220. message is now issued only once.
  221. 3 : Mar 20, 2006 * removed query, now requires sourcing to be
  222. extracted (:so %). Message to that effect
  223. included.
  224. * :VimballList now shows files that would be
  225. extracted.
  226. 2 : Mar 20, 2006 * query, :UseVimball included
  227. 1 : Mar 20, 2006 * initial release
  228. ==============================================================================
  229. vim:tw=78:ts=8:ft=help:fdm=marker