-
So i keep a file that has common aliases between bash and zsh, i want to add abbr without duplicating entries for both My plan was to use function like this a() {
if [ "$1" = "-a" ]; then
shift
# abbr is only for zsh, otherwise make a normal alias
if command -v abbr &>/dev/null; then
abbr -S "$@"
else
alias "$@"
fi
else
alias "$@"
fi
} Any way to do this? |
Beta Was this translation helpful? Give feedback.
Answered by
olets
Apr 28, 2023
Replies: 1 comment 4 replies
-
Have you tried aliases file alias one="two" bashrc source path/to/aliases/file zshrc source path/to/aliases/file
# load zsh-abbr and then
abbr -q import-aliases |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Maybe in .zshrc
abbr -q import-aliases
That might not exactly fit with how you use your
a
. But something like it should work