Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
ZSH config
autoload -U colors && colors
autoload -Uz compinit && compinit
PROMPT="%{$fg[blue]%}%~ ▶%{$reset_color%} "
export TERM="xterm-256color"
export EDITOR='vim'
export CLICOLOR=1
export _JAVA_OPTIONS="-Dawt.useSystemAAFontSettings=on -Dswing.aatext=true"
alias l='ls'
alias ls='ls --color'
alias ll='ls -la'
alias vi='vim'
alias gc='git commit -m'
alias irb='irb --simple-prompt'
alias cpv="rsync -poghb --backup-dir=/tmp/rsync -e /dev/null --progress --" # copy with a progress bar.
alias ag='sudo apt-get'
alias rake='bundle exec rake'
setopt autocd
setopt prompt_subst
setopt correct
setopt autopushd
setopt PUSHD_SILENT
setopt RM_STAR_WAIT # 10 second wait if you do something that will delete everything.
setopt EXTENDED_GLOB
# History stuff
setopt APPEND_HISTORY
setopt SHARE_HISTORY
setopt HIST_IGNORE_ALL_DUPS
setopt HIST_REDUCE_BLANKS
HISTSIZE=1000
SAVEHIST=1000
HISTFILE=~/.zsh_history
eval "$(dircolors -b)"
zstyle ':completion::complete:*' use-cache 1
zstyle ':completion::complete:*' cache-path $ZSH/cache/
zstyle ':completion:*' auto-description 'specify: %d'
zstyle ':completion:*' completer _expand _complete _correct _approximate
zstyle ':completion:*' format "%{$fg[green]%}Completing %d:%{$reset_color%}"
zstyle ':completion:*' group-name ''
zstyle ':completion:*' menu select=2
zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
zstyle ':completion:*' list-colors ''
zstyle ':completion:*' list-prompt %SAt %p: Hit TAB for more, or the character to insert%s
zstyle ':completion:*' matcher-list '' 'm:{a-z}={A-Z}' 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=* l:|=*'
zstyle ':completion:*' menu select=long
zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s
zstyle ':completion:*' use-compctl false
zstyle ':completion:*' verbose true
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31'
zstyle ':completion:*:kill:*' command 'ps -u $USER -o pid,%cpu,tty,cputime,cmd'
# Git right prompt
parse_git_branch() {
(command git symbolic-ref -q HEAD || command git name-rev --name-only --no-undefined --always HEAD) 2>/dev/null
}
git_custom_status() {
local git_where="$(parse_git_branch)"
if [ -n "$git_where" ]; then
if [[ -n $(git status --porcelain 2>/dev/null) ]]; then
GIT_COLOR="%{$fg[red]%}"
else
GIT_COLOR="%{$fg[green]%}"
fi
echo "$GIT_COLOR${git_where#(refs/heads/|tags/)}%{$reset_color%}"
fi
}
RPROMPT='$(git_custom_status)'
@vlad-shatskyi

This comment has been minimized.

Copy link
Owner Author

@vlad-shatskyi vlad-shatskyi commented Jan 23, 2013

Screenshot:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment