528
|
1 " 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
|
557
|
12 augroup 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>"))
|
528
|
18
|
557
|
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
|
528
|
25
|
557
|
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>"))
|
|
31 augroup END
|
528
|
32
|
|
33 " vim: ts=8
|