Skip to content

Commit

Permalink
Brings all directory stuff to directories.zsh
Browse files Browse the repository at this point in the history
- Cleans out aliases.zsh.
- Removes unneeded cd function.
  • Loading branch information
LFDM authored and mcornella committed Feb 10, 2015
1 parent 13e5afe commit 25b1cd6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 36 deletions.
13 changes: 0 additions & 13 deletions lib/aliases.zsh
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
# Push and pop directories on directory stack
alias pu='pushd'
alias po='popd'

# Basic directory operations
alias ...='cd ../..'
alias -- -='cd -'

This comment has been minimized.

Copy link
@johnjohndoe

johnjohndoe Dec 8, 2015

Contributor

Why did you remove the very useful - alias to return to the last directory?

This comment has been minimized.

Copy link
@mcornella

mcornella Dec 11, 2015

Member

Sorry, this was overlooked. We may add that back but in the meantime you can still use 1 or add the alias yourself in your zshrc file.

This comment has been minimized.

Copy link
@mcornella

mcornella Dec 13, 2015

Member

Funnily, this was commented on February as well, so I'm adding it back. Thanks

This comment has been minimized.

Copy link
@mcornella

# Super user
alias _='sudo'
alias please='sudo'
Expand All @@ -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'

38 changes: 15 additions & 23 deletions lib/directories.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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'

4 comments on commit 25b1cd6

@msg7086
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The h flags in ll, la and l are lost during this "clean out". Shall we bring them back?
This surprises me when I see file sizes in bytes instead of human readable text.

@mcornella
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with you @msg7086, I didn't take the time to review the exact aliases. I'll submit a PR soon enough!

@zmwangx
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created pull request #3591.

@mcornella
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Please sign in to comment.