Mercurial > vim
annotate runtime/plugin/gzip.vim @ 36549:07e948b0d33b draft default tip
runtime(doc): mention option-backslash at :h CompilerSet
Commit: https://github.com/vim/vim/commit/dbf231a4b7fba235fa9ccc8798b37c0b4a4943ae
Author: Christian Brabandt <cb@256bit.org>
Date: Wed Nov 13 20:28:43 2024 +0100
runtime(doc): mention option-backslash at :h CompilerSet
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Wed, 13 Nov 2024 20:45:02 +0100 |
parents | 4027cefc2aab |
children |
rev | line source |
---|---|
7 | 1 " Vim plugin for editing compressed files. |
32770
4027cefc2aab
Farewell to Bram and dedicate upcoming Vim 9.1 to him (#12749)
Christian Brabandt <cb@256bit.org>
parents:
20379
diff
changeset
|
2 " Maintainer: The Vim Project <https://github.com/vim/vim> |
4027cefc2aab
Farewell to Bram and dedicate upcoming Vim 9.1 to him (#12749)
Christian Brabandt <cb@256bit.org>
parents:
20379
diff
changeset
|
3 " Last Change: 2023 Aug 10 |
4027cefc2aab
Farewell to Bram and dedicate upcoming Vim 9.1 to him (#12749)
Christian Brabandt <cb@256bit.org>
parents:
20379
diff
changeset
|
4 " Former Maintainer: Bram Moolenaar <Bram@vim.org> |
7 | 5 |
6 " Exit quickly when: | |
7 " - this plugin was already loaded | |
8 " - when 'compatible' is set | |
9 " - some autocommands are already taking care of compressed files | |
10 if exists("loaded_gzip") || &cp || exists("#BufReadPre#*.gz") | |
11 finish | |
12 endif | |
13 let loaded_gzip = 1 | |
14 | |
15 augroup gzip | |
16 " Remove all gzip autocommands | |
17 au! | |
18 | |
446 | 19 " Enable editing of gzipped files. |
20 " The functions are defined in autoload/gzip.vim. | |
21 " | |
22 " Set binary mode before reading the file. | |
23 " Use "gzip -d", gunzip isn't always available. | |
20379 | 24 autocmd BufReadPre,FileReadPre *.gz,*.bz2,*.Z,*.lzma,*.xz,*.lz,*.zst,*.br,*.lzo setlocal bin |
446 | 25 autocmd BufReadPost,FileReadPost *.gz call gzip#read("gzip -dn") |
26 autocmd BufReadPost,FileReadPost *.bz2 call gzip#read("bzip2 -d") | |
27 autocmd BufReadPost,FileReadPost *.Z call gzip#read("uncompress") | |
2034 | 28 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
|
29 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
|
30 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
|
31 autocmd BufReadPost,FileReadPost *.zst call gzip#read("zstd -d --rm") |
20317 | 32 autocmd BufReadPost,FileReadPost *.br call gzip#read("brotli -d --rm") |
20379 | 33 autocmd BufReadPost,FileReadPost *.lzo call gzip#read("lzop -d -U") |
446 | 34 autocmd BufWritePost,FileWritePost *.gz call gzip#write("gzip") |
35 autocmd BufWritePost,FileWritePost *.bz2 call gzip#write("bzip2") | |
36 autocmd BufWritePost,FileWritePost *.Z call gzip#write("compress -f") | |
2034 | 37 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
|
38 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
|
39 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
|
40 autocmd BufWritePost,FileWritePost *.zst call gzip#write("zstd --rm") |
20317 | 41 autocmd BufWritePost,FileWritePost *.br call gzip#write("brotli --rm") |
20379 | 42 autocmd BufWritePost,FileWritePost *.lzo call gzip#write("lzop -U") |
446 | 43 autocmd FileAppendPre *.gz call gzip#appre("gzip -dn") |
44 autocmd FileAppendPre *.bz2 call gzip#appre("bzip2 -d") | |
45 autocmd FileAppendPre *.Z call gzip#appre("uncompress") | |
2034 | 46 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
|
47 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
|
48 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
|
49 autocmd FileAppendPre *.zst call gzip#appre("zstd -d --rm") |
20317 | 50 autocmd FileAppendPre *.br call gzip#appre("brotli -d --rm") |
20379 | 51 autocmd FileAppendPre *.lzo call gzip#appre("lzop -d -U") |
446 | 52 autocmd FileAppendPost *.gz call gzip#write("gzip") |
53 autocmd FileAppendPost *.bz2 call gzip#write("bzip2") | |
54 autocmd FileAppendPost *.Z call gzip#write("compress -f") | |
2034 | 55 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
|
56 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
|
57 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
|
58 autocmd FileAppendPost *.zst call gzip#write("zstd --rm") |
20317 | 59 autocmd FileAppendPost *.br call gzip#write("brotli --rm") |
20379 | 60 autocmd FileAppendPost *.lzo call gzip#write("lzop -U") |
7 | 61 augroup END |