Mercurial > vim
comparison runtime/plugin/gzip.vim @ 2111:aab202d244b6 v7.2.394
updated for version 7.2.394
Problem: .xz files are not supported.
Solution: Recognize .xz files so that they can be edited.
author | Bram Moolenaar <bram@zimbu.org> |
---|---|
date | Wed, 10 Mar 2010 17:16:12 +0100 |
parents | 7bc41231fbc7 |
children | 169a62d5bcb9 |
comparison
equal
deleted
inserted
replaced
2110:0f552ca271c2 | 2111:aab202d244b6 |
---|---|
1 " Vim plugin for editing compressed files. | 1 " Vim plugin for editing compressed files. |
2 " Maintainer: Bram Moolenaar <Bram@vim.org> | 2 " Maintainer: Bram Moolenaar <Bram@vim.org> |
3 " Last Change: 2009 Jul 01 | 3 " Last Change: 2010 Mar 10 |
4 | 4 |
5 " Exit quickly when: | 5 " Exit quickly when: |
6 " - this plugin was already loaded | 6 " - this plugin was already loaded |
7 " - when 'compatible' is set | 7 " - when 'compatible' is set |
8 " - some autocommands are already taking care of compressed files | 8 " - some autocommands are already taking care of compressed files |
18 " Enable editing of gzipped files. | 18 " Enable editing of gzipped files. |
19 " The functions are defined in autoload/gzip.vim. | 19 " The functions are defined in autoload/gzip.vim. |
20 " | 20 " |
21 " Set binary mode before reading the file. | 21 " Set binary mode before reading the file. |
22 " Use "gzip -d", gunzip isn't always available. | 22 " Use "gzip -d", gunzip isn't always available. |
23 autocmd BufReadPre,FileReadPre *.gz,*.bz2,*.Z,*.lzma setlocal bin | 23 autocmd BufReadPre,FileReadPre *.gz,*.bz2,*.Z,*.lzma,*.xz setlocal bin |
24 autocmd BufReadPost,FileReadPost *.gz call gzip#read("gzip -dn") | 24 autocmd BufReadPost,FileReadPost *.gz call gzip#read("gzip -dn") |
25 autocmd BufReadPost,FileReadPost *.bz2 call gzip#read("bzip2 -d") | 25 autocmd BufReadPost,FileReadPost *.bz2 call gzip#read("bzip2 -d") |
26 autocmd BufReadPost,FileReadPost *.Z call gzip#read("uncompress") | 26 autocmd BufReadPost,FileReadPost *.Z call gzip#read("uncompress") |
27 autocmd BufReadPost,FileReadPost *.lzma call gzip#read("lzma -d") | 27 autocmd BufReadPost,FileReadPost *.lzma call gzip#read("lzma -d") |
28 autocmd BufReadPost,FileReadPost *.xz call gzip#read("xz -d") | |
28 autocmd BufWritePost,FileWritePost *.gz call gzip#write("gzip") | 29 autocmd BufWritePost,FileWritePost *.gz call gzip#write("gzip") |
29 autocmd BufWritePost,FileWritePost *.bz2 call gzip#write("bzip2") | 30 autocmd BufWritePost,FileWritePost *.bz2 call gzip#write("bzip2") |
30 autocmd BufWritePost,FileWritePost *.Z call gzip#write("compress -f") | 31 autocmd BufWritePost,FileWritePost *.Z call gzip#write("compress -f") |
31 autocmd BufWritePost,FileWritePost *.lzma call gzip#write("lzma -z") | 32 autocmd BufWritePost,FileWritePost *.lzma call gzip#write("lzma -z") |
33 autocmd BufWritePost,FileWritePost *.xz call gzip#write("xz -z") | |
32 autocmd FileAppendPre *.gz call gzip#appre("gzip -dn") | 34 autocmd FileAppendPre *.gz call gzip#appre("gzip -dn") |
33 autocmd FileAppendPre *.bz2 call gzip#appre("bzip2 -d") | 35 autocmd FileAppendPre *.bz2 call gzip#appre("bzip2 -d") |
34 autocmd FileAppendPre *.Z call gzip#appre("uncompress") | 36 autocmd FileAppendPre *.Z call gzip#appre("uncompress") |
35 autocmd FileAppendPre *.lzma call gzip#appre("lzma -d") | 37 autocmd FileAppendPre *.lzma call gzip#appre("lzma -d") |
38 autocmd FileAppendPre *.xz call gzip#appre("xz -d") | |
36 autocmd FileAppendPost *.gz call gzip#write("gzip") | 39 autocmd FileAppendPost *.gz call gzip#write("gzip") |
37 autocmd FileAppendPost *.bz2 call gzip#write("bzip2") | 40 autocmd FileAppendPost *.bz2 call gzip#write("bzip2") |
38 autocmd FileAppendPost *.Z call gzip#write("compress -f") | 41 autocmd FileAppendPost *.Z call gzip#write("compress -f") |
39 autocmd FileAppendPost *.lzma call gzip#write("lzma -z") | 42 autocmd FileAppendPost *.lzma call gzip#write("lzma -z") |
43 autocmd FileAppendPost *.xz call gzip#write("xz -z") | |
40 augroup END | 44 augroup END |