ohmyzsh/lib/directories.zsh
Shawn Sorichetti a1a75be21d Merge remote-tracking branch 'robbyrussell/master'
Conflicts:
	.gitignore
	lib/aliases.zsh
	lib/directories.zsh
	lib/functions.zsh
	lib/git.zsh
	lib/termsupport.zsh
	plugins/svn/svn.plugin.zsh
	templates/zshrc.zsh-template
2011-05-02 15:32:24 -04:00

46 lines
917 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'
# mkdir & cd to it
function mcd() {
mkdir -p "$1" && cd "$1";
}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'