diff --git a/chezmoi/dot_zshrc.d/executable_tag.zsh b/chezmoi/dot_zshrc.d/executable_tag.zsh index 7f75951..4254571 100644 --- a/chezmoi/dot_zshrc.d/executable_tag.zsh +++ b/chezmoi/dot_zshrc.d/executable_tag.zsh @@ -1,5 +1,11 @@ if command -v tag &> /dev/null; then - export TAG_SEARCH_PROG=ag # replace with rg for ripgrep - tag() { command tag "$@"; source ${TAG_ALIAS_FILE:-/tmp/tag_aliases} 2>/dev/null } - alias ag=tag # replace with rg for ripgrep + if command -v ag &> /dev/null; then + tag() { export TAG_SEARCH_PROG=ag; command tag "$@"; source ${TAG_ALIAS_FILE:-/tmp/tag_aliases} 2>/dev/null } + alias ag=tag + fi + + if command -v rg &> /dev/null; then + trg() { export TAG_SEARCH_PROG=rg; command tag "$@"; source ${TAG_ALIAS_FILE:-/tmp/tag_aliases} 2>/dev/null } + alias rg=trg + fi fi