From e3bed71fd7137c2d4d15e6db4e61c13f846bd62b Mon Sep 17 00:00:00 2001 From: Harald Pfeiffer Date: Sun, 12 Jan 2025 12:35:03 +0100 Subject: Create alias "editor" for other scripts or aliases to use --- .bash/aliases.bash | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.bash/aliases.bash b/.bash/aliases.bash index ae3c14b..0304f11 100644 --- a/.bash/aliases.bash +++ b/.bash/aliases.bash @@ -9,6 +9,17 @@ if [ "$TERM" != "dumb" ];then alias grep="grep --color=auto" alias egrep="egrep --color=auto" fi +if [ -n "$EDITOR" ]; then + alias editor="$EDITOR" +elif [ -n "$VISUAL" ]; then + alias editor="$VISUAL" +elif [ -x "/usr/bin/vim" ]; then + alias editor="/usr/bin/vim" +elif [ -x "/usr/bin/vi" ]; then + alias editor="/usr/bin/vi" +else + alias editor="/usr/bin/edit" +fi alias lst="ls -l --time-style=full-iso" alias cls=' echo -ne "\033c"' alias pip-update="sudo pip freeze --local | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 sudo pip install -U" -- cgit v1.2.3