tb-dotfiles/chezmoi/dot_zshrc.d/executable_tag.zsh

26 lines
599 B
Bash
Raw Normal View History

2022-04-22 10:06:53 -04:00
if command -v tag &> /dev/null; then
2023-06-13 09:55:08 -04:00
if command -v ag &> /dev/null; then
tag() {
export TAG_SEARCH_PROG=ag
export TAG_ALIAS_FILE="$(mktemp)"
command tag "$@"
source ${TAG_ALIAS_FILE:-/tmp/tag_aliases} &> /dev/null
rm -f "$TAG_ALIAS_FILE" &> /dev/null
}
2023-06-13 09:55:08 -04:00
alias ag=tag
fi
if command -v rg &> /dev/null; then
trg() {
export TAG_SEARCH_PROG=rg
export TAG_ALIAS_FILE="$(mktemp)"
command tag "$@"
source ${TAG_ALIAS_FILE:-/tmp/tag_aliases} &> /dev/null
rm -f "$TAG_ALIAS_FILE" &> /dev/null
}
2023-06-13 09:55:08 -04:00
alias rg=trg
fi
2022-04-22 10:06:53 -04:00
fi