prezto/runcoms/zshrc

46 lines
1 KiB
Bash
Raw Normal View History

2012-01-31 23:37:51 -05:00
#
# Executes commands at the start of an interactive session.
2012-01-31 23:37:51 -05:00
#
# Authors:
# Sorin Ionescu <sorin.ionescu@gmail.com>
#
# Source Prezto.
2012-09-03 16:13:53 -04:00
if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" ]]; then
source "${ZDOTDIR:-$HOME}/.zprezto/init.zsh"
fi
# Customize to your needs...
2016-04-18 06:11:41 -04:00
2016-09-24 07:53:36 -04:00
[[ -s $(brew --prefix)/etc/profile.d/autojump.sh ]] && . $(brew --prefix)/etc/profile.d/autojump.sh
2016-04-18 06:11:41 -04:00
source ~/.fzf.zsh
2016-04-30 09:10:07 -04:00
[[ -s $(brew --prefix)/etc/profile.d/autojump.sh ]] && . $(brew --prefix)/etc/profile.d/autojump.sh
2016-04-18 06:11:41 -04:00
2016-09-24 07:53:36 -04:00
fasd_cache="$HOME/.fasd-init-zsh"
if [ "$(command -v fasd)" -nt "$fasd_cache" -o ! -s "$fasd_cache" ]; then
fasd --init posix-alias zsh-hook zsh-ccomp zsh-ccomp-install >| "$fasd_cache"
fi
source "$fasd_cache"
unset fasd_cache
2016-10-26 06:55:52 -04:00
export PATH=~/.local/bin:$PATH
2017-05-29 08:43:18 -04:00
# timing the commands
function ts_preexec() {
timer=${timer:-$SECONDS}
}
add-zsh-hook preexec ts_preexec
function ts_precmd() {
if [ $timer ]; then
timer_show=$(($SECONDS - $timer))
export RPROMPT="%t %F{cyan}${timer_show}s %{$reset_color%}"
unset timer
fi
}
add-zsh-hook precmd ts_precmd