zipPlugin.vim 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. " License: Vim License (see vim's :help license)
  7. " Copyright: Copyright (C) 2005-2016 Charles E. Campbell {{{1
  8. " 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.
  16. "
  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.
  19. " ---------------------------------------------------------------------
  20. " Load Once: {{{1
  21. if &cp || exists("g:loaded_zipPlugin")
  22. finish
  23. endif
  24. let g:loaded_zipPlugin = "v33"
  25. let s:keepcpo = &cpo
  26. set cpo&vim
  27. " ---------------------------------------------------------------------
  28. " Options: {{{1
  29. if !exists("g:zipPlugin_ext")
  30. 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'
  31. endif
  32. " ---------------------------------------------------------------------
  33. " Public Interface: {{{1
  34. augroup zip
  35. au!
  36. au BufReadCmd zipfile:* call zip#Read(expand("<amatch>"), 1)
  37. au FileReadCmd zipfile:* call zip#Read(expand("<amatch>"), 0)
  38. au BufWriteCmd zipfile:* call zip#Write(expand("<amatch>"))
  39. au FileWriteCmd zipfile:* call zip#Write(expand("<amatch>"))
  40. if has("unix")
  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. endif
  46. exe "au BufReadCmd ".g:zipPlugin_ext.' call zip#Browse(expand("<amatch>"))'
  47. augroup END
  48. " ---------------------------------------------------------------------
  49. " Restoration And Modelines: {{{1
  50. " vim: fdm=marker
  51. let &cpo= s:keepcpo
  52. unlet s:keepcpo