Skip to content

Instantly share code, notes, and snippets.

@Congee
Created February 23, 2015 10:50
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 Congee/085b21b2d78547e2d43b to your computer and use it in GitHub Desktop.
Save Congee/085b21b2d78547e2d43b to your computer and use it in GitHub Desktop.
Ag as a peco matcher
#!/bin/sh
while read LINE; do
if [[ -f "${LINE}" ]] &&\
[[ -r "${LINE}" ]] &&\
[[ $(ag -l "$1" "${LINE}") ]]; then
echo "${LINE}"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment