annotate runtime/doc/pi_zip.txt @ 2238:3d0a7beb0d75 vim73

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