blob: 506b4313d3e9413c358041afe88561faf7ad6c7d [file] [log] [blame]
Bram Moolenaar58071af2005-09-14 21:41:18 +00001" tarPlugin.vim -- a Vim plugin for browsing tarfiles
2" Copyright (c) 2002, Michael C. Toren <mct@toren.net>
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
Bram Moolenaara5792f52005-11-23 21:25:05 +000012augroup 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>"))
Bram Moolenaar58071af2005-09-14 21:41:18 +000018
Bram Moolenaara5792f52005-11-23 21:25:05 +000019 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
Bram Moolenaar58071af2005-09-14 21:41:18 +000025
Bram Moolenaara5792f52005-11-23 21:25:05 +000026 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
Bram Moolenaar58071af2005-09-14 21:41:18 +000032
33" vim: ts=8