pi_zip.txt 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  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. PREVENTING LOADING~
  63. If for some reason you do not wish to use vim to examine zipped files,
  64. you may put the following two variables into your <.vimrc> to prevent
  65. the zip plugin from loading: >
  66. let g:loaded_zipPlugin= 1
  67. let g:loaded_zip = 1
  68. <
  69. ==============================================================================
  70. 3. Additional Extensions *zip-extension*
  71. Apparently there are a number of archivers which generate zip files that
  72. don't use the .zip extension (.jar, .xpi, etc). To handle such files,
  73. place a line in your <.vimrc> file: >
  74. au BufReadCmd *.jar,*.xpi call zip#Browse(expand("<amatch>"))
  75. <
  76. One can simply extend this line to accommodate additional extensions that
  77. should be treated as zip files.
  78. Alternatively, one may change *g:zipPlugin_ext* in one's .vimrc.
  79. Currently (11/30/15) it holds: >
  80. let g:zipPlugin_ext= '*.zip,*.jar,*.xpi,*.ja,*.war,*.ear,*.celzip,
  81. \ *.oxt,*.kmz,*.wsz,*.xap,*.docx,*.docm,*.dotx,*.dotm,*.potx,*.potm,
  82. \ *.ppsx,*.ppsm,*.pptx,*.pptm,*.ppam,*.sldx,*.thmx,*.xlam,*.xlsx,*.xlsm,
  83. \ *.xlsb,*.xltx,*.xltm,*.xlam,*.crtx,*.vdw,*.glox,*.gcsx,*.gqsx,*.epub'
  84. ==============================================================================
  85. 4. History *zip-history* {{{1
  86. v32 Oct 22, 2021 * to avoid an issue with a vim 8.2 patch, zipfile: has
  87. been changed to zipfile:// . This often shows up
  88. as zipfile:/// with zipped files that are root-based.
  89. v29 Apr 02, 2017 * (Klartext) reported that an encrypted zip file could
  90. opened but the swapfile held unencrypted contents.
  91. The solution is to edit the contents of a zip file
  92. using the |:noswapfile| modifier.
  93. v28 Oct 08, 2014 * changed the sanity checks for executables to reflect
  94. the command actually to be attempted in zip#Read()
  95. and zip#Write()
  96. * added the extraction of a file capability
  97. Nov 30, 2015 * added *.epub to the |g:zipPlugin_ext| list
  98. Sep 13, 2016 * added *.apk to the |g:zipPlugin_ext| list and
  99. sorted the suffices.
  100. v27 Jul 02, 2013 * sanity check: zipfile must have "PK" as its first
  101. two bytes.
  102. * modified to allow zipfile: entries in quickfix lists
  103. v26 Nov 15, 2012 * (Jason Spiro) provided a lot of new extensions that
  104. are synonyms for .zip
  105. v25 Jun 27, 2011 * using keepj with unzip -Z
  106. (consistent with the -p variant)
  107. * (Ben Staniford) now uses
  108. has("win32unix") && executable("cygpath")
  109. before converting to cygwin-style paths
  110. v24 Jun 21, 2010 * (Cédric Bosdonnat) unzip seems to need its filenames
  111. fnameescape'd as well as shellquote'd
  112. * (Motoya Kurotsu) inserted keepj before 0d to protect
  113. jump list
  114. v17 May 09, 2008 * arno caught a security bug
  115. v15 Sep 07, 2007 * &shq now used if not the empty string for g:zip_shq
  116. v14 May 07, 2007 * using b:zipfile instead of w:zipfile to avoid problem
  117. when editing alternate file to bring up a zipfile
  118. v10 May 02, 2006 * now using "redraw then echo" to show messages, instead
  119. of "echo and prompt user"
  120. * g:zip_shq provided to allow for quoting control for the
  121. command being passed via :r! ... commands.
  122. v8 Apr 10, 2006 * Bram Moolenaar reported that he received an error message
  123. due to "Pattern not found: ^.*\%0c"; this was caused by
  124. stridx finding a Name... at the beginning of the line;
  125. zip.vim tried 4,$s/^.*\%0c//, but that doesn't work.
  126. Fixed.
  127. v7 Mar 22, 2006 * escaped some characters that can cause filename handling
  128. problems.
  129. v6 Dec 21, 2005 * writing to files not in directories caused problems -
  130. fixed (pointed out by Christian Robinson)
  131. v5 Nov 22, 2005 * report option workaround installed
  132. v3 Oct 18, 2005 * <amatch> used instead of <afile> in autocmds
  133. v2 Sep 16, 2005 * silenced some commands (avoiding hit-enter prompt)
  134. * began testing under Windows; works thus far
  135. * filetype detection fixed
  136. Nov 03, 2005 * handles writing zipfiles across a network using
  137. netrw#NetWrite()
  138. v1 Sep 15, 2005 * Initial release, had browsing, reading, and writing
  139. ==============================================================================
  140. vim:tw=78:ts=8:ft=help:noet:norl:fdm=marker