1" tarPlugin.vim -- a Vim plugin for browsing tarfiles 2" Copyright (c) 2002, Michael C. Toren <[email protected]> 3" Distributed under the GNU General Public License. 4" 5" Updates are available from <http://michael.toren.net/code/>. If you 6" find this script useful, or have suggestions for improvements, please 7" let me know. 8" Also look there for further comments and documentation. 9" 10" This part only sets the autocommands. The functions are in autoload/tar.vim. 11 12augroup tar 13 au! 14 au BufReadCmd tarfile:* call tar#Read(expand("<amatch>"), 1) 15 au FileReadCmd tarfile:* call tar#Read(expand("<amatch>"), 0) 16 au BufWriteCmd tarfile:* call tar#Write(expand("<amatch>")) 17 au FileWriteCmd tarfile:* call tar#Write(expand("<amatch>")) 18 19 if has("unix") 20 au BufReadCmd tarfile:*/* call tar#Read(expand("<amatch>"), 1) 21 au FileReadCmd tarfile:*/* call tar#Read(expand("<amatch>"), 0) 22 au BufWriteCmd tarfile:*/* call tar#Write(expand("<amatch>")) 23 au FileWriteCmd tarfile:*/* call tar#Write(expand("<amatch>")) 24 endif 25 26 au BufReadCmd *.tar call tar#Browse(expand("<amatch>")) 27 au BufReadCmd *.tar.gz call tar#Browse(expand("<amatch>")) 28 au BufReadCmd *.tar.bz2 call tar#Browse(expand("<amatch>")) 29 au BufReadCmd *.tar.Z call tar#Browse(expand("<amatch>")) 30 au BufReadCmd *.tgz call tar#Browse(expand("<amatch>")) 31augroup END 32 33" vim: ts=8 34