Skip to content

Instantly share code, notes, and snippets.

@gaving
Created November 24, 2019 09:13
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 gaving/e87a1383a0eaefc81f51463366d84721 to your computer and use it in GitHub Desktop.
Save gaving/e87a1383a0eaefc81f51463366d84721 to your computer and use it in GitHub Desktop.
# find a file by filename
# fz .json fx
# fz .json "jq -C '.' | less -R"
fz() {
f $1 | fzf --bind "enter:execute(${2:-bat} {})" --preview "bat --color=always {}"
}
# find a file by content
# az ingest open
az() {
a --color=never -l -i $1 | fzf --bind "enter:execute(${2:-bat} {})" --preview "rg --context=2 -p -uuu -i $1 {}" --preview-window wrap
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment