Mercurial > vim
annotate runtime/plugin/gzip.vim @ 20317:2334bf788e8a
Update runtime files
Commit: https://github.com/vim/vim/commit/2cfb4a2a7248eeb40112bb482ab5b15f01b20433
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu May 7 18:56:00 2020 +0200
Update runtime files
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 07 May 2020 19:00:05 +0200 |
parents | 368468ef35cf |
children | 7f88f6a3ed4c |
rev | line source |
---|---|
7 | 1 " Vim plugin for editing compressed files. |
2 " Maintainer: Bram Moolenaar <Bram@vim.org> | |
10319
169a62d5bcb9
commit https://github.com/vim/vim/commit/b4ada79aa7d0d1e5da3a659b1a203d7cae9f7f59
Christian Brabandt <cb@256bit.org>
parents:
2111
diff
changeset
|
3 " Last Change: 2016 Oct 30 |
7 | 4 |
5 " Exit quickly when: | |
6 " - this plugin was already loaded | |
7 " - when 'compatible' is set | |
8 " - some autocommands are already taking care of compressed files | |
9 if exists("loaded_gzip") || &cp || exists("#BufReadPre#*.gz") | |
10 finish | |
11 endif | |
12 let loaded_gzip = 1 | |
13 | |
14 augroup gzip | |
15 " Remove all gzip autocommands | |
16 au! | |
17 | |
446 | 18 " Enable editing of gzipped files. |
19 " The functions are defined in autoload/gzip.vim. | |
20 " | |
21 " Set binary mode before reading the file. | |
22 " Use "gzip -d", gunzip isn't always available. | |
20317 | 23 autocmd BufReadPre,FileReadPre *.gz,*.bz2,*.Z,*.lzma,*.xz,*.lz,*.zst,*.br setlocal bin |
446 | 24 autocmd BufReadPost,FileReadPost *.gz call gzip#read("gzip -dn") |
25 autocmd BufReadPost,FileReadPost *.bz2 call gzip#read("bzip2 -d") | |
26 autocmd BufReadPost,FileReadPost *.Z call gzip#read("uncompress") | |
2034 | 27 autocmd BufReadPost,FileReadPost *.lzma call gzip#read("lzma -d") |
2111
aab202d244b6
updated for version 7.2.394
Bram Moolenaar <bram@zimbu.org>
parents:
2034
diff
changeset
|
28 autocmd BufReadPost,FileReadPost *.xz call gzip#read("xz -d") |
10319
169a62d5bcb9
commit https://github.com/vim/vim/commit/b4ada79aa7d0d1e5da3a659b1a203d7cae9f7f59
Christian Brabandt <cb@256bit.org>
parents:
2111
diff
changeset
|
29 autocmd BufReadPost,FileReadPost *.lz call gzip#read("lzip -d") |
10385
368468ef35cf
commit https://github.com/vim/vim/commit/c0514bf4777a1d55f5785b3887c5686fd0bbe870
Christian Brabandt <cb@256bit.org>
parents:
10319
diff
changeset
|
30 autocmd BufReadPost,FileReadPost *.zst call gzip#read("zstd -d --rm") |
20317 | 31 autocmd BufReadPost,FileReadPost *.br call gzip#read("brotli -d --rm") |
446 | 32 autocmd BufWritePost,FileWritePost *.gz call gzip#write("gzip") |
33 autocmd BufWritePost,FileWritePost *.bz2 call gzip#write("bzip2") | |
34 autocmd BufWritePost,FileWritePost *.Z call gzip#write("compress -f") | |
2034 | 35 autocmd BufWritePost,FileWritePost *.lzma call gzip#write("lzma -z") |
2111
aab202d244b6
updated for version 7.2.394
Bram Moolenaar <bram@zimbu.org>
parents:
2034
diff
changeset
|
36 autocmd BufWritePost,FileWritePost *.xz call gzip#write("xz -z") |
10319
169a62d5bcb9
commit https://github.com/vim/vim/commit/b4ada79aa7d0d1e5da3a659b1a203d7cae9f7f59
Christian Brabandt <cb@256bit.org>
parents:
2111
diff
changeset
|
37 autocmd BufWritePost,FileWritePost *.lz call gzip#write("lzip") |
10385
368468ef35cf
commit https://github.com/vim/vim/commit/c0514bf4777a1d55f5785b3887c5686fd0bbe870
Christian Brabandt <cb@256bit.org>
parents:
10319
diff
changeset
|
38 autocmd BufWritePost,FileWritePost *.zst call gzip#write("zstd --rm") |
20317 | 39 autocmd BufWritePost,FileWritePost *.br call gzip#write("brotli --rm") |
446 | 40 autocmd FileAppendPre *.gz call gzip#appre("gzip -dn") |
41 autocmd FileAppendPre *.bz2 call gzip#appre("bzip2 -d") | |
42 autocmd FileAppendPre *.Z call gzip#appre("uncompress") | |
2034 | 43 autocmd FileAppendPre *.lzma call gzip#appre("lzma -d") |
2111
aab202d244b6
updated for version 7.2.394
Bram Moolenaar <bram@zimbu.org>
parents:
2034
diff
changeset
|
44 autocmd FileAppendPre *.xz call gzip#appre("xz -d") |
10319
169a62d5bcb9
commit https://github.com/vim/vim/commit/b4ada79aa7d0d1e5da3a659b1a203d7cae9f7f59
Christian Brabandt <cb@256bit.org>
parents:
2111
diff
changeset
|
45 autocmd FileAppendPre *.lz call gzip#appre("lzip -d") |
10385
368468ef35cf
commit https://github.com/vim/vim/commit/c0514bf4777a1d55f5785b3887c5686fd0bbe870
Christian Brabandt <cb@256bit.org>
parents:
10319
diff
changeset
|
46 autocmd FileAppendPre *.zst call gzip#appre("zstd -d --rm") |
20317 | 47 autocmd FileAppendPre *.br call gzip#appre("brotli -d --rm") |
446 | 48 autocmd FileAppendPost *.gz call gzip#write("gzip") |
49 autocmd FileAppendPost *.bz2 call gzip#write("bzip2") | |
50 autocmd FileAppendPost *.Z call gzip#write("compress -f") | |
2034 | 51 autocmd FileAppendPost *.lzma call gzip#write("lzma -z") |
2111
aab202d244b6
updated for version 7.2.394
Bram Moolenaar <bram@zimbu.org>
parents:
2034
diff
changeset
|
52 autocmd FileAppendPost *.xz call gzip#write("xz -z") |
10319
169a62d5bcb9
commit https://github.com/vim/vim/commit/b4ada79aa7d0d1e5da3a659b1a203d7cae9f7f59
Christian Brabandt <cb@256bit.org>
parents:
2111
diff
changeset
|
53 autocmd FileAppendPost *.lz call gzip#write("lzip") |
10385
368468ef35cf
commit https://github.com/vim/vim/commit/c0514bf4777a1d55f5785b3887c5686fd0bbe870
Christian Brabandt <cb@256bit.org>
parents:
10319
diff
changeset
|
54 autocmd FileAppendPost *.zst call gzip#write("zstd --rm") |
20317 | 55 autocmd FileAppendPost *.br call gzip#write("brotli --rm") |
7 | 56 augroup END |