Mercurial > vim
view runtime/plugin/gzip.vim @ 8995:3cf6704d6efc v7.4.1783
commit https://github.com/vim/vim/commit/af98a49dd0ef1661b4998f118151fddbf6e4df75
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Apr 24 14:40:12 2016 +0200
patch 7.4.1783
Problem: The old regexp engine doesn't handle character classes correctly.
(Manuel Ortega)
Solution: Use regmbc() instead of regc(). Add a test.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 24 Apr 2016 14:45:04 +0200 |
parents | aab202d244b6 |
children | 169a62d5bcb9 |
line wrap: on
line source
" Vim plugin for editing compressed files. " Maintainer: Bram Moolenaar <Bram@vim.org> " Last Change: 2010 Mar 10 " Exit quickly when: " - this plugin was already loaded " - when 'compatible' is set " - some autocommands are already taking care of compressed files if exists("loaded_gzip") || &cp || exists("#BufReadPre#*.gz") finish endif let loaded_gzip = 1 augroup gzip " Remove all gzip autocommands au! " Enable editing of gzipped files. " The functions are defined in autoload/gzip.vim. " " Set binary mode before reading the file. " Use "gzip -d", gunzip isn't always available. autocmd BufReadPre,FileReadPre *.gz,*.bz2,*.Z,*.lzma,*.xz setlocal bin autocmd BufReadPost,FileReadPost *.gz call gzip#read("gzip -dn") autocmd BufReadPost,FileReadPost *.bz2 call gzip#read("bzip2 -d") autocmd BufReadPost,FileReadPost *.Z call gzip#read("uncompress") autocmd BufReadPost,FileReadPost *.lzma call gzip#read("lzma -d") autocmd BufReadPost,FileReadPost *.xz call gzip#read("xz -d") autocmd BufWritePost,FileWritePost *.gz call gzip#write("gzip") autocmd BufWritePost,FileWritePost *.bz2 call gzip#write("bzip2") autocmd BufWritePost,FileWritePost *.Z call gzip#write("compress -f") autocmd BufWritePost,FileWritePost *.lzma call gzip#write("lzma -z") autocmd BufWritePost,FileWritePost *.xz call gzip#write("xz -z") autocmd FileAppendPre *.gz call gzip#appre("gzip -dn") autocmd FileAppendPre *.bz2 call gzip#appre("bzip2 -d") autocmd FileAppendPre *.Z call gzip#appre("uncompress") autocmd FileAppendPre *.lzma call gzip#appre("lzma -d") autocmd FileAppendPre *.xz call gzip#appre("xz -d") autocmd FileAppendPost *.gz call gzip#write("gzip") autocmd FileAppendPost *.bz2 call gzip#write("bzip2") autocmd FileAppendPost *.Z call gzip#write("compress -f") autocmd FileAppendPost *.lzma call gzip#write("lzma -z") autocmd FileAppendPost *.xz call gzip#write("xz -z") augroup END