zipPlugin.vim 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. " zipPlugin.vim: Handles browsing zipfiles
  2. " PLUGIN PORTION
  3. " Date: Jan 07, 2020
  4. " Maintainer: Charles E Campbell <NcampObell@SdrPchip.AorgM-NOSPAM>
  5. " License: Vim License (see vim's :help license)
  6. " Copyright: Copyright (C) 2005-2016 Charles E. Campbell {{{1
  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.
  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.
  18. " ---------------------------------------------------------------------
  19. " Load Once: {{{1
  20. if &cp || exists("g:loaded_zipPlugin")
  21. finish
  22. endif
  23. let g:loaded_zipPlugin = "v32"
  24. let s:keepcpo = &cpo
  25. set cpo&vim
  26. " ---------------------------------------------------------------------
  27. " Options: {{{1
  28. if !exists("g:zipPlugin_ext")
  29. 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,*.xlam,*.xlsb,*.xlsm,*.xlsx,*.xltm,*.xltx,*.xpi,*.zip'
  30. endif
  31. " ---------------------------------------------------------------------
  32. " Public Interface: {{{1
  33. augroup zip
  34. au!
  35. au BufReadCmd zipfile:* call zip#Read(expand("<amatch>"), 1)
  36. au FileReadCmd zipfile:* call zip#Read(expand("<amatch>"), 0)
  37. au BufWriteCmd zipfile:* call zip#Write(expand("<amatch>"))
  38. au FileWriteCmd zipfile:* call zip#Write(expand("<amatch>"))
  39. if has("unix")
  40. au BufReadCmd zipfile:*/* call zip#Read(expand("<amatch>"), 1)
  41. au FileReadCmd zipfile:*/* call zip#Read(expand("<amatch>"), 0)
  42. au BufWriteCmd zipfile:*/* call zip#Write(expand("<amatch>"))
  43. au FileWriteCmd zipfile:*/* call zip#Write(expand("<amatch>"))
  44. endif
  45. exe "au BufReadCmd ".g:zipPlugin_ext.' call zip#Browse(expand("<amatch>"))'
  46. augroup END
  47. " ---------------------------------------------------------------------
  48. " Restoration And Modelines: {{{1
  49. " vim: fdm=marker
  50. let &cpo= s:keepcpo
  51. unlet s:keepcpo