From e66414033c694565ee8ea376213eec12f9748f48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Zapletal?= Date: Wed, 23 Aug 2017 11:10:49 +0200 Subject: [PATCH] fuzzy grep open via ag --- Examples.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Examples.md b/Examples.md index f5be8ba..e688ec1 100644 --- a/Examples.md +++ b/Examples.md @@ -83,6 +83,20 @@ vf() { } ``` +```sh +# fuzzy grep open via ag +vg() { + local file + + file="$(ag --nobreak --noheading $@ | fzf -0 -1 | awk -F: '{print $1 " +" $2}')" + + if [[ -n $file ]] + then + vim $file + fi +} +``` + ### Changing directory ```sh