vim

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

tarPlugin.vim (2643B)


      1 " tarPlugin.vim -- a Vim plugin for browsing tarfiles
      2 "
      3 " Original was copyright (c) 2002, Michael C. Toren <mct@toren.net>
      4 " Modified by Charles E. Campbell
      5 " Distributed under the GNU General Public License.
      6 "
      7 " Updates are available from <http://michael.toren.net/code/>.  If you
      8 " find this script useful, or have suggestions for improvements, please
      9 " let me know.
     10 " Also look there for further comments and documentation.
     11 "
     12 " This part only sets the autocommands.  The functions are in autoload/tar.vim.
     13 " ---------------------------------------------------------------------
     14 "  Load Once: {{{1
     15 if &cp || exists("g:loaded_tarPlugin")
     16  finish
     17 endif
     18 let g:loaded_tarPlugin = "v32"
     19 let s:keepcpo          = &cpo
     20 set cpo&vim
     21 
     22 " ---------------------------------------------------------------------
     23 "  Public Interface: {{{1
     24 augroup tar
     25   au!
     26   au BufReadCmd   tarfile::*	call tar#Read(expand("<amatch>"))
     27   au FileReadCmd  tarfile::*	call tar#Read(expand("<amatch>"))
     28   au BufWriteCmd  tarfile::*	call tar#Write(expand("<amatch>"))
     29   au FileWriteCmd tarfile::*	call tar#Write(expand("<amatch>"))
     30 
     31   if has("unix")
     32    au BufReadCmd   tarfile::*/*	call tar#Read(expand("<amatch>"))
     33    au FileReadCmd  tarfile::*/*	call tar#Read(expand("<amatch>"))
     34    au BufWriteCmd  tarfile::*/*	call tar#Write(expand("<amatch>"))
     35    au FileWriteCmd tarfile::*/*	call tar#Write(expand("<amatch>"))
     36   endif
     37 
     38   au BufReadCmd   *.cbt			call tar#Browse(expand("<amatch>"))
     39   au BufReadCmd   *.lrp			call tar#Browse(expand("<amatch>"))
     40   au BufReadCmd   *.tar			call tar#Browse(expand("<amatch>"))
     41   au BufReadCmd   *.tar.bz2		call tar#Browse(expand("<amatch>"))
     42   au BufReadCmd   *.tar.bz3		call tar#Browse(expand("<amatch>"))
     43   au BufReadCmd   *.tar.gz		call tar#Browse(expand("<amatch>"))
     44   au BufReadCmd   *.tar.lz4		call tar#Browse(expand("<amatch>"))
     45   au BufReadCmd   *.tar.lzma		call tar#Browse(expand("<amatch>"))
     46   au BufReadCmd   *.tar.xz		call tar#Browse(expand("<amatch>"))
     47   au BufReadCmd   *.tar.Z		call tar#Browse(expand("<amatch>"))
     48   au BufReadCmd   *.tar.zst		call tar#Browse(expand("<amatch>"))
     49   au BufReadCmd   *.tbz			call tar#Browse(expand("<amatch>"))
     50   au BufReadCmd   *.tgz			call tar#Browse(expand("<amatch>"))
     51   au BufReadCmd   *.tlz4		call tar#Browse(expand("<amatch>"))
     52   au BufReadCmd   *.txz			call tar#Browse(expand("<amatch>"))
     53   au BufReadCmd   *.tzst		call tar#Browse(expand("<amatch>"))
     54 augroup END
     55 com! -nargs=? -complete=file Vimuntar call tar#Vimuntar(<q-args>)
     56 
     57 " ---------------------------------------------------------------------
     58 " Restoration And Modelines: {{{1
     59 " vim: fdm=marker
     60 let &cpo= s:keepcpo
     61 unlet s:keepcpo