Mercurial > vim
annotate runtime/plugin/gzip.vim @ 9766:be9b5f8c3fd9 v7.4.2158
commit https://github.com/vim/vim/commit/b650b9878e9f0ac6bb1b61230095ad9ab3850a33
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Aug 5 20:35:13 2016 +0200
patch 7.4.2158
Problem: Result of getcompletion('', 'cscope') depends on previous
completion. (Christian Brabandt)
Solution: Call set_context_in_cscope_cmd().
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Fri, 05 Aug 2016 20:45:06 +0200 |
parents | aab202d244b6 |
children | 169a62d5bcb9 |
rev | line source |
---|---|
7 | 1 " Vim plugin for editing compressed files. |
2 " Maintainer: Bram Moolenaar <Bram@vim.org> | |
2111
aab202d244b6
updated for version 7.2.394
Bram Moolenaar <bram@zimbu.org>
parents:
2034
diff
changeset
|
3 " Last Change: 2010 Mar 10 |
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. | |
2111
aab202d244b6
updated for version 7.2.394
Bram Moolenaar <bram@zimbu.org>
parents:
2034
diff
changeset
|
23 autocmd BufReadPre,FileReadPre *.gz,*.bz2,*.Z,*.lzma,*.xz 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") |
446 | 29 autocmd BufWritePost,FileWritePost *.gz call gzip#write("gzip") |
30 autocmd BufWritePost,FileWritePost *.bz2 call gzip#write("bzip2") | |
31 autocmd BufWritePost,FileWritePost *.Z call gzip#write("compress -f") | |
2034 | 32 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
|
33 autocmd BufWritePost,FileWritePost *.xz call gzip#write("xz -z") |
446 | 34 autocmd FileAppendPre *.gz call gzip#appre("gzip -dn") |
35 autocmd FileAppendPre *.bz2 call gzip#appre("bzip2 -d") | |
36 autocmd FileAppendPre *.Z call gzip#appre("uncompress") | |
2034 | 37 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
|
38 autocmd FileAppendPre *.xz call gzip#appre("xz -d") |
446 | 39 autocmd FileAppendPost *.gz call gzip#write("gzip") |
40 autocmd FileAppendPost *.bz2 call gzip#write("bzip2") | |
41 autocmd FileAppendPost *.Z call gzip#write("compress -f") | |
2034 | 42 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
|
43 autocmd FileAppendPost *.xz call gzip#write("xz -z") |
7 | 44 augroup END |