diff options
author | Ben Sima <ben@bsima.me> | 2020-12-28 11:20:00 -0500 |
---|---|---|
committer | Ben Sima <ben@bsima.me> | 2020-12-28 11:20:00 -0500 |
commit | ef47d351e347fb24a75afc61eac84a71afa49936 (patch) | |
tree | 9ca78b2c43aaba90a2f43a6ba4aa477cb7511a24 | |
parent | b30746cafc8ac21225652d7bfc45ca13db3ab761 (diff) |
add ftags to shell hook
-rw-r--r-- | Biz/Bild/ShellHook.sh | 15 |
1 files changed, 15 insertions, 0 deletions
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 +} |