Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I love fzf for one-liners. Simple pattern: a command gives you everything, pipe it to fzf so that you can pick one, then pipe that to a command to switch to it.

  alias kctx='kubectl config get-contexts -oname | fzf | xargs kubectl config use-context'

  alias prv="gh pr list | fzf | awk -F ' ' '{print $1}' | xargx gh pr view -w"
Amazing stuff.


My alternative to `prv` with preview;

   alias prlsf="GH_FORCE_TTY=yes gh pr list | fzf --ansi --header-lines 3 --preview 'GH_FORCE_TTY=yes gh pr view  {1}' | awk '{ print \$1}' | xargs -I {} gh pr view --web {}"


xargs is an absolute game changer in this regard, once I realized what it actually did I started seeing fzf >>= xargs flows everywhere!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: