diff options
author | Ben Sima <ben@bsima.me> | 2022-07-25 09:56:12 -0400 |
---|---|---|
committer | Ben Sima <ben@bsima.me> | 2022-07-25 10:29:10 -0400 |
commit | 8e25ac2c4f606f3a82e079e0c4efa662b6c4e442 (patch) | |
tree | fdea667abb49ccb2b8ede5695266a67f6f4cf925 /Biz | |
parent | ddbb61ed8c546b718242bf3b54dba7f1d1248590 (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')
-rw-r--r-- | Biz/Bild.nix | 1 | ||||
-rwxr-xr-x | Biz/Ide/ftags (renamed from Biz/Ide/ftags.sh) | 7 | ||||
-rwxr-xr-x | Biz/Ide/hoog (renamed from Biz/Ide/hoog.sh) | 0 | ||||
-rwxr-xr-x | Biz/Ide/init_tags.sh | 12 | ||||
-rwxr-xr-x | Biz/Ide/mktags | 27 |
5 files changed, 34 insertions, 13 deletions
diff --git a/Biz/Bild.nix b/Biz/Bild.nix index 15d9134..547ccb9 100644 --- a/Biz/Bild.nix +++ b/Biz/Bild.nix @@ -117,6 +117,7 @@ rec { # this should just be dev tools buildInputs = with nixpkgs.pkgs; [ bild + ctags figlet git haskell.packages.${constants.ghcCompiler}.fast-tags 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 +## |