3 ms·
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.
by solatic 4y ago
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.
- hiAndrewQuinn 4y agoxargs is an absolute game changer in this regard, once I realized what it actually did I started seeing fzf >>= xargs flows everywhere!
- seruman 4y agoMy 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 {}"