blob: cc97f444b09b7bb4f34045103e7a7ad4cd46ede6 [file] [log] [blame]
Bram Moolenaar87e25fd2005-07-27 21:13:01 +00001" tar.vim -- a Vim plugin for browsing tarfiles
Bram Moolenaardfccaf02004-12-31 20:56:11 +00002" Copyright (c) 2002, Michael C. Toren <mct@toren.net>
Bram Moolenaar87e25fd2005-07-27 21:13:01 +00003" Distributed under the GNU General Public License.
4"
5" Version: 1.01
6" Last Change: 2005 Jul 26
Bram Moolenaardfccaf02004-12-31 20:56:11 +00007"
8" Updates are available from <http://michael.toren.net/code/>. If you
9" find this script useful, or have suggestions for improvements, please
10" let me know.
Bram Moolenaar87e25fd2005-07-27 21:13:01 +000011" Also look there for further comments and documentation.
Bram Moolenaardfccaf02004-12-31 20:56:11 +000012"
Bram Moolenaar87e25fd2005-07-27 21:13:01 +000013" This part only sets the autocommands. The functions are in autoload/tar.vim.
Bram Moolenaardfccaf02004-12-31 20:56:11 +000014
15if has("autocmd")
Bram Moolenaar87e25fd2005-07-27 21:13:01 +000016 augroup tar
17 au!
18 au BufReadCmd tarfile:* call tar#Read(expand("<afile>"), 1)
19 au BufReadCmd tarfile:*/* call tar#Read(expand("<afile>"), 1)
20 au FileReadCmd tarfile:* call tar#Read(expand("<afile>"), 0)
21 au FileReadCmd tarfile:*/* call tar#Read(expand("<afile>"), 0)
Bram Moolenaardfccaf02004-12-31 20:56:11 +000022
Bram Moolenaar87e25fd2005-07-27 21:13:01 +000023 au BufWriteCmd tarfile:* call tar#Write(expand("<afile>"))
24 au BufWriteCmd tarfile:*/* call tar#Write(expand("<afile>"))
25 au FileWriteCmd tarfile:* call tar#Write(expand("<afile>"))
26 au FileWriteCmd tarfile:*/* call tar#Write(expand("<afile>"))
Bram Moolenaardfccaf02004-12-31 20:56:11 +000027
Bram Moolenaar87e25fd2005-07-27 21:13:01 +000028 au BufReadCmd *.tar call tar#Browse(expand("<afile>"))
29 au BufReadCmd *.tar.gz call tar#Browse(expand("<afile>"))
30 au BufReadCmd *.tar.bz2 call tar#Browse(expand("<afile>"))
31 au BufReadCmd *.tar.Z call tar#Browse(expand("<afile>"))
32 au BufReadCmd *.tgz call tar#Browse(expand("<afile>"))
33 augroup END
Bram Moolenaardfccaf02004-12-31 20:56:11 +000034endif