Bram Moolenaar | 24ea3ba | 2010-09-19 19:01:21 +0200 | [diff] [blame] | 1 | *pi_zip.txt* For Vim version 7.3. Last change: 2010 Sep 14 |
Bram Moolenaar | c01140a | 2006-03-24 22:21:52 +0000 | [diff] [blame] | 2 | |
Bram Moolenaar | 910f66f | 2006-04-05 20:41:53 +0000 | [diff] [blame] | 3 | +====================+ |
| 4 | | Zip File Interface | |
| 5 | +====================+ |
Bram Moolenaar | 9835862 | 2005-11-28 22:58:23 +0000 | [diff] [blame] | 6 | |
| 7 | Author: Charles E. Campbell, Jr. <NdrOchip@ScampbellPfamily.AbizM> |
| 8 | (remove NOSPAM from Campbell's email first) |
Bram Moolenaar | 00a927d | 2010-05-14 23:24:24 +0200 | [diff] [blame] | 9 | Copyright: Copyright (C) 2005-2009 Charles E Campbell, Jr *zip-copyright* |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 10 | Permission is hereby granted to use and distribute this code, |
Bram Moolenaar | 910f66f | 2006-04-05 20:41:53 +0000 | [diff] [blame] | 11 | with or without modifications, provided that this copyright |
| 12 | notice is copied with it. Like anything else that's free, |
| 13 | zip.vim, zipPlugin.vim, and pi_zip.txt are provided *as is* |
| 14 | and it comes with no warranty of any kind, either expressed or |
| 15 | implied. By using this plugin, you agree that in no event will |
| 16 | the copyright holder be liable for any damages resulting from |
| 17 | the use of this software. |
Bram Moolenaar | 9835862 | 2005-11-28 22:58:23 +0000 | [diff] [blame] | 18 | |
| 19 | ============================================================================== |
| 20 | 1. Contents *zip* *zip-contents* |
Bram Moolenaar | 7263a77 | 2007-05-10 17:35:54 +0000 | [diff] [blame] | 21 | 1. Contents................................................|zip-contents| |
| 22 | 2. Usage...................................................|zip-usage| |
| 23 | 3. Additional Extensions...................................|zip-extension| |
| 24 | 4. History.................................................|zip-history| |
Bram Moolenaar | 9835862 | 2005-11-28 22:58:23 +0000 | [diff] [blame] | 25 | |
| 26 | ============================================================================== |
| 27 | 2. Usage *zip-usage* *zip-manual* |
| 28 | |
| 29 | When one edits a *.zip file, this plugin will handle displaying a |
| 30 | contents page. Select a file to edit by moving the cursor atop |
| 31 | the desired file, then hit the <return> key. After editing, one may |
| 32 | also write to the file. Currently, one may not make a new file in |
| 33 | zip archives via the plugin. |
| 34 | |
Bram Moolenaar | 7263a77 | 2007-05-10 17:35:54 +0000 | [diff] [blame] | 35 | OPTIONS |
Bram Moolenaar | 3577c6f | 2008-06-24 21:16:56 +0000 | [diff] [blame] | 36 | |
| 37 | *g:zip_nomax* |
| 38 | |
| 39 | If this variable exists and is true, the file window will not be |
| 40 | automatically maximized when opened. |
| 41 | |
| 42 | *g:zip_shq* |
Bram Moolenaar | 7263a77 | 2007-05-10 17:35:54 +0000 | [diff] [blame] | 43 | Different operating systems may use one or more shells to execute |
| 44 | commands. Zip will try to guess the correct quoting mechanism to |
| 45 | allow spaces and whatnot in filenames; however, if it is incorrectly |
| 46 | guessing the quote to use for your setup, you may use > |
| 47 | g:zip_shq |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 48 | < which by default is a single quote under Unix (') and a double quote |
| 49 | under Windows ("). If you'd rather have no quotes, simply set |
| 50 | g:zip_shq to the empty string (let g:zip_shq= "") in your <.vimrc>. |
| 51 | |
Bram Moolenaar | 7263a77 | 2007-05-10 17:35:54 +0000 | [diff] [blame] | 52 | *g:zip_unzipcmd* |
| 53 | Use this option to specify the program which does the duty of "unzip". |
Bram Moolenaar | 3577c6f | 2008-06-24 21:16:56 +0000 | [diff] [blame] | 54 | It's used during browsing. By default: > |
Bram Moolenaar | 7263a77 | 2007-05-10 17:35:54 +0000 | [diff] [blame] | 55 | let g:zip_unzipcmd= "unzip" |
| 56 | < |
| 57 | *g:zip_zipcmd* |
| 58 | Use this option to specify the program which does the duty of "zip". |
Bram Moolenaar | 3577c6f | 2008-06-24 21:16:56 +0000 | [diff] [blame] | 59 | It's used during the writing (updating) of a file already in a zip |
Bram Moolenaar | 7263a77 | 2007-05-10 17:35:54 +0000 | [diff] [blame] | 60 | file; by default: > |
| 61 | let g:zip_zipcmd= "zip" |
| 62 | < |
Bram Moolenaar | 00a927d | 2010-05-14 23:24:24 +0200 | [diff] [blame] | 63 | PREVENTING LOADING~ |
| 64 | |
| 65 | If for some reason you do not wish to use vim to examine zipped files, |
| 66 | you may put the following two variables into your <.vimrc> to prevent |
Bram Moolenaar | 24ea3ba | 2010-09-19 19:01:21 +0200 | [diff] [blame] | 67 | the zip plugin from loading: > |
Bram Moolenaar | 00a927d | 2010-05-14 23:24:24 +0200 | [diff] [blame] | 68 | |
| 69 | let g:loaded_zipPlugin= 1 |
| 70 | let g:loaded_zip = 1 |
| 71 | < |
Bram Moolenaar | 7263a77 | 2007-05-10 17:35:54 +0000 | [diff] [blame] | 72 | |
Bram Moolenaar | 9835862 | 2005-11-28 22:58:23 +0000 | [diff] [blame] | 73 | ============================================================================== |
Bram Moolenaar | 7263a77 | 2007-05-10 17:35:54 +0000 | [diff] [blame] | 74 | 3. Additional Extensions *zip-extension* |
| 75 | |
| 76 | Apparently there are a number of archivers who generate zip files that |
| 77 | don't use the .zip extension (.jar, .xpi, etc). To handle such files, |
| 78 | place a line in your <.vimrc> file: > |
| 79 | |
| 80 | au BufReadCmd *.jar,*.xpi call zip#Browse(expand("<amatch>")) |
| 81 | < |
Bram Moolenaar | c236c16 | 2008-07-13 17:41:49 +0000 | [diff] [blame] | 82 | One can simply extend this line to accommodate additional extensions that |
Bram Moolenaar | 3577c6f | 2008-06-24 21:16:56 +0000 | [diff] [blame] | 83 | should be treated as zip files. |
Bram Moolenaar | 7263a77 | 2007-05-10 17:35:54 +0000 | [diff] [blame] | 84 | |
| 85 | ============================================================================== |
| 86 | 4. History *zip-history* {{{1 |
Bram Moolenaar | 3577c6f | 2008-06-24 21:16:56 +0000 | [diff] [blame] | 87 | v17 May 09, 2008 * arno caught a security bug |
| 88 | v15 Sep 07, 2007 * &shq now used if not the empty string for g:zip_shq |
Bram Moolenaar | 7263a77 | 2007-05-10 17:35:54 +0000 | [diff] [blame] | 89 | v14 May 07, 2007 * using b:zipfile instead of w:zipfile to avoid problem |
| 90 | when editing alternate file to bring up a zipfile |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 91 | v10 May 02, 2006 * now using "redraw then echo" to show messages, instead |
| 92 | of "echo and prompt user" |
| 93 | * g:zip_shq provided to allow for quoting control for the |
| 94 | command being passed via :r! ... commands. |
Bram Moolenaar | 4c3f536 | 2006-04-11 21:38:50 +0000 | [diff] [blame] | 95 | v8 Apr 10, 2006 * Bram Moolenaar reported that he received an error message |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 96 | due to "Pattern not found: ^.*\%0c"; this was caused by |
Bram Moolenaar | 4c3f536 | 2006-04-11 21:38:50 +0000 | [diff] [blame] | 97 | stridx finding a Name... at the beginning of the line; |
| 98 | zip.vim tried 4,$s/^.*\%0c//, but that doesn't work. |
| 99 | Fixed. |
Bram Moolenaar | 7b5f832 | 2006-03-23 22:47:08 +0000 | [diff] [blame] | 100 | v7 Mar 22, 2006 * escaped some characters that can cause filename handling |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 101 | problems. |
Bram Moolenaar | 86e0108 | 2005-12-29 22:45:34 +0000 | [diff] [blame] | 102 | v6 Dec 21, 2005 * writing to files not in directories caused problems - |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 103 | fixed (pointed out by Christian Robinson) |
Bram Moolenaar | 9835862 | 2005-11-28 22:58:23 +0000 | [diff] [blame] | 104 | v5 Nov 22, 2005 * report option workaround installed |
| 105 | v3 Oct 18, 2005 * <amatch> used instead of <afile> in autocmds |
| 106 | v2 Sep 16, 2005 * silenced some commands (avoiding hit-enter prompt) |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 107 | * began testing under Windows; works thus far |
Bram Moolenaar | 9835862 | 2005-11-28 22:58:23 +0000 | [diff] [blame] | 108 | * filetype detection fixed |
| 109 | Nov 03, 2005 * handles writing zipfiles across a network using |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 110 | netrw#NetWrite() |
Bram Moolenaar | 9835862 | 2005-11-28 22:58:23 +0000 | [diff] [blame] | 111 | v1 Sep 15, 2005 * Initial release, had browsing, reading, and writing |
| 112 | |
| 113 | ============================================================================== |
Bram Moolenaar | 7263a77 | 2007-05-10 17:35:54 +0000 | [diff] [blame] | 114 | vim:tw=78:ts=8:ft=help:fdm=marker |