ohmyzsh/lib/directories.zsh
Shawn Sorichetti 2f046e7e4a Merge remote-tracking branch 'sjl/master'
Conflicts:
	.gitignore
	lib/directories.zsh
	lib/functions.zsh
	lib/git.zsh
	templates/zshrc.zsh-template
2011-06-03 16:56:06 -04:00

46 lines
900 B
Bash

# Changing/making/removing directory
setopt auto_name_dirs
setopt auto_pushd
setopt pushd_ignore_dups
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'
# mkdir & cd to it
function mcd() {
mkdir -p "$1" && cd "$1";
}