Results 1 to 7 of 7

Thread: How to make VI open gzip files

  1. #1
    Join Date
    Jan 2008
    Beans
    37

    How to make VI open gzip files

    Hi.
    At work, we have a machine that runs linux (I forgot which flavour). I had to do some stuff recently and I noticed by accident that VI that is installed there supports automagic gz file edition. By that I mean that when the file contains text, and it is gzipped, and I open it with VI, it displayes the uncompressed text data. This is quite handy. Do you know how one can confgure / tweak his VI to do sth like that?
    Cheers.

  2. #2
    Join Date
    Feb 2008
    Location
    Massachusetts, USA
    Beans
    254
    Distro
    Kubuntu 12.04 Precise Pangolin

    Re: How to make VI open gzip files

    Do you have the vim-common package installed? From what I understand, if that is installed, this functionality it supported.

    Also, to ID your distrubution, try this command: cat /etc/issue
    P5W-DH, E6750, Patriot Viper 4x2GB 1066, Seasonic M12 500w
    Creative Audigy, EVGA GTX 460, HP 2509m
    Kubuntu 12.04 64-bit (KDE 4.8.1)

  3. #3
    Join Date
    Jan 2007
    Location
    $here ? $here : $there
    Beans
    3,717
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: How to make VI open gzip files

    You should be able to get this behavior just by installing vim-full:

    Code:
    sudo apt-get install vim-full
    (That's generally the first command I run on a new install)
    Don't try to make something "fast" until you are able to quantify "slow".

  4. #4
    Join Date
    Dec 2007
    Location
    California
    Beans
    4,900
    Distro
    Ubuntu 13.04 Raring Ringtail

    Re: How to make VI open gzip files

    I always extracted to standard output and piped it into vim, looks like I don't even have to do that!
    "You can't expect to hold supreme executive power just because some watery tart lobbed a sword at you"

    "Don't let your mind wander -- it's too little to be let out alone."

  5. #5
    Join Date
    Jan 2008
    Beans
    37

    Re: How to make VI open gzip files

    vim-full package is all I had to do to make this work.
    Thank you for your help.

  6. #6
    Join Date
    Feb 2009
    Beans
    1

    Re: How to make VI open gzip files

    If you want to make vim open gz files on a server edition with no graphical gui, just install the vim package:

    Code:
    sudo apt-get install vim

  7. #7
    Join Date
    Mar 2011
    Beans
    Hidden!

    Re: How to make VI open gzip files

    Quote Originally Posted by jerome1232 View Post
    I always extracted to standard output and piped it into vim, looks like I don't even have to do that!
    Great tip, thanks! But for those unfamiliar, this implies using a command like:
    Code:
    zcat filename.gz | vi -

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •