annotate runtime/plugin/tarPlugin.vim @ 8078:7676818d486b v7.4.1333

commit https://github.com/vim/vim/commit/f8df7addc5f741c16fa2a458f8777ac1fdf2e01e Author: Bram Moolenaar <Bram@vim.org> Date: Tue Feb 16 14:07:40 2016 +0100 patch 7.4.1333 Problem: Channel test fails on non-darwin builds. Solution: Add the "osx" feature and test for that. (Kazunobu Kuriyama)
author Christian Brabandt <cb@256bit.org>
date Tue, 16 Feb 2016 14:15:05 +0100
parents 22fa3049e934
children 1218c5353e2b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
528
66475621f0bf updated for version 7.0147
vimboss
parents:
diff changeset
1 " tarPlugin.vim -- a Vim plugin for browsing tarfiles
1126
c5c164b4c95c updated for version 7.1a
vimboss
parents: 557
diff changeset
2 " Original was copyright (c) 2002, Michael C. Toren <mct@toren.net>
4339
22fa3049e934 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3281
diff changeset
3 " Modified by Charles E. Campbell
528
66475621f0bf updated for version 7.0147
vimboss
parents:
diff changeset
4 " Distributed under the GNU General Public License.
66475621f0bf updated for version 7.0147
vimboss
parents:
diff changeset
5 "
66475621f0bf updated for version 7.0147
vimboss
parents:
diff changeset
6 " Updates are available from <http://michael.toren.net/code/>. If you
66475621f0bf updated for version 7.0147
vimboss
parents:
diff changeset
7 " find this script useful, or have suggestions for improvements, please
66475621f0bf updated for version 7.0147
vimboss
parents:
diff changeset
8 " let me know.
66475621f0bf updated for version 7.0147
vimboss
parents:
diff changeset
9 " Also look there for further comments and documentation.
66475621f0bf updated for version 7.0147
vimboss
parents:
diff changeset
10 "
66475621f0bf updated for version 7.0147
vimboss
parents:
diff changeset
11 " This part only sets the autocommands. The functions are in autoload/tar.vim.
1126
c5c164b4c95c updated for version 7.1a
vimboss
parents: 557
diff changeset
12 " ---------------------------------------------------------------------
c5c164b4c95c updated for version 7.1a
vimboss
parents: 557
diff changeset
13 " Load Once: {{{1
c5c164b4c95c updated for version 7.1a
vimboss
parents: 557
diff changeset
14 if &cp || exists("g:loaded_tarPlugin")
c5c164b4c95c updated for version 7.1a
vimboss
parents: 557
diff changeset
15 finish
c5c164b4c95c updated for version 7.1a
vimboss
parents: 557
diff changeset
16 endif
4339
22fa3049e934 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3281
diff changeset
17 let g:loaded_tarPlugin = "v29"
1126
c5c164b4c95c updated for version 7.1a
vimboss
parents: 557
diff changeset
18 let s:keepcpo = &cpo
c5c164b4c95c updated for version 7.1a
vimboss
parents: 557
diff changeset
19 set cpo&vim
528
66475621f0bf updated for version 7.0147
vimboss
parents:
diff changeset
20
1126
c5c164b4c95c updated for version 7.1a
vimboss
parents: 557
diff changeset
21 " ---------------------------------------------------------------------
c5c164b4c95c updated for version 7.1a
vimboss
parents: 557
diff changeset
22 " Public Interface: {{{1
557
862863033fdd updated for version 7.0158
vimboss
parents: 528
diff changeset
23 augroup tar
862863033fdd updated for version 7.0158
vimboss
parents: 528
diff changeset
24 au!
1624
18ee39301b82 updated for version 7.2a
vimboss
parents: 1126
diff changeset
25 au BufReadCmd tarfile::* call tar#Read(expand("<amatch>"), 1)
18ee39301b82 updated for version 7.2a
vimboss
parents: 1126
diff changeset
26 au FileReadCmd tarfile::* call tar#Read(expand("<amatch>"), 0)
18ee39301b82 updated for version 7.2a
vimboss
parents: 1126
diff changeset
27 au BufWriteCmd tarfile::* call tar#Write(expand("<amatch>"))
18ee39301b82 updated for version 7.2a
vimboss
parents: 1126
diff changeset
28 au FileWriteCmd tarfile::* call tar#Write(expand("<amatch>"))
528
66475621f0bf updated for version 7.0147
vimboss
parents:
diff changeset
29
557
862863033fdd updated for version 7.0158
vimboss
parents: 528
diff changeset
30 if has("unix")
1624
18ee39301b82 updated for version 7.2a
vimboss
parents: 1126
diff changeset
31 au BufReadCmd tarfile::*/* call tar#Read(expand("<amatch>"), 1)
18ee39301b82 updated for version 7.2a
vimboss
parents: 1126
diff changeset
32 au FileReadCmd tarfile::*/* call tar#Read(expand("<amatch>"), 0)
18ee39301b82 updated for version 7.2a
vimboss
parents: 1126
diff changeset
33 au BufWriteCmd tarfile::*/* call tar#Write(expand("<amatch>"))
18ee39301b82 updated for version 7.2a
vimboss
parents: 1126
diff changeset
34 au FileWriteCmd tarfile::*/* call tar#Write(expand("<amatch>"))
557
862863033fdd updated for version 7.0158
vimboss
parents: 528
diff changeset
35 endif
528
66475621f0bf updated for version 7.0147
vimboss
parents:
diff changeset
36
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1702
diff changeset
37 au BufReadCmd *.tar.gz call tar#Browse(expand("<amatch>"))
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1702
diff changeset
38 au BufReadCmd *.tar call tar#Browse(expand("<amatch>"))
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1702
diff changeset
39 au BufReadCmd *.lrp call tar#Browse(expand("<amatch>"))
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1702
diff changeset
40 au BufReadCmd *.tar.bz2 call tar#Browse(expand("<amatch>"))
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1702
diff changeset
41 au BufReadCmd *.tar.Z call tar#Browse(expand("<amatch>"))
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1702
diff changeset
42 au BufReadCmd *.tgz call tar#Browse(expand("<amatch>"))
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1702
diff changeset
43 au BufReadCmd *.tar.lzma call tar#Browse(expand("<amatch>"))
2426
e52d87a2bb3e More runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
44 au BufReadCmd *.tar.xz call tar#Browse(expand("<amatch>"))
e52d87a2bb3e More runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
45 au BufReadCmd *.txz call tar#Browse(expand("<amatch>"))
557
862863033fdd updated for version 7.0158
vimboss
parents: 528
diff changeset
46 augroup END
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1702
diff changeset
47 com! -nargs=? -complete=file Vimuntar call tar#Vimuntar(<q-args>)
528
66475621f0bf updated for version 7.0147
vimboss
parents:
diff changeset
48
1126
c5c164b4c95c updated for version 7.1a
vimboss
parents: 557
diff changeset
49 " ---------------------------------------------------------------------
c5c164b4c95c updated for version 7.1a
vimboss
parents: 557
diff changeset
50 " Restoration And Modelines: {{{1
c5c164b4c95c updated for version 7.1a
vimboss
parents: 557
diff changeset
51 " vim: fdm=marker
c5c164b4c95c updated for version 7.1a
vimboss
parents: 557
diff changeset
52 let &cpo= s:keepcpo
c5c164b4c95c updated for version 7.1a
vimboss
parents: 557
diff changeset
53 unlet s:keepcpo