runtime(netrw): update netrw's decompress logic

Detect a few more default archive types, correctly handle file
extensions with digits in it.

fixes: #16099
closes: #16104

Signed-off-by: Konfekt <Konfekt@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Christian Brabandt
2024-11-23 13:28:01 +01:00
parent 4dd6c22ebe
commit cacfccf803
2 changed files with 65 additions and 10 deletions

View File

@ -1,10 +1,9 @@
*pi_netrw.txt* For Vim version 9.1. Last change: 2024 Nov 12
*pi_netrw.txt* For Vim version 9.1. Last change: 2024 Nov 23
------------------------------------------------
NETRW REFERENCE MANUAL by Charles E. Campbell
------------------------------------------------
Author: Charles E. Campbell <NcampObell@SdrPchip.AorgM-NOSPAM>
(remove NOSPAM from Campbell's email first)
Original Author: Charles E. Campbell
Copyright: Copyright (C) 2017 Charles E Campbell *netrw-copyright*
The VIM LICENSE applies to the files in this package, including
@ -2659,10 +2658,34 @@ your browsing preferences. (see also: |netrw-settings|)
netrw last saw |g:netrw_cursor| >= 5 or when
netrw was initially run.
*g:netrw_decompress* = { ".gz" : "gunzip" ,
".bz2" : "bunzip2" ,
".zip" : "unzip" ,
".tar" : "tar -xf"}
*g:netrw_decompress* = { '.lz4': 'lz4 -d',
'.lzo': 'lzop -d',
'.lz': 'lzip -dk',
'.7z': '7za x',
'.001': '7za x',
'.tar.bz': 'tar -xvjf',
'.tar.bz2': 'tar -xvjf',
'.tbz': 'tar -xvjf',
'.tbz2': 'tar -xvjf',
'.tar.gz': 'tar -xvzf',
'.tgz': 'tar -xvzf',
'.tar.zst': 'tar --use-compress-program=unzstd -xvf',
'.tzst': 'tar --use-compress-program=unzstd -xvf',
'.tar': 'tar -xvf',
'.zip': 'unzip',
'.bz': 'bunzip2 -k',
'.bz2': 'bunzip2 -k',
'.gz': 'gunzip -k',
'.lzma': 'unlzma -T0 -k',
'.xz': 'unxz -T0 -k',
'.zst': 'zstd -T0 -d',
'.Z': 'uncompress -k',
'.rar': 'unrar x -ad',
'.tar.lzma': 'tar --lzma -xvf',
'.tlz': 'tar --lzma -xvf',
'.tar.xz': 'tar -xvJf',
'.txz': 'tar -xvJf'}
A dictionary mapping suffices to
decompression programs.