ohmyzsh/lib/directories.zsh
2010-07-21 16:52:28 -04:00

47 lines
939 B
Bash

# Changing/making/removing directory
setopt auto_name_dirs
setopt auto_pushd
setopt pushd_ignore_dups
alias -- -='cd -'
alias .='pwd'
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
alias .....='cd ../../../..'
alias cd..='cd ..'
alias cd...='cd ../..'
alias cd....='cd ../../..'
alias cd.....='cd ../../../..'
alias cd/='cd /'
cd () {
if [[ "x$*" == "x..." ]]; then
cd ../..
elif [[ "x$*" == "x...." ]]; then
cd ../../..
elif [[ "x$*" == "x....." ]]; then
cd ../../..
elif [[ "x$*" == "x......" ]]; then
cd ../../../..
else
builtin cd "$@"
fi
}
alias md='mkdir -p'
alias rd=rmdir
alias d='dirs -v'
# List direcory contents
alias l1='tree --dirsfirst -ChFL 1'
alias l2='tree --dirsfirst -ChFL 2'
alias l3='tree --dirsfirst -ChFL 3'
alias ll1='tree --dirsfirst -ChFupDaL 1'
alias ll2='tree --dirsfirst -ChFupDaL 2'
alias ll3='tree --dirsfirst -ChFupDaL 3'
alias l='l1'
alias ll='ll1'