Skip to content

Instantly share code, notes, and snippets.

@ptbrowne
Created July 17, 2019 10:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ptbrowne/c6f5c79305273a3ab1a044a4a1fb48c2 to your computer and use it in GitHub Desktop.
Save ptbrowne/c6f5c79305273a3ab1a044a4a1fb48c2 to your computer and use it in GitHub Desktop.
FZF usages

pk.fish

Interactively kills a process

ps aux | fzf | tr -s ' ' | cut -d ' ' -f 2 | xargs kill

lab.mr-browse-interactive.fish

List pending pull-requests, select one, and opens the browser

lab mr list | fzf | cut -d ' ' -f 1 | tr -d '#' | xargs lab mr browse

yr.fish

Reads a file containing scripts, selects one, and outputs it on my command line so that I can hit enter and its runs (and it is saved to history).

set script (cat package.json | jq -r '.scripts | keys[]' | fzf)
commandline -t "yarn run "
commandline -it -- (string escape $script)

git-fixup.sh

Select a commit in the last 20 commits and commits current staging area as a fixup of this commits.

git ll -n 20 | fzf | cut -f 1 | xargs git commit --no-verify --fixup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment