summaryrefslogtreecommitdiff
path: root/Biz/Ide
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2020-12-28 20:20:13 -0500
committerBen Sima <ben@bsima.me>2020-12-28 20:20:13 -0500
commit5b6c9313d0e766899eb3f3ce634e3fdaf6d68245 (patch)
tree1be27742f079801728566882df0f8fb65fda16c0 /Biz/Ide
parent13148a011bbfc96042fbe3965d9dc2bd93a9a047 (diff)
ide: add ftags script
Diffstat (limited to 'Biz/Ide')
-rwxr-xr-xBiz/Ide/ftags.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/Biz/Ide/ftags.sh b/Biz/Ide/ftags.sh
new file mode 100755
index 0000000..daa4ca0
--- /dev/null
+++ b/Biz/Ide/ftags.sh
@@ -0,0 +1,18 @@
+#!/usr/bin/env bash
+# ftags - search ctags
+set -euo pipefail
+tags=$BIZ_ROOT/tags
+if [[ ! -e $tags ]]
+then
+ fast-tags -R $BIZ_ROOT
+else
+ 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