From ef47d351e347fb24a75afc61eac84a71afa49936 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Mon, 28 Dec 2020 11:20:00 -0500 Subject: add ftags to shell hook --- Biz/Bild/ShellHook.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'Biz') diff --git a/Biz/Bild/ShellHook.sh b/Biz/Bild/ShellHook.sh index b40b91e..9f163ba 100644 --- a/Biz/Bild/ShellHook.sh +++ b/Biz/Bild/ShellHook.sh @@ -123,3 +123,18 @@ function ci() { } help + +# ftags - search ctags +ftags() { + local line + if [[ -e tags ]] + then + line=$( + awk 'BEGIN { FS="\t" } !/^!/ {print toupper($4)"\t"$1"\t"$2"\t"$3}' tags | \ + cut -c1-80 | fzf --nth=1,2 + ) + ${EDITOR:-vim} \ + $(cut -f3 <<< "$line") -c "set nocst" \ + -c "silent tag $(cut -f2 <<< "$line")" + fi +} -- cgit v1.2.3