Bram Moolenaar | 6b730e1 | 2005-09-16 21:47:57 +0000 | [diff] [blame] | 1 | " zipPlugin.vim: Handles browsing zipfiles |
| 2 | " PLUGIN PORTION |
Bram Moolenaar | 2963456 | 2020-01-09 21:46:04 +0100 | [diff] [blame] | 3 | " Date: Jan 07, 2020 |
| 4 | " Maintainer: Charles E Campbell <NcampObell@SdrPchip.AorgM-NOSPAM> |
Bram Moolenaar | 6b730e1 | 2005-09-16 21:47:57 +0000 | [diff] [blame] | 5 | " License: Vim License (see vim's :help license) |
Bram Moolenaar | d079690 | 2016-09-16 20:02:31 +0200 | [diff] [blame] | 6 | " Copyright: Copyright (C) 2005-2016 Charles E. Campbell {{{1 |
Bram Moolenaar | 6b730e1 | 2005-09-16 21:47:57 +0000 | [diff] [blame] | 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. |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 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. |
Bram Moolenaar | 6b730e1 | 2005-09-16 21:47:57 +0000 | [diff] [blame] | 18 | " --------------------------------------------------------------------- |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 19 | " Load Once: {{{1 |
| 20 | if &cp || exists("g:loaded_zipPlugin") |
| 21 | finish |
| 22 | endif |
Bram Moolenaar | 2963456 | 2020-01-09 21:46:04 +0100 | [diff] [blame] | 23 | let g:loaded_zipPlugin = "v30" |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 24 | let s:keepcpo = &cpo |
Bram Moolenaar | 6b730e1 | 2005-09-16 21:47:57 +0000 | [diff] [blame] | 25 | set cpo&vim |
| 26 | |
| 27 | " --------------------------------------------------------------------- |
Bram Moolenaar | 94f76b7 | 2013-07-04 22:50:40 +0200 | [diff] [blame] | 28 | " Options: {{{1 |
| 29 | if !exists("g:zipPlugin_ext") |
Bram Moolenaar | 2963456 | 2020-01-09 21:46:04 +0100 | [diff] [blame] | 30 | let g:zipPlugin_ext='*.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,*.xlam,*.xlsb,*.xlsm,*.xlsx,*.xltm,*.xltx,*.xpi,*.zip' |
Bram Moolenaar | 94f76b7 | 2013-07-04 22:50:40 +0200 | [diff] [blame] | 31 | endif |
| 32 | |
| 33 | " --------------------------------------------------------------------- |
Bram Moolenaar | 6b730e1 | 2005-09-16 21:47:57 +0000 | [diff] [blame] | 34 | " Public Interface: {{{1 |
| 35 | augroup zip |
| 36 | au! |
Bram Moolenaar | a5792f5 | 2005-11-23 21:25:05 +0000 | [diff] [blame] | 37 | 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 Moolenaar | 6b730e1 | 2005-09-16 21:47:57 +0000 | [diff] [blame] | 41 | |
| 42 | if has("unix") |
Bram Moolenaar | a5792f5 | 2005-11-23 21:25:05 +0000 | [diff] [blame] | 43 | au BufReadCmd zipfile:*/* call zip#Read(expand("<amatch>"), 1) |
| 44 | au FileReadCmd zipfile:*/* call zip#Read(expand("<amatch>"), 0) |
| 45 | au BufWriteCmd zipfile:*/* call zip#Write(expand("<amatch>")) |
| 46 | au FileWriteCmd zipfile:*/* call zip#Write(expand("<amatch>")) |
Bram Moolenaar | 6b730e1 | 2005-09-16 21:47:57 +0000 | [diff] [blame] | 47 | endif |
| 48 | |
Bram Moolenaar | 94f76b7 | 2013-07-04 22:50:40 +0200 | [diff] [blame] | 49 | exe "au BufReadCmd ".g:zipPlugin_ext.' call zip#Browse(expand("<amatch>"))' |
Bram Moolenaar | 6b730e1 | 2005-09-16 21:47:57 +0000 | [diff] [blame] | 50 | augroup END |
| 51 | |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 52 | " --------------------------------------------------------------------- |
| 53 | " Restoration And Modelines: {{{1 |
| 54 | " vim: fdm=marker |
Bram Moolenaar | 6b730e1 | 2005-09-16 21:47:57 +0000 | [diff] [blame] | 55 | let &cpo= s:keepcpo |
| 56 | unlet s:keepcpo |