From f3593d60d132f981eefd43fbd339c7f3a9df08ec Mon Sep 17 00:00:00 2001 From: Sanchayan Maity Date: Sat, 6 Jan 2024 14:35:38 +0530 Subject: [PATCH] fish: functions: Execute fast-tags only if in a git project In neovim, we run this after saving a file. However, when opening a Haskell file which is outside of a project or in a directory which has all other Haskell code, it would generate tags for every project in this directory blocking neovim in the mean time. --- fish/.config/fish/functions/fasttags.fish | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/fish/.config/fish/functions/fasttags.fish b/fish/.config/fish/functions/fasttags.fish index 60442b7..ba28a80 100644 --- a/fish/.config/fish/functions/fasttags.fish +++ b/fish/.config/fish/functions/fasttags.fish @@ -1,7 +1,9 @@ function fasttags --description "Generate tags for Haskell project" - if not test -e tags - fast-tags --fully-qualified -R . - else - fast-tags --fully-qualified -R $argv + if test -d .git + if not test -e tags + fast-tags --fully-qualified -R . + else + fast-tags --fully-qualified -R $argv + end end end