vim

Fork of vim, an acceptable text editor
git clone git://git.laack.co/vim.git
Log | Files | Refs | README | LICENSE

zipPlugin.vim (2895B)


      1 " zipPlugin.vim: Handles browsing zipfiles
      2 "            PLUGIN PORTION
      3 " Date:			Dec 07, 2021
      4 " Maintainer:	This runtime file is looking for a new maintainer.
      5 " Former Maintainer:	Charles E Campbell
      6 " Last Change:
      7 " 2025 Apr 02 by Vim Project: add *.whl to list of zip extensions (#17038)
      8 " 2025 Oct 06 by MultisampledNight: add *.pkpass to list of zip extensions (#18501)
      9 " 2026 May 16 by Vim Project: add .cbz extension (#20206)
     10 " License:		Vim License  (see vim's :help license)
     11 " Copyright:    Copyright (C) 2005-2016 Charles E. Campbell {{{1
     12 "               Permission is hereby granted to use and distribute this code,
     13 "               with or without modifications, provided that this copyright
     14 "               notice is copied with it. Like anything else that's free,
     15 "               zipPlugin.vim is provided *as is* and comes with no warranty
     16 "               of any kind, either expressed or implied. By using this
     17 "               plugin, you agree that in no event will the copyright
     18 "               holder be liable for any damages resulting from the use
     19 "               of this software.
     20 "
     21 " (James 4:8 WEB) Draw near to God, and he will draw near to you.
     22 " Cleanse your hands, you sinners; and purify your hearts, you double-minded.
     23 " ---------------------------------------------------------------------
     24 " Load Once: {{{1
     25 if &cp || exists("g:loaded_zipPlugin")
     26  finish
     27 endif
     28 let g:loaded_zipPlugin = "v33"
     29 let s:keepcpo          = &cpo
     30 set cpo&vim
     31 
     32 " ---------------------------------------------------------------------
     33 " Options: {{{1
     34 if !exists("g:zipPlugin_ext")
     35  let g:zipPlugin_ext='*.aar,*.apk,*.cbz,*.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,*.pkpass,*.potm,*.potx,*.ppam,*.ppsm,*.ppsx,*.pptm,*.pptx,*.sldx,*.thmx,*.vdw,*.war,*.whl,*.wsz,*.xap,*.xlam,*.xlsb,*.xlsm,*.xlsx,*.xltm,*.xltx,*.xpi,*.zip'
     36 endif
     37 
     38 " ---------------------------------------------------------------------
     39 " Public Interface: {{{1
     40 augroup zip
     41  au!
     42  au BufReadCmd   zipfile:*	call zip#Read(expand("<amatch>"), 1)
     43  au FileReadCmd  zipfile:*	call zip#Read(expand("<amatch>"), 0)
     44  au BufWriteCmd  zipfile:*	call zip#Write(expand("<amatch>"))
     45  au FileWriteCmd zipfile:*	call zip#Write(expand("<amatch>"))
     46 
     47  if has("unix")
     48   au BufReadCmd   zipfile:*/*	call zip#Read(expand("<amatch>"), 1)
     49   au FileReadCmd  zipfile:*/*	call zip#Read(expand("<amatch>"), 0)
     50   au BufWriteCmd  zipfile:*/*	call zip#Write(expand("<amatch>"))
     51   au FileWriteCmd zipfile:*/*	call zip#Write(expand("<amatch>"))
     52  endif
     53 
     54  exe "au BufReadCmd ".g:zipPlugin_ext.' call zip#Browse(expand("<amatch>"))'
     55 augroup END
     56 
     57 " ---------------------------------------------------------------------
     58 "  Restoration And Modelines: {{{1
     59 "  vim: fdm=marker
     60 let &cpo= s:keepcpo
     61 unlet s:keepcpo