pi_zip

pi_zip.txt 适用于 Vim 9.0 版本。 最近更新: 2022年7月 +====================+ | Zip 文件接口 | +====================+ 译者: Willis Author: Charles E. Campbell <NcampObell@SdrPchip.AorgM-NOSPAM> (remove NOSPAM from Campbell's email first) Copyright: Copyright (C) 2005-2015 Charles E Campbell zip-copyright The VIM LICENSE (see copyright ) applies to the files in this package, including zipPlugin.vim, zip.vim, and pi_zip.vim. except use "zip.vim" instead of "VIM". Like anything else that's free, zip.vim and its associated files are provided *as is* and comes with no warranty of any kind, either expressed or implied. No guarantees of merchantability. No guarantees of suitability for any purpose. By using this plugin, you agree that in no event will the copyright holder be liable for any damages resulting from the use of this software. Use at your own risk!

1. 内容 zip zip-contents

1. 内容.................................................... zip-contents 2. 用法.................................................... zip-usage 3. 附加扩展名.............................................. zip-extension 4. 历史.................................................... zip-history

2. 用法 zip-usage zip-manual

编辑 *.zip 文件时,此插件进行处理,显示内容页面。移动光标到文件上,然后按 <return> 键,就可以选择该文件进行编辑。编辑后,可以写回该文件。目前,不能用 该插件建立新的 zip 归档文件。 zip-x x : 光标在列出文件名上时提取此文件 选 项 g:zip_nomax 如果此变量存在且为真,文件窗口在打开时不会自动最大化。 g:zip_shq 不同的操作系统可能使用一个或多个外壳来执行命令。Zip 试图猜测正确的引号使用 机制,使得文件名中可以包含空格和其它;如果猜错了,可用 g:zip_shq 修正。它在 Unix 上缺省是单引号 ('),而 Windows 上缺省是双引号 (")。如果你希 望不用引号,简单地在 <.vimrc> 里把 g:zip_shq 置为空串 (let g:zip_shq= "")。 g:zip_unzipcmd 用此选项指定执行 "unzip" 任务的程序,用于浏览。缺省: let g:zip_unzipcmd= "unzip" g:zip_zipcmd 用此选项指定执行 "zip" 任务的程序,用于写入 (更新) 已在 zip 包中的文件;缺 省: let g:zip_zipcmd= "zip" g:zip_extractcmd 用此选项指定程序 (和所需的选项),用于从 zip 归档文件提取文件。缺省 let g:zip_extractcmd= g:zip_unzipcmd 禁 止 载 入 如果由于某种原因你不想 vim 检查 zip 文件,在 <.vimrc> 中定义两个变量就可以 不载入 zip 插件: let g:loaded_zipPlugin= 1 let g:loaded_zip = 1

3. 附加扩展名 zip-extension

看来有不少归档程序生成 zip 文件但不使用 .zip 扩展名 (.jar、.xpi 等)。要处理 这些文件,在 <.vimrc> 文件中放上: au BufReadCmd *.jar,*.xpi call zip#Browse(expand("<amatch>")) 你可以自由扩展该行以包含更多应被当作 zip 文件的扩展名。 此外,也可以在 .vimrc 里改变 g:zipPlugin_ext 。 当前 (11/30/15) 包含了: let g:zipPlugin_ext= '*.zip,*.jar,*.xpi,*.ja,*.war,*.ear,*.celzip, \ *.oxt,*.kmz,*.wsz,*.xap,*.docx,*.docm,*.dotx,*.dotm,*.potx,*.potm, \ *.ppsx,*.ppsm,*.pptx,*.pptm,*.ppam,*.sldx,*.thmx,*.xlam,*.xlsx,*.xlsm, \ *.xlsb,*.xltx,*.xltm,*.xlam,*.crtx,*.vdw,*.glox,*.gcsx,*.gqsx,*.epub'

4. 历史 (英文) zip-history {{{1

v32 Oct 22, 2021 * to avoid an issue with a vim 8.2 patch, zipfile: has been changed to zipfile:// . This often shows up as zipfile:/// with zipped files that are root-based. v29 Apr 02, 2017 * (Klartext) reported that an encrypted zip file could opened but the swapfile held unencrypted contents. The solution is to edit the contents of a zip file using the :noswapfile modifier. v28 Oct 08, 2014 * changed the sanity checks for executables to reflect the command actually to be attempted in zip#Read() and zip#Write() * added the extraction of a file capability Nov 30, 2015 * added *.epub to the g:zipPlugin_ext list Sep 13, 2016 * added *.apk to the g:zipPlugin_ext list and sorted the suffices. v27 Jul 02, 2013 * sanity check: zipfile must have "PK" as its first two bytes. * modified to allow zipfile: entries in quickfix lists v26 Nov 15, 2012 * (Jason Spiro) provided a lot of new extensions that are synonyms for .zip v25 Jun 27, 2011 * using keepj with unzip -Z (consistent with the -p variant) * (Ben Staniford) now uses has("win32unix") && executable("cygpath") before converting to cygwin-style paths v24 Jun 21, 2010 * (Cédric Bosdonnat) unzip seems to need its filenames fnameescape'd as well as shellquote'd * (Motoya Kurotsu) inserted keepj before 0d to protect jump list v17 May 09, 2008 * arno caught a security bug v15 Sep 07, 2007 * &shq now used if not the empty string for g:zip_shq v14 May 07, 2007 * using b:zipfile instead of w:zipfile to avoid problem when editing alternate file to bring up a zipfile v10 May 02, 2006 * now using "redraw then echo" to show messages, instead of "echo and prompt user" * g:zip_shq provided to allow for quoting control for the command being passed via :r! ... commands. v8 Apr 10, 2006 * Bram Moolenaar reported that he received an error message due to "Pattern not found: ^.*\%0c"; this was caused by stridx finding a Name... at the beginning of the line; zip.vim tried 4,$s/^.*\%0c//, but that doesn't work. Fixed. v7 Mar 22, 2006 * escaped some characters that can cause filename handling problems. v6 Dec 21, 2005 * writing to files not in directories caused problems - fixed (pointed out by Christian Robinson) v5 Nov 22, 2005 * report option workaround installed v3 Oct 18, 2005 * <amatch> used instead of <afile> in autocmds v2 Sep 16, 2005 * silenced some commands (avoiding hit-enter prompt) * began testing under Windows; works thus far * filetype detection fixed Nov 03, 2005 * handles writing zipfiles across a network using netrw#NetWrite() v1 Sep 15, 2005 * Initial release, had browsing, reading, and writing

vim:tw=78:ts=8:ft=help:noet:norl:fdm=marker