diff --git a/shell/alias/shell.sh b/shell/alias/shell.sh index 9c9e8e7..d6aa697 100644 --- a/shell/alias/shell.sh +++ b/shell/alias/shell.sh @@ -1,32 +1,27 @@ -# change current directory to its parent -alias ..="\ -cd \ -.. \ -" - -# change current directory to its parent’s parent -alias ...="\ -cd \ -../.. \ -" - # shorten alias -alias a="\ -alias \ -" +a() { + alias \ + "${@}" +} # swap directory (current ↔ previous) -alias sd="\ -cd \ -- \ -" - -# import source file -alias src="\ -. \ -" +sd() { + cd - || return +} # exit terminal -alias x="\ -exit \ -" +x() { + exit \ + "${@}" +} + +# back + +# shellcheck disable=SC3033 +..() { + cd .. +} +# shellcheck disable=SC3033 +...() { + cd ../.. +}