Skip to content

Commit

Permalink
Shell tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
Wei Dai committed Jun 21, 2012
1 parent e61aa67 commit 741c557
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 12 deletions.
6 changes: 6 additions & 0 deletions .aliases
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ alias egrep='egrep --color=auto'
alias ll='ls -halF'
alias la='ls -A'
alias l='ls -CF'
alias lt='ls -t'
alias lS='ls -S'

alias df='df -h'
alias du='du -h'
alias free='free -h'

alias ..='cd ..'

Expand Down
3 changes: 1 addition & 2 deletions .bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ if [ "$PS1" ]; then
FASD_CACHE="$HOME/.fasd-init-bash"

if test-nt "$(which fasd)" "$FASD_CACHE" || [ ! -f "$FASD_CACHE" ]; then
fasd --init posix-alias bash-hook bash-ccomp bash-ccomp-install \
bash-wcomp bash-wcomp-install > "$FASD_CACHE"
fasd --init posix-alias bash-{hook,ccomp,ccomp-install} > "$FASD_CACHE"
fi

source "$FASD_CACHE"
Expand Down
17 changes: 9 additions & 8 deletions .zshrc
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
for config ($HOME/.zsh/*.zsh) source "$config"

# Compile the completion dump, to increase startup speed.
dump_file="$HOME/.zcompdump"
if [[ "$dump_file" -nt "${dump_file}.zwc" || ! -f "${dump_file}.zwc" ]]; then
zcompile "$dump_file"
fi
unset dump_file
{ # Compile the completion dump to increase startup speed.
dump_file="$HOME/.zcompdump"
if [[ "$dump_file" -nt "${dump_file}.zwc" || ! -f "${dump_file}.zwc" ]]; then
zcompile "$dump_file"
fi
unset dump_file
} &!

# Load and initialize the completion system ignoring insecure directories.
autoload -Uz compinit && compinit -i
Expand All @@ -16,8 +17,8 @@ autoload -Uz compinit && compinit -i
FASD_CACHE="$HOME/.fasd-init-zsh"

if test-nt "$(which fasd)" "$FASD_CACHE" || [ ! -f "$FASD_CACHE" ]; then
fasd --init posix-alias zsh-hook zsh-ccomp zsh-ccomp-install zsh-wcomp \
zsh-wcomp-install > "$FASD_CACHE"
fasd --init posix-alias zsh-{hook,ccomp,ccomp-install,wcomp,wcomp-install} \
> "$FASD_CACHE"
fi

source "$FASD_CACHE"
Expand Down
2 changes: 1 addition & 1 deletion bin/test-nt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

[ $# -eq 2 ] || exit 2

case "$(ls -td "$@" 2>/dev/null)" in
case "$(ls -tdH "$@" 2>/dev/null)" in
$1*$2) exit 0;;
*) exit 1;;
esac
Expand Down
2 changes: 1 addition & 1 deletion bin/test-ot
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

[ $# -eq 2 ] || exit 2

case "$(ls -td "$@" 2>/dev/null)" in
case "$(ls -tdH "$@" 2>/dev/null)" in
$2*$1) exit 0;;
*) exit 1;;
esac
Expand Down

0 comments on commit 741c557

Please sign in to comment.