This is too awesome
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;}')
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:
- 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.
- You type a few parts of the path that you remember.
- 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.
- The parts of the path that you typed in are passed to
locate -eiA, then passed throughonlyDirs(a script or function that filters out non-directory paths), then passed into Percol. - You narrow down and select the directory you want with Percol, then hit Enter.
- 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.