neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

zipPlugin.vim (2831B)


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