summaryrefslogtreecommitdiff
path: root/Biz/Ide
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2022-07-25 09:56:12 -0400
committerBen Sima <ben@bsima.me>2022-07-25 10:29:10 -0400
commit8e25ac2c4f606f3a82e079e0c4efa662b6c4e442 (patch)
treefdea667abb49ccb2b8ede5695266a67f6f4cf925 /Biz/Ide
parentddbb61ed8c546b718242bf3b54dba7f1d1248590 (diff)
Add tags support for more languages
Rust seems to not be supported in my ctags version :( Also rename some Ide scripts because these are commands, not really scripts.
Diffstat (limited to 'Biz/Ide')
-rwxr-xr-xBiz/Ide/ftags (renamed from Biz/Ide/ftags.sh)7
-rwxr-xr-xBiz/Ide/hoog (renamed from Biz/Ide/hoog.sh)0
-rwxr-xr-xBiz/Ide/init_tags.sh12
-rwxr-xr-xBiz/Ide/mktags27
4 files changed, 33 insertions, 13 deletions
diff --git a/Biz/Ide/ftags.sh b/Biz/Ide/ftags
index fba7fb0..6899faa 100755
--- a/Biz/Ide/ftags.sh
+++ b/Biz/Ide/ftags
@@ -3,7 +3,12 @@
# search tags with fzf
#
set -euo pipefail
- tags=$BIZ_ROOT/tags
+ if [[ "$EDITOR" =~ ^emacs ]]; then
+ echo "error: emacs tags not supported"
+ exit 1
+ else
+ tags=$BIZ_ROOT/tags
+ fi
tag_search=$(
awk 'BEGIN { FS="\t" } !/^!/ {print toupper($4)"\t"$1"\t"$2"\t"$3}' "$tags" \
| cut -c1-80 \
diff --git a/Biz/Ide/hoog.sh b/Biz/Ide/hoog
index 976f0d4..976f0d4 100755
--- a/Biz/Ide/hoog.sh
+++ b/Biz/Ide/hoog
diff --git a/Biz/Ide/init_tags.sh b/Biz/Ide/init_tags.sh
deleted file mode 100755
index 0efc0ed..0000000
--- a/Biz/Ide/init_tags.sh
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/usr/bin/env bash
-#
-# fast-tags wrapper to generate tags automatically if there are none.
-#
- fns=$@
- if [[ ! -r tags ]]; then
- echo Generating tags from scratch...
- exec fast-tags $flags -R .
- else
- exec fast-tags $fns
- fi
-##
diff --git a/Biz/Ide/mktags b/Biz/Ide/mktags
new file mode 100755
index 0000000..b5b55c7
--- /dev/null
+++ b/Biz/Ide/mktags
@@ -0,0 +1,27 @@
+#!/usr/bin/env bash
+#
+# script to generate tags automatically if there are none.
+#
+ set -euxo pipefail
+ files=$@
+ tags=$BIZ_ROOT/tags
+ flags=()
+ if [[ "$EDITOR" =~ ^emacs ]]; then
+ flags+=("-e")
+ fi
+ if [[ ! -r $tags ]]; then
+ echo Generating tags from scratch...
+ fast-tags "${flags[@]}" -R $BIZ_ROOT
+ ctags "${flags[@]}" \
+ --append=yes \
+ --recurse=yes \
+ --exclude="$BIZ_ROOT/_/*" \
+ $BIZ_ROOT
+ else
+ fast-tags "${flags[@]}" $files
+ ctags "${flags[@]}" \
+ --append=yes \
+ --exclude="_/*" \
+ $files
+ fi
+##