Last active
December 17, 2015 09:29
-
-
Save adaedra/5587760 to your computer and use it in GitHub Desktop.
My `.zshrc` file. This gist is used by the script itself to maintain itself up-to-date.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
OPEN_SYMBOL="❮" | |
CLOSE_SYMBOL="❯" | |
PROMPT=" %F{cyan}%m: %B%n%b%F{cyan} \${CLOSE_SYMBOL}%f " | |
RPROMPT="\${STATUS_PROMPT}%F{blue}\${OPEN_SYMBOL} %B%1~%b%f" | |
LAST_RET=0 | |
setopt PROMPT_SUBST | |
setopt TRANSIENT_RPROMPT | |
function precmd() { | |
LAST_RET=$? | |
if [ ${LAST_RET} -ne 0 ] | |
then | |
STATUS_PROMPT="%F{yellow}${OPEN_SYMBOL} ⎋ ${LAST_RET}%f " | |
else | |
STATUS_PROMPT="" | |
fi | |
} | |
SYSTEM=$(uname) | |
if [ $SYSTEM = "Linux" ] | |
then | |
alias ls="ls --color -F -x" | |
else | |
alias ls="ls -FG" | |
fi | |
alias ll="ls -lh" | |
alias la="ls -A" | |
alias lll="ls -lhA" | |
if [ $SYSTEM = "Darwin" ] | |
then | |
# Homebrew | |
PATH="/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin" | |
export PATH | |
fi | |
function icanhas() { | |
which $1 2>&1 >/dev/null | |
return $? | |
} | |
PAGER=less | |
icanhas most && PAGER=most | |
EDITOR=vi | |
icanhas emacs && EDITOR="emacs -nw" | |
test ${SYSTEM} = "Darwin" && icanhas subl && EDITOR="subl -n -w" | |
export PAGER | |
export EDITOR | |
alias e="$EDITOR" | |
LANG=en_US.UTF-8 | |
LC_TIME=fr_FR.UTF-8 | |
export LANG LC_TIME | |
autoload compinit | |
compinit | |
function __updaterc() { | |
cd /tmp | |
curl -\#L "https://gist.github.com/adaedra/5587760/raw" > zshrc | |
mv ~/.zshrc ~/.zshrc.bak | |
mv zshrc ~/.zshrc | |
} | |
alias updaterc="( __updaterc ) && . ~/.zshrc" | |
alias todo="grep -noER '(TODO|FIXME).+$' ." | |
icanhas rbenv && eval "$(rbenv init -)" | |
true # Avoid to have a return for first prompt... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment