Jim Zhou | 4783a2c | 2025-03-05 20:22:24 +0100 | [diff] [blame] | 1 | *pi_gzip.txt* For Vim version 9.1. Last change: 2025 Mar 05 |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2 | |
| 3 | |
| 4 | VIM REFERENCE MANUAL by Bram Moolenaar |
| 5 | |
| 6 | |
| 7 | Editing compressed files with Vim *gzip* *bzip2* *compress* |
| 8 | |
| 9 | 1. Autocommands |gzip-autocmd| |
| 10 | |
| 11 | The functionality mentioned here is a |standard-plugin|. |
| 12 | This plugin is only available if 'compatible' is not set. |
| 13 | You can avoid loading this plugin by setting the "loaded_gzip" variable: > |
| 14 | :let loaded_gzip = 1 |
Christian Brabandt | da4e433 | 2023-11-05 10:45:12 +0100 | [diff] [blame] | 15 | < |
| 16 | *g:gzip_exec* |
| 17 | |
| 18 | For security reasons, one may prevent that Vim runs executables automatically |
| 19 | when opening a buffer. This option (default: "1") can be used to prevent |
| 20 | executing the executables command when set to "0": > |
| 21 | :let g:gzip_exec = 0 |
| 22 | < |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 23 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 24 | ============================================================================== |
Christian Brabandt | 30c762d | 2023-11-14 16:44:37 +0100 | [diff] [blame] | 25 | 1. Autocommands *gzip-autocmd* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 26 | |
| 27 | The plugin installs autocommands to intercept reading and writing of files |
| 28 | with these extensions: |
| 29 | |
| 30 | extension compression ~ |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 31 | *.bz2 bzip2 |
Jim Zhou | 4783a2c | 2025-03-05 20:22:24 +0100 | [diff] [blame] | 32 | *.bz3 bzip3 |
Corpulent Robin | b69cd52 | 2025-02-06 21:10:49 +0100 | [diff] [blame] | 33 | *.gz gzip |
| 34 | *.lz lzip |
| 35 | *.lz4 lz4 |
Bram Moolenaar | 6c35bea | 2012-07-25 17:49:10 +0200 | [diff] [blame] | 36 | *.lzma lzma |
| 37 | *.xz xz |
Corpulent Robin | b69cd52 | 2025-02-06 21:10:49 +0100 | [diff] [blame] | 38 | *.Z compress (Lempel-Ziv) |
Bram Moolenaar | c0514bf | 2016-11-17 14:50:09 +0100 | [diff] [blame] | 39 | *.zst zstd |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 40 | |
| 41 | That's actually the only thing you need to know. There are no options. |
| 42 | |
| 43 | After decompressing a file, the filetype will be detected again. This will |
| 44 | make a file like "foo.c.gz" get the "c" filetype. |
| 45 | |
| 46 | If you have 'patchmode' set, it will be appended after the extension for |
| 47 | compression. Thus editing the patchmode file will not give you the automatic |
| 48 | decompression. You have to rename the file if you want this. |
| 49 | |
| 50 | ============================================================================== |
Bram Moolenaar | 91f84f6 | 2018-07-29 15:07:52 +0200 | [diff] [blame] | 51 | vim:tw=78:ts=8:noet:ft=help:norl: |