Is it possible to auto unzip/zip *.gz
files within vim?
Asked
Active
Viewed 8.7k times
6 Answers
35
My vim installation does this by default.
VIM - Vi IMproved 7.3 (2010 Aug 15) on OpenSUSE 12.1
Also, check this link: http://ubuntuforums.org/showthread.php?t=902668

Sridhar Sarnobat
- 25,183
- 12
- 93
- 106

Filip
- 1,451
- 1
- 11
- 19
-
1Mine worked too. `VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Jan 2 2014 19:39:32)` – Sridhar Sarnobat May 30 '18 at 21:12
16
zip/unzip
cannot open *.gz
files as far as I know.
Vim can open *.gz
files with the help of gzip/gunzip
like this
Its already discussed here on SO

Community
- 1
- 1

Pavan Manjunath
- 27,404
- 12
- 99
- 125
1
I have searched for this answer as well, specifically for Fedora.
So on Fedora, you need to install the package vim-enhanced
:
sudo dnf install vim-enhanced
Now it is possible to just edit gzipped files like this:
vim my.log.gz

Timotheus Pokorra
- 353
- 2
- 12
0
try this, works for me - I am not sure if something extra needs to be installed on the server however:
zless filename.gz

Sunjalo
- 189
- 1
- 6
-
2zless or gzless is a viewer. OP presumably wants to edit the archived file – Hachi Dec 14 '12 at 08:28
-1
This is what I did
Unzip the .gz file -->
gunzip YourFile.gz
(This unzips the file and puts in the same directory)Then use vim to open it -->
vim YourFile

Sandeep Amarnath
- 5,463
- 3
- 33
- 43