Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This is too awesome #70

Open
jacobbridges opened this issue May 8, 2015 · 1 comment
Open

This is too awesome #70

jacobbridges opened this issue May 8, 2015 · 1 comment

Comments

@jacobbridges
Copy link

jacobbridges commented May 8, 2015

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;}')
@alphapapa
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants