pi_zip.txt 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. *pi_zip.txt* Nvim
  2. +====================+
  3. | Zip File Interface |
  4. +====================+
  5. Author: Charles E. Campbell <NcampObell@SdrPchip.AorgM-NOSPAM>
  6. (remove NOSPAM from Campbell's email first)
  7. Copyright: Copyright (C) 2005-2015 Charles E Campbell *zip-copyright*
  8. The VIM LICENSE (see |copyright|) applies to the files in this
  9. package, including zipPlugin.vim, zip.vim, and pi_zip.vim. except use
  10. "zip.vim" instead of "VIM". Like anything else that's free, zip.vim
  11. and its associated files are provided as is and comes with no
  12. warranty of any kind, either expressed or implied. No guarantees of
  13. 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 *zip* *zip-contents*
  19. 1. Contents................................................|zip-contents|
  20. 2. Usage...................................................|zip-usage|
  21. 3. Additional Extensions...................................|zip-extension|
  22. 4. History.................................................|zip-history|
  23. ==============================================================================
  24. 2. Usage *zip-usage* *zip-manual*
  25. When one edits a `*.zip` file, this plugin will handle displaying a
  26. contents page. Select a file to edit by moving the cursor atop
  27. the desired file, then hit the <return> key. After editing, one may
  28. also write to the file. Currently, one may not make a new file in
  29. zip archives via the plugin.
  30. COMMANDS~
  31. *zip-x*
  32. x : extract a listed file when the cursor is atop it
  33. OPTIONS~
  34. *g:zip_nomax*
  35. If this variable exists and is true, the file window will not be
  36. automatically maximized when opened.
  37. *g:zip_shq*
  38. Different operating systems may use one or more shells to execute
  39. commands. Zip will try to guess the correct quoting mechanism to
  40. allow spaces and whatnot in filenames; however, if it is incorrectly
  41. guessing the quote to use for your setup, you may use >
  42. g:zip_shq
  43. < which by default is a single quote under Unix (') and a double quote
  44. under Windows ("). If you'd rather have no quotes, simply set
  45. g:zip_shq to the empty string (let g:zip_shq= "") in your <.vimrc>.
  46. *g:zip_unzipcmd*
  47. Use this option to specify the program which does the duty of "unzip".
  48. It's used during browsing. By default: >
  49. let g:zip_unzipcmd= "unzip"
  50. <
  51. *g:zip_zipcmd*
  52. Use this option to specify the program which does the duty of "zip".
  53. It's used during the writing (updating) of a file already in a zip
  54. file; by default: >
  55. let g:zip_zipcmd= "zip"
  56. <
  57. *g:zip_extractcmd*
  58. This option specifies the program (and any options needed) used to
  59. extract a file from a zip archive. By default, >
  60. let g:zip_extractcmd= g:zip_unzipcmd
  61. <
  62. *g:zip_exec*
  63. For security reasons, one may prevent that Vim runs executables
  64. automatically when opening a buffer. This option (default: "1")
  65. can be used to prevent executing the "unzip" command when set to
  66. "0": >
  67. let g:zip_exec=0
  68. <
  69. PREVENTING LOADING~
  70. If for some reason you do not wish to use vim to examine zipped files,
  71. you may put the following two variables into your <.vimrc> to prevent
  72. the zip plugin from loading: >
  73. let g:loaded_zipPlugin= 1
  74. let g:loaded_zip = 1
  75. <
  76. ==============================================================================
  77. 3. Additional Extensions *zip-extension*
  78. Apparently there are a number of archivers which generate zip files that
  79. don't use the .zip extension (.jar, .xpi, etc). To handle such files,
  80. place a line in your <.vimrc> file: >
  81. au BufReadCmd *.jar,*.xpi call zip#Browse(expand("<amatch>"))
  82. <
  83. One can simply extend this line to accommodate additional extensions that
  84. should be treated as zip files.
  85. Alternatively, one may change *g:zipPlugin_ext* in one's .vimrc.
  86. Currently (11/30/15) it holds: >
  87. let g:zipPlugin_ext= '*.zip,*.jar,*.xpi,*.ja,*.war,*.ear,*.celzip,
  88. \ *.oxt,*.kmz,*.wsz,*.xap,*.docx,*.docm,*.dotx,*.dotm,*.potx,*.potm,
  89. \ *.ppsx,*.ppsm,*.pptx,*.pptm,*.ppam,*.sldx,*.thmx,*.xlam,*.xlsx,*.xlsm,
  90. \ *.xlsb,*.xltx,*.xltm,*.xlam,*.crtx,*.vdw,*.glox,*.gcsx,*.gqsx,*.epub'
  91. ==============================================================================
  92. 4. History *zip-history* {{{1
  93. v33 Dec 07, 2021 * `*.xlam` mentioned twice in zipPlugin
  94. v32 Oct 22, 2021 * to avoid an issue with a vim 8.2 patch, zipfile: has
  95. been changed to zipfile:// . This often shows up
  96. as zipfile:/// with zipped files that are root-based.
  97. v29 Apr 02, 2017 * (Klartext) reported that an encrypted zip file could
  98. opened but the swapfile held unencrypted contents.
  99. The solution is to edit the contents of a zip file
  100. using the |:noswapfile| modifier.
  101. v28 Oct 08, 2014 * changed the sanity checks for executables to reflect
  102. the command actually to be attempted in zip#Read()
  103. and zip#Write()
  104. * added the extraction of a file capability
  105. Nov 30, 2015 * added `*.epub` to the |g:zipPlugin_ext| list
  106. Sep 13, 2016 * added `*.apk` to the |g:zipPlugin_ext| list and
  107. sorted the suffices.
  108. v27 Jul 02, 2013 * sanity check: zipfile must have "PK" as its first
  109. two bytes.
  110. * modified to allow zipfile: entries in quickfix lists
  111. v26 Nov 15, 2012 * (Jason Spiro) provided a lot of new extensions that
  112. are synonyms for .zip
  113. v25 Jun 27, 2011 * using keepj with unzip -Z
  114. (consistent with the -p variant)
  115. * (Ben Staniford) now uses
  116. has("win32unix") && executable("cygpath")
  117. before converting to cygwin-style paths
  118. v24 Jun 21, 2010 * (Cédric Bosdonnat) unzip seems to need its filenames
  119. fnameescape'd as well as shellquote'd
  120. * (Motoya Kurotsu) inserted keepj before 0d to protect
  121. jump list
  122. v17 May 09, 2008 * arno caught a security bug
  123. v15 Sep 07, 2007 * &shq now used if not the empty string for g:zip_shq
  124. v14 May 07, 2007 * using b:zipfile instead of w:zipfile to avoid problem
  125. when editing alternate file to bring up a zipfile
  126. v10 May 02, 2006 * now using "redraw then echo" to show messages, instead
  127. of "echo and prompt user"
  128. * g:zip_shq provided to allow for quoting control for the
  129. command being passed via :r! ... commands.
  130. v8 Apr 10, 2006 * Bram Moolenaar reported that he received an error message
  131. due to "Pattern not found: ^.*\%0c"; this was caused by
  132. stridx finding a Name... at the beginning of the line;
  133. zip.vim tried 4,$s/^.*\%0c//, but that doesn't work.
  134. Fixed.
  135. v7 Mar 22, 2006 * escaped some characters that can cause filename handling
  136. problems.
  137. v6 Dec 21, 2005 * writing to files not in directories caused problems -
  138. fixed (pointed out by Christian Robinson)
  139. v5 Nov 22, 2005 * report option workaround installed
  140. v3 Oct 18, 2005 * <amatch> used instead of <afile> in autocmds
  141. v2 Sep 16, 2005 * silenced some commands (avoiding hit-enter prompt)
  142. * began testing under Windows; works thus far
  143. * filetype detection fixed
  144. Nov 03, 2005 * handles writing zipfiles across a network using
  145. netrw#NetWrite()
  146. v1 Sep 15, 2005 * Initial release, had browsing, reading, and writing
  147. ==============================================================================
  148. vim:tw=78:ts=8:ft=help:noet:norl:fdm=marker