percol icon indicating copy to clipboard operation
percol copied to clipboard

This is too awesome

Open jacobbridges opened this issue 10 years ago • 1 comments

I cannot upvote this enough. Thank you for the amazing tool!!

Has anyone started a repository of helpful bash aliases using percol? I've just made a few that are really useful for me.

Here is one for Docker that lets you choose which running docker image you would like to stop:

docker stop $(docker ps | percol | awk '{print $1;}')

jacobbridges avatar May 08 '15 18:05 jacobbridges

I use Fish as my main shell now, so I don't have a library of Bash functions for Percol. But here are some handy functions I use in Fish. They could be converted to Bash easily enough.

https://gist.github.com/alphapapa/69dbe9d61f5fa127eb11

Basically they work like this:

  1. You're at a prompt. You want to go to a certain directory somewhere on your filesystem, but you don't want to type it all out, or you don't remember the whole path.
  2. You type a few parts of the path that you remember.
  3. Then you press a key combo depending on where you want to search: Alt+L to search in the current directory, Alt+Shift+L to search in your home directory, or Ctrl+Alt+L to search the whole filesystem.
  4. The parts of the path that you typed in are passed to locate -eiA, then passed through onlyDirs (a script or function that filters out non-directory paths), then passed into Percol.
  5. You narrow down and select the directory you want with Percol, then hit Enter.
  6. Percol exits and you are cd'ed into the directory you chose.

Pretty handy. :) I'm adding another one to find files, so you could choose a file the same way, then have it put into the command line for you. Then you just Ctrl+A, type the command, and hit Enter.

alphapapa avatar Sep 30 '15 03:09 alphapapa