blob: ebb6427f539bf2bc89cdd56c667a8a7ebea7b666 [file] [log] [blame]
Bram Moolenaar6b730e12005-09-16 21:47:57 +00001" zipPlugin.vim: Handles browsing zipfiles
2" PLUGIN PORTION
Bram Moolenaar6be7f872012-01-20 21:08:56 +01003" Date: Aug 15, 2011
Bram Moolenaar9964e462007-05-05 17:54:07 +00004" Maintainer: Charles E Campbell, Jr <NdrOchip@ScampbellPfamily.AbizM-NOSPAM>
Bram Moolenaar6b730e12005-09-16 21:47:57 +00005" License: Vim License (see vim's :help license)
Bram Moolenaar6be7f872012-01-20 21:08:56 +01006" Copyright: Copyright (C) 2005-2011 Charles E. Campbell, Jr. {{{1
Bram Moolenaar6b730e12005-09-16 21:47:57 +00007" 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.
Bram Moolenaar9964e462007-05-05 17:54:07 +000015"
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.
Bram Moolenaar6b730e12005-09-16 21:47:57 +000018" ---------------------------------------------------------------------
Bram Moolenaar9964e462007-05-05 17:54:07 +000019" Load Once: {{{1
20if &cp || exists("g:loaded_zipPlugin")
21 finish
22endif
Bram Moolenaar6be7f872012-01-20 21:08:56 +010023let g:loaded_zipPlugin = "v25"
Bram Moolenaar9964e462007-05-05 17:54:07 +000024let s:keepcpo = &cpo
Bram Moolenaar6b730e12005-09-16 21:47:57 +000025set cpo&vim
26
27" ---------------------------------------------------------------------
28" Public Interface: {{{1
29augroup zip
30 au!
Bram Moolenaara5792f52005-11-23 21:25:05 +000031 au BufReadCmd zipfile:* call zip#Read(expand("<amatch>"), 1)
32 au FileReadCmd zipfile:* call zip#Read(expand("<amatch>"), 0)
33 au BufWriteCmd zipfile:* call zip#Write(expand("<amatch>"))
34 au FileWriteCmd zipfile:* call zip#Write(expand("<amatch>"))
Bram Moolenaar6b730e12005-09-16 21:47:57 +000035
36 if has("unix")
Bram Moolenaara5792f52005-11-23 21:25:05 +000037 au BufReadCmd zipfile:*/* call zip#Read(expand("<amatch>"), 1)
38 au FileReadCmd zipfile:*/* call zip#Read(expand("<amatch>"), 0)
39 au BufWriteCmd zipfile:*/* call zip#Write(expand("<amatch>"))
40 au FileWriteCmd zipfile:*/* call zip#Write(expand("<amatch>"))
Bram Moolenaar6b730e12005-09-16 21:47:57 +000041 endif
42
Bram Moolenaar6be7f872012-01-20 21:08:56 +010043 au BufReadCmd *.zip,*.jar,*.xpi,*.war,*.ear,*.celzip,*.oxt call zip#Browse(expand("<amatch>"))
Bram Moolenaar6b730e12005-09-16 21:47:57 +000044augroup END
45
Bram Moolenaar9964e462007-05-05 17:54:07 +000046" ---------------------------------------------------------------------
47" Restoration And Modelines: {{{1
48" vim: fdm=marker
Bram Moolenaar6b730e12005-09-16 21:47:57 +000049let &cpo= s:keepcpo
50unlet s:keepcpo