POV-Ray : Newsgroups : povray.off-topic : How cool is that? : Re: How cool is that? Server Time
5 Sep 2024 19:22:48 EDT (-0400)
  Re: How cool is that?  
From: Warp
Date: 1 Jun 2009 12:50:59
Message: <4a2406f3@news.povray.org>
Darren New <dne### [at] sanrrcom> wrote:
> vim can open a zip file and browse it in directory mode. I never knew.

  I usually use (gnu) less to examine the contents of zip files (and almost
any other packed format). It lists the files with some info about them
(rather than raw characters).

  However, if you really want coolness, nothing beats the file completion
feature in zsh. Just a few examples:

* Relatively simple: Suppose you have a bunch of files in the current
  directory and all of them have og+r permissions, except one which
  doesn't. You write "chmod og+r " and press tab, and zsh
  intelligently completes to that one file for which the command makes
  sense.

* Still relatively simple: Suppose that you are inside a directory
  which has many files, but only one of them is a pdf. You write
  "acroread " and press tab, and it will complete to that pdf file.

* Getting warmer: Write "unzip somefile.zip " and then press tab, and it
  will start completing to file names inside the zip file.

* Medium: You write, for example, "mplayer " and press tab, and it will
  list all possible things you could give to mplayer as input, not only
  the possible video/audio files in the current directory, but also things
  like "cdda://", "tv://" and so on. Pressing tab again will start cycling
  through the possibilities. Write "mplayer -al" and press tab, and it
  completes it to "mplayer -alang".

* Getting warmer: Write "scp something" and press tab, and if
  "something" was the beginning of a hostname you have used with scp
  in the past, zsh will complete to it and add a ":" at the end. Press
  tab again and zsh will ask you for the ssh login details and then
  start completing the files/directories on the remote computer.

* Freaking mental: Suppose you are inside a directory which is
  git-revisioned, with many files tracked by git. except for one or a
  few new files which are not yet. You write "git add " and press tab,
  and if there was only one such file, it will directly complete to
  it. If there were several, pressing tab again will list those files,
  and if you press it again, will start cycling through them.

  Is there something zsh's file completion can't do? Maybe give you the
correct lottery numbers for next week (although I'm sure that's also
on the works).

-- 
                                                          - Warp


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.