robin/laufey

git clone https://git.robinwobin.dev/robin/laufey

zeertzjqMerge pull request #39808 from zeertzjq/vim-9.2.0489436a7b58a3

master
2.5 KiB60 linesraw
1" tarPlugin.vim -- a Vim plugin for browsing tarfiles
2"
3" Original was copyright (c) 2002, Michael C. Toren <mct@toren.net>
4" Modified by Charles E. Campbell
5" Distributed under the GNU General Public License.
6"
7" Updates are available from <http://michael.toren.net/code/>.  If you
8" find this script useful, or have suggestions for improvements, please
9" let me know.
10" Also look there for further comments and documentation.
11"
12" This part only sets the autocommands.  The functions are in autoload/tar.vim.
13" ---------------------------------------------------------------------
14"  Load Once: {{{1
15if &cp || exists("g:loaded_tarPlugin")
16 finish
17endif
18let g:loaded_tarPlugin = "v32"
19let s:keepcpo          = &cpo
20set cpo&vim
21
22" ---------------------------------------------------------------------
23"  Public Interface: {{{1
24augroup tar
25  au!
26  au BufReadCmd   tarfile::*	call tar#Read(expand("<amatch>"))
27  au FileReadCmd  tarfile::*	call tar#Read(expand("<amatch>"))
28  au BufWriteCmd  tarfile::*	call tar#Write(expand("<amatch>"))
29  au FileWriteCmd tarfile::*	call tar#Write(expand("<amatch>"))
30
31  if has("unix")
32   au BufReadCmd   tarfile::*/*	call tar#Read(expand("<amatch>"))
33   au FileReadCmd  tarfile::*/*	call tar#Read(expand("<amatch>"))
34   au BufWriteCmd  tarfile::*/*	call tar#Write(expand("<amatch>"))
35   au FileWriteCmd tarfile::*/*	call tar#Write(expand("<amatch>"))
36  endif
37
38  au BufReadCmd   *.cbt			call tar#Browse(expand("<amatch>"))
39  au BufReadCmd   *.lrp			call tar#Browse(expand("<amatch>"))
40  au BufReadCmd   *.tar			call tar#Browse(expand("<amatch>"))
41  au BufReadCmd   *.tar.bz2		call tar#Browse(expand("<amatch>"))
42  au BufReadCmd   *.tar.bz3		call tar#Browse(expand("<amatch>"))
43  au BufReadCmd   *.tar.gz		call tar#Browse(expand("<amatch>"))
44  au BufReadCmd   *.tar.lz4		call tar#Browse(expand("<amatch>"))
45  au BufReadCmd   *.tar.lzma		call tar#Browse(expand("<amatch>"))
46  au BufReadCmd   *.tar.xz		call tar#Browse(expand("<amatch>"))
47  au BufReadCmd   *.tar.Z		call tar#Browse(expand("<amatch>"))
48  au BufReadCmd   *.tar.zst		call tar#Browse(expand("<amatch>"))
49  au BufReadCmd   *.tbz			call tar#Browse(expand("<amatch>"))
50  au BufReadCmd   *.tgz			call tar#Browse(expand("<amatch>"))
51  au BufReadCmd   *.tlz4		call tar#Browse(expand("<amatch>"))
52  au BufReadCmd   *.txz			call tar#Browse(expand("<amatch>"))
53  au BufReadCmd   *.tzst		call tar#Browse(expand("<amatch>"))
54augroup END
55
56" ---------------------------------------------------------------------
57" Restoration And Modelines: {{{1
58" vim: fdm=marker
59let &cpo= s:keepcpo
60unlet s:keepcpo