blob: cb4fc6b3b86a61066d3fefa635d764c2d748c802 [file] [log] [blame]
Jim Zhou4783a2c2025-03-05 20:22:24 +01001*pi_gzip.txt* For Vim version 9.1. Last change: 2025 Mar 05
Bram Moolenaar071d4272004-06-13 20:20:40 +00002
3
4 VIM REFERENCE MANUAL by Bram Moolenaar
5
6
7Editing compressed files with Vim *gzip* *bzip2* *compress*
8
91. Autocommands |gzip-autocmd|
10
11The functionality mentioned here is a |standard-plugin|.
12This plugin is only available if 'compatible' is not set.
13You can avoid loading this plugin by setting the "loaded_gzip" variable: >
14 :let loaded_gzip = 1
Christian Brabandtda4e4332023-11-05 10:45:12 +010015<
16 *g:gzip_exec*
17
18For security reasons, one may prevent that Vim runs executables automatically
19when opening a buffer. This option (default: "1") can be used to prevent
20executing the executables command when set to "0": >
21 :let g:gzip_exec = 0
22<
Bram Moolenaar071d4272004-06-13 20:20:40 +000023
Bram Moolenaar071d4272004-06-13 20:20:40 +000024==============================================================================
Christian Brabandt30c762d2023-11-14 16:44:37 +0100251. Autocommands *gzip-autocmd*
Bram Moolenaar071d4272004-06-13 20:20:40 +000026
27The plugin installs autocommands to intercept reading and writing of files
28with these extensions:
29
30 extension compression ~
Bram Moolenaar071d4272004-06-13 20:20:40 +000031 *.bz2 bzip2
Jim Zhou4783a2c2025-03-05 20:22:24 +010032 *.bz3 bzip3
Corpulent Robinb69cd522025-02-06 21:10:49 +010033 *.gz gzip
34 *.lz lzip
35 *.lz4 lz4
Bram Moolenaar6c35bea2012-07-25 17:49:10 +020036 *.lzma lzma
37 *.xz xz
Corpulent Robinb69cd522025-02-06 21:10:49 +010038 *.Z compress (Lempel-Ziv)
Bram Moolenaarc0514bf2016-11-17 14:50:09 +010039 *.zst zstd
Bram Moolenaar071d4272004-06-13 20:20:40 +000040
41That's actually the only thing you need to know. There are no options.
42
43After decompressing a file, the filetype will be detected again. This will
44make a file like "foo.c.gz" get the "c" filetype.
45
46If you have 'patchmode' set, it will be appended after the extension for
47compression. Thus editing the patchmode file will not give you the automatic
48decompression. You have to rename the file if you want this.
49
50==============================================================================
Bram Moolenaar91f84f62018-07-29 15:07:52 +020051 vim:tw=78:ts=8:noet:ft=help:norl: