Skip to content

Instantly share code, notes, and snippets.

@westphahl
Created March 25, 2014 12:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save westphahl/9761230 to your computer and use it in GitHub Desktop.
Save westphahl/9761230 to your computer and use it in GitHub Desktop.
# Evaluate prompt
setopt prompt_subst
# History config
HISTFILE=~/.histfile
HISTSIZE=1000
SAVEHIST=1000
# VIM key bindings
bindkey -v
# Key bindings for 'home' and 'end'
bindkey "^[[1~" beginning-of-line
bindkey "^[[4~" end-of-line
bindkey "^[OH" beginning-of-line
bindkey "^[OF" end-of-line
# ?
zstyle :compinstall filename '/home/westphahl/.zshrc'
# Auto completion
autoload -Uz compinit
compinit
# Colors
COLORTERM=yes
autoload colors zsh/terminfo
if [[ "$terminfo[colors]" -ge 8 ]]; then
colors
fi
function git_prompt {
#git branch >/dev/null 2>/dev/null && echo '±' && return
BRANCH=$(git rev-parse --abbrev-ref HEAD 2>/dev/null) && echo "±$BRANCH" && return
echo '#'
}
# Prompt
PROMPT="%{${fg[cyan]}%}%n%{${fg[magenta]}%}@%m%{${fg[cyan]}%}%#%{$reset_color%} "
RPROMPT='%{${fg_bold[black]}%}%~ {$(git_prompt)}%{$reset_color%}'
# Environment
export EDITOR=vim
export PAGER=less
# Set color output
alias ls='ls -h --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
# Aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
alias rm='rm -I'
alias open='xdg-open >/dev/null 2>&1'
alias agcc='gcc -g -Wall -Wextra -Wstrict-prototypes -std=c99 -pedantic'
alias ag++='gcc -g -Wall -Wextra -Weffc++ -Wstrict-prototypes -std=c99 -pedantic'
# Display randome fact
alias fact="elinks -dump randomfunfacts.com | sed -n '/^| /p' | tr -d \|"
alias pdflatex='pdflatex -shell-escape -interaction=nonstopmode'
# Node paths
export PATH=$HOME/local/node/bin:$PATH
export NODE_PATH=$HOME/local/node:$HOME/local/node/lib/node_modules
# List old kernels
# dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d'
# Remove old kernels
# sudo apt-get purge old-kernel
# TMUX
if which tmux 2>&1 >/dev/null; then
# if no session is started, start a new session
test -z ${TMUX} && tmux
# when quitting tmux, try to attach
while test -z ${TMUX}; do
tmux attach || break
done
fi
export NUMBER_OF_PROCESSORS=5
### Added by the Heroku Toolbelt
export PATH="/usr/local/heroku/bin:$PATH"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment