529
|
1 " zipPlugin.vim: Handles browsing zipfiles
|
|
2 " PLUGIN PORTION
|
1620
|
3 " Date: Oct 05, 2007
|
1121
|
4 " Maintainer: Charles E Campbell, Jr <NdrOchip@ScampbellPfamily.AbizM-NOSPAM>
|
529
|
5 " License: Vim License (see vim's :help license)
|
1121
|
6 " Copyright: Copyright (C) 2005,2006 Charles E. Campbell, Jr. {{{1
|
529
|
7 " Permission is hereby granted to use and distribute this code,
|
|
8 " with or without modifications, provided that this copyright
|
|
9 " notice is copied with it. Like anything else that's free,
|
|
10 " zipPlugin.vim is provided *as is* and comes with no warranty
|
|
11 " of any kind, either expressed or implied. By using this
|
|
12 " plugin, you agree that in no event will the copyright
|
|
13 " holder be liable for any damages resulting from the use
|
|
14 " of this software.
|
1121
|
15 "
|
|
16 " (James 4:8 WEB) Draw near to God, and he will draw near to you.
|
|
17 " Cleanse your hands, you sinners; and purify your hearts, you double-minded.
|
529
|
18 " ---------------------------------------------------------------------
|
1121
|
19 " Load Once: {{{1
|
|
20 if &cp || exists("g:loaded_zipPlugin")
|
|
21 finish
|
|
22 endif
|
1668
|
23
|
|
24 " Don't use the plugin if fnameescape() is not available
|
|
25 if !exists("*fnameescape")
|
|
26 if &verbose > 1
|
|
27 echoerr "zipPlugin not loaded because fnameescape() is not available"
|
|
28 endif
|
|
29 finish
|
|
30 endif
|
|
31
|
|
32 let g:loaded_zipPlugin = "v21+b"
|
1121
|
33 let s:keepcpo = &cpo
|
529
|
34 set cpo&vim
|
|
35
|
|
36 " ---------------------------------------------------------------------
|
|
37 " Public Interface: {{{1
|
|
38 augroup zip
|
|
39 au!
|
557
|
40 au BufReadCmd zipfile:* call zip#Read(expand("<amatch>"), 1)
|
|
41 au FileReadCmd zipfile:* call zip#Read(expand("<amatch>"), 0)
|
|
42 au BufWriteCmd zipfile:* call zip#Write(expand("<amatch>"))
|
|
43 au FileWriteCmd zipfile:* call zip#Write(expand("<amatch>"))
|
529
|
44
|
|
45 if has("unix")
|
557
|
46 au BufReadCmd zipfile:*/* call zip#Read(expand("<amatch>"), 1)
|
|
47 au FileReadCmd zipfile:*/* call zip#Read(expand("<amatch>"), 0)
|
|
48 au BufWriteCmd zipfile:*/* call zip#Write(expand("<amatch>"))
|
|
49 au FileWriteCmd zipfile:*/* call zip#Write(expand("<amatch>"))
|
529
|
50 endif
|
|
51
|
1620
|
52 au BufReadCmd *.zip,*.jar,*.xpi,*.war,*.ear call zip#Browse(expand("<amatch>"))
|
529
|
53 augroup END
|
|
54
|
1121
|
55 " ---------------------------------------------------------------------
|
|
56 " Restoration And Modelines: {{{1
|
|
57 " vim: fdm=marker
|
529
|
58 let &cpo= s:keepcpo
|
|
59 unlet s:keepcpo
|