From 25b1cd687b28cb8d05229130ee5a0e2494276894 Mon Sep 17 00:00:00 2001 From: LFDM <1986gh@gmail.com> Date: Fri, 10 Jan 2014 23:32:20 +0100 Subject: [PATCH] Brings all directory stuff to directories.zsh - Cleans out aliases.zsh. - Removes unneeded cd function. --- lib/aliases.zsh | 13 ------------- lib/directories.zsh | 38 +++++++++++++++----------------------- 2 files changed, 15 insertions(+), 36 deletions(-) diff --git a/lib/aliases.zsh b/lib/aliases.zsh index aae86504..c67f854a 100644 --- a/lib/aliases.zsh +++ b/lib/aliases.zsh @@ -1,11 +1,3 @@ -# Push and pop directories on directory stack -alias pu='pushd' -alias po='popd' - -# Basic directory operations -alias ...='cd ../..' -alias -- -='cd -' - # Super user alias _='sudo' alias please='sudo' @@ -25,11 +17,6 @@ then else alias history='fc -l 1' fi -# List direcory contents -alias lsa='ls -lah' -alias l='ls -lah' -alias ll='ls -lh' -alias la='ls -lAh' alias afind='ack-grep -il' diff --git a/lib/directories.zsh b/lib/directories.zsh index 02743e0c..1693d5dd 100644 --- a/lib/directories.zsh +++ b/lib/directories.zsh @@ -3,12 +3,10 @@ setopt auto_pushd setopt pushd_ignore_dups setopt pushdminus -alias ..='cd ..' -alias cd..='cd ..' -alias cd...='cd ../..' -alias cd....='cd ../../..' -alias cd.....='cd ../../../..' -alias cd/='cd /' +alias -g ...='../..' +alias -g ....='../../..' +alias -g .....='../../../..' +alias -g ......='../../../../..' alias 1='cd -' alias 2='cd -2' @@ -20,23 +18,17 @@ alias 7='cd -7' alias 8='cd -8' alias 9='cd -9' -cd () { - if [[ "x$*" == "x..." ]]; then - cd ../.. - elif [[ "x$*" == "x...." ]]; then - cd ../../.. - elif [[ "x$*" == "x....." ]]; then - cd ../../../.. - elif [[ "x$*" == "x......" ]]; then - cd ../../../../.. - elif [ -d ~/.autoenv ]; then - source ~/.autoenv/activate.sh - autoenv_cd "$@" - else - builtin cd "$@" - fi -} - alias md='mkdir -p' alias rd=rmdir alias d='dirs -v | head -10' + +# List direcory contents +alias lsa='ls -lah' +alias l='ls -la' +alias ll='ls -l' +alias la='ls -lA' +alias sl=ls # often screw this up + +# Push and pop directories on directory stack +alias pu='pushd' +alias po='popd'