rm unused cd aliases in favou cd.

…quickly create cd aliases on demand
This commit is contained in:
Jan Andrle 2024-03-27 14:14:42 +01:00
parent a665006836
commit 3c99b8cb34
Signed by: jaandrle
GPG Key ID: B3A25AED155AFFAB

View File

@ -45,17 +45,12 @@ history_most_used(){ LC_ALL=C cat ~/.bash_history | cut -d ';' -f 2- | §awk 1 |
alias §less='less -R -S' alias §less='less -R -S'
alias §cd.='clear;§ls' cd.(){
§cd..(){ cd $(eval printf '../'%.0s {1..$1}); } [[ -z "$1" ]] && return 1
§cd(){ [[ -z "$2" ]] && local p="$(pwd)" || local p="$(readlink -f $2)"
[[ "$1" == '--help' ]] && echo -e " alias cd.$1="cd ${p}";
Usage: §cd NUMBER|PATH
See: dirs -v
" && return 0
[[ -z "$1" ]] && dirs -v | sed 1d && return 0
[[ $1 =~ ^[0-9]+$ ]] && cd "$(dirs -l +$1)" && dirs -v | sed 1d && return 0
builtin pushd "$1" >/dev/null && pushd .
} }
alias m='cd.'
alias cd-vifm='cd `vifm --choose-dir -`' alias cd-vifm='cd `vifm --choose-dir -`'
mkcd(){ mkdir -p -- "$1" && cd -P -- "$1"; } mkcd(){ mkdir -p -- "$1" && cd -P -- "$1"; }