diff options
-rw-r--r-- | .ghci | 4 | ||||
-rw-r--r-- | .vimrc | 6 | ||||
-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 |
7 files changed, 39 insertions, 18 deletions
@@ -8,6 +8,6 @@ :def iq (\arg -> let [x, y] = Prelude.words arg in return <| "import qualified " ++ x ++ " as " ++ y) :def hoogle \s -> return <| ":! hoogle search --count=15 \"" ++ s ++ "\"" :def hdoc \s -> return <| ":! hoogle search --info \"" ++ s ++ "\"" -:def! f \_ -> return <| ":! ftags.sh \n:r" -:def! h \_ -> return <| ":! hoog.sh" +:def! f \_ -> return <| ":! ftags \n:r" +:def! h \_ -> return <| ":! hoog" :def test \_ -> return <| ":main test" @@ -1,8 +1,8 @@ " requires: https://github.com/MarcWeber/vim-addon-local-vimrc augroup tags -au BufWritePost *.hs silent !$BIZ_ROOT/Biz/Ide/init_tags.sh % -au BufWritePost *.hsc silent !$BIZ_ROOT/Biz/Ide/init_tags.sh % -au BufWritePost *.lhs silent !$BIZ_ROOT/Biz/Ide/init_tags.sh % +au BufWritePost *.hs silent !$BIZ_ROOT/Biz/Ide/mktags % +au BufWritePost *.hsc silent !$BIZ_ROOT/Biz/Ide/mktags % +au BufWritePost *.lhs silent !$BIZ_ROOT/Biz/Ide/mktags % augroup END set equalprg=ormolu 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 +## |