Bram Moolenaar | 58071af | 2005-09-14 21:41:18 +0000 | [diff] [blame] | 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 | |
| 12 | if has("autocmd") |
| 13 | augroup tar |
| 14 | au! |
| 15 | au BufReadCmd tarfile:* call tar#Read(expand("<afile>"), 1) |
| 16 | au BufReadCmd tarfile:*/* call tar#Read(expand("<afile>"), 1) |
| 17 | au FileReadCmd tarfile:* call tar#Read(expand("<afile>"), 0) |
| 18 | au FileReadCmd tarfile:*/* call tar#Read(expand("<afile>"), 0) |
| 19 | |
| 20 | au BufWriteCmd tarfile:* call tar#Write(expand("<afile>")) |
| 21 | au BufWriteCmd tarfile:*/* call tar#Write(expand("<afile>")) |
| 22 | au FileWriteCmd tarfile:* call tar#Write(expand("<afile>")) |
| 23 | au FileWriteCmd tarfile:*/* call tar#Write(expand("<afile>")) |
| 24 | |
| 25 | au BufReadCmd *.tar call tar#Browse(expand("<afile>")) |
| 26 | au BufReadCmd *.tar.gz call tar#Browse(expand("<afile>")) |
| 27 | au BufReadCmd *.tar.bz2 call tar#Browse(expand("<afile>")) |
| 28 | au BufReadCmd *.tar.Z call tar#Browse(expand("<afile>")) |
| 29 | au BufReadCmd *.tgz call tar#Browse(expand("<afile>")) |
| 30 | augroup END |
| 31 | endif |
| 32 | |
| 33 | " vim: ts=8 |