blob: 2af119bbcbf839e013fe9704fcefcaf0a9a5c505 [file] [log] [blame]
Bram Moolenaar6b730e12005-09-16 21:47:57 +00001" zipPlugin.vim: Handles browsing zipfiles
2" PLUGIN PORTION
Bram Moolenaar71badf92023-04-22 22:40:14 +01003" Date: Dec 07, 2021
Christian Brabandtf9ca1392024-02-19 20:37:11 +01004" Maintainer: This runtime file is looking for a new maintainer.
5" Former Maintainer: Charles E Campbell
Bram Moolenaar6b730e12005-09-16 21:47:57 +00006" License: Vim License (see vim's :help license)
Bram Moolenaard0796902016-09-16 20:02:31 +02007" Copyright: Copyright (C) 2005-2016 Charles E. Campbell {{{1
Bram Moolenaar6b730e12005-09-16 21:47:57 +00008" Permission is hereby granted to use and distribute this code,
9" with or without modifications, provided that this copyright
10" notice is copied with it. Like anything else that's free,
11" zipPlugin.vim is provided *as is* and comes with no warranty
12" of any kind, either expressed or implied. By using this
13" plugin, you agree that in no event will the copyright
14" holder be liable for any damages resulting from the use
15" of this software.
Bram Moolenaar9964e462007-05-05 17:54:07 +000016"
17" (James 4:8 WEB) Draw near to God, and he will draw near to you.
18" Cleanse your hands, you sinners; and purify your hearts, you double-minded.
Bram Moolenaar6b730e12005-09-16 21:47:57 +000019" ---------------------------------------------------------------------
Bram Moolenaar9964e462007-05-05 17:54:07 +000020" Load Once: {{{1
21if &cp || exists("g:loaded_zipPlugin")
22 finish
23endif
Bram Moolenaar71badf92023-04-22 22:40:14 +010024let g:loaded_zipPlugin = "v33"
Bram Moolenaar9964e462007-05-05 17:54:07 +000025let s:keepcpo = &cpo
Bram Moolenaar6b730e12005-09-16 21:47:57 +000026set cpo&vim
27
28" ---------------------------------------------------------------------
Bram Moolenaar94f76b72013-07-04 22:50:40 +020029" Options: {{{1
30if !exists("g:zipPlugin_ext")
Bram Moolenaar71badf92023-04-22 22:40:14 +010031 let g:zipPlugin_ext='*.aar,*.apk,*.celzip,*.crtx,*.docm,*.docx,*.dotm,*.dotx,*.ear,*.epub,*.gcsx,*.glox,*.gqsx,*.ja,*.jar,*.kmz,*.odb,*.odc,*.odf,*.odg,*.odi,*.odm,*.odp,*.ods,*.odt,*.otc,*.otf,*.otg,*.oth,*.oti,*.otp,*.ots,*.ott,*.oxt,*.potm,*.potx,*.ppam,*.ppsm,*.ppsx,*.pptm,*.pptx,*.sldx,*.thmx,*.vdw,*.war,*.wsz,*.xap,*.xlam,*.xlsb,*.xlsm,*.xlsx,*.xltm,*.xltx,*.xpi,*.zip'
Bram Moolenaar94f76b72013-07-04 22:50:40 +020032endif
33
34" ---------------------------------------------------------------------
Bram Moolenaar6b730e12005-09-16 21:47:57 +000035" Public Interface: {{{1
36augroup zip
37 au!
Bram Moolenaara5792f52005-11-23 21:25:05 +000038 au BufReadCmd zipfile:* call zip#Read(expand("<amatch>"), 1)
39 au FileReadCmd zipfile:* call zip#Read(expand("<amatch>"), 0)
40 au BufWriteCmd zipfile:* call zip#Write(expand("<amatch>"))
41 au FileWriteCmd zipfile:* call zip#Write(expand("<amatch>"))
Bram Moolenaar6b730e12005-09-16 21:47:57 +000042
43 if has("unix")
Bram Moolenaara5792f52005-11-23 21:25:05 +000044 au BufReadCmd zipfile:*/* call zip#Read(expand("<amatch>"), 1)
45 au FileReadCmd zipfile:*/* call zip#Read(expand("<amatch>"), 0)
46 au BufWriteCmd zipfile:*/* call zip#Write(expand("<amatch>"))
47 au FileWriteCmd zipfile:*/* call zip#Write(expand("<amatch>"))
Bram Moolenaar6b730e12005-09-16 21:47:57 +000048 endif
49
Bram Moolenaar94f76b72013-07-04 22:50:40 +020050 exe "au BufReadCmd ".g:zipPlugin_ext.' call zip#Browse(expand("<amatch>"))'
Bram Moolenaar6b730e12005-09-16 21:47:57 +000051augroup END
52
Bram Moolenaar9964e462007-05-05 17:54:07 +000053" ---------------------------------------------------------------------
54" Restoration And Modelines: {{{1
55" vim: fdm=marker
Bram Moolenaar6b730e12005-09-16 21:47:57 +000056let &cpo= s:keepcpo
57unlet s:keepcpo