├── .gitignore ├── themes ├── evan.zsh-theme ├── imajes.zsh-theme ├── example.zsh-theme ├── cypher.zsh-theme ├── geoffgarside.zsh-theme ├── risto.zsh-theme ├── maran.zsh-theme ├── garyblessington.zsh-theme ├── macovsky.zsh-theme ├── gallifrey.zsh-theme ├── robbyrussell.zsh-theme ├── wezm.zsh-theme ├── xiong-chiamiov.zsh-theme ├── poem.zsh-theme ├── xiong-chiamiov-plus.zsh-theme ├── funky.zsh-theme ├── darkblood.zsh-theme ├── jnrowe.zsh-theme ├── tonotdo.zsh-theme └── clean.zsh-theme ├── lib ├── grep.zsh ├── correction.zsh ├── misc.zsh ├── history.zsh ├── termsupport.zsh ├── directories.zsh ├── git.zsh ├── rake_completion.zsh ├── appearance.zsh ├── key-bindings.zsh ├── aliases.zsh ├── completion.zsh └── functions.zsh ├── custom └── example.zsh ├── log └── .easter-egg ├── tools ├── upgrade.sh ├── uninstall.sh ├── check_for_upgrade.sh └── install.sh ├── oh-my-zsh.sh ├── templates └── zshrc.zsh-template ├── functions └── _brew └── README.textile /.gitignore: -------------------------------------------------------------------------------- 1 | locals.zsh 2 | log/.zsh_history 3 | projects.zsh 4 | custom/*.zsh 5 | !custom/example.zsh -------------------------------------------------------------------------------- /themes/evan.zsh-theme: -------------------------------------------------------------------------------- 1 | # Evan describes this sexy prompt as: "a skinny, topless prompt" 2 | PROMPT='%m :: %2~ %B»%b ' -------------------------------------------------------------------------------- /themes/imajes.zsh-theme: -------------------------------------------------------------------------------- 1 | # Found on the ZshWiki 2 | # http://zshwiki.org/home/config/prompt 3 | # 4 | 5 | PROMPT="%{$fg[red]%}%%%{$reset_color%} " -------------------------------------------------------------------------------- /lib/grep.zsh: -------------------------------------------------------------------------------- 1 | # 2 | # Color grep results 3 | # Examples: http://rubyurl.com/ZXv 4 | # 5 | export GREP_OPTIONS='--color=auto' 6 | export GREP_COLOR='1;32' -------------------------------------------------------------------------------- /custom/example.zsh: -------------------------------------------------------------------------------- 1 | # Add yourself some shortcuts to projects you often work on 2 | # Example: 3 | # 4 | # brainstormr=/Users/robbyrussell/Projects/development/planetargon/brainstormr 5 | # -------------------------------------------------------------------------------- /log/.easter-egg: -------------------------------------------------------------------------------- 1 | This file is only here so that Git will keep a log directory as .gitignore is ignoring all the log files within it. 2 | 3 | feel free to add love notes for people here. 4 | 5 | -------------------------------------------------------------------------------- /themes/example.zsh-theme: -------------------------------------------------------------------------------- 1 | # Found on the ZshWiki 2 | # http://zshwiki.org/home/config/prompt 3 | # 4 | 5 | PROMPT="%{$fg[red]%}%n%{$reset_color%}@%{$fg[blue]%}%m %{$fg[yellow]%}%~ %{$reset_color%}%% " -------------------------------------------------------------------------------- /lib/correction.zsh: -------------------------------------------------------------------------------- 1 | setopt correct_all 2 | 3 | alias man='nocorrect man' 4 | alias mv='nocorrect mv' 5 | alias mysql='nocorrect mysql' 6 | alias mkdir='nocorrect mkdir' 7 | alias gist='nocorrect gist' 8 | alias heroku='nocorrect heroku' 9 | -------------------------------------------------------------------------------- /tools/upgrade.sh: -------------------------------------------------------------------------------- 1 | current_path=`pwd` 2 | echo "Upgrading Oh My Zsh" 3 | ( cd $ZSH && git pull origin master ) 4 | echo "Hooray! Oh My Zsh has been updated and/or is at the current version. \nAny new updates will be reflected when you start your next terminal session." 5 | cd $current_path -------------------------------------------------------------------------------- /themes/cypher.zsh-theme: -------------------------------------------------------------------------------- 1 | # Based on evan's prompt 2 | # Shows the exit status of the last command if non-zero 3 | # Uses "#" instead of "»" when running with elevated privileges 4 | PROMPT="%m %{${fg_bold[red]}%}:: %{${fg[green]}%}%3~%(0?. . ${fg[red]}%? )%{${fg[blue]}%}»%{${reset_color}%} " 5 | -------------------------------------------------------------------------------- /lib/misc.zsh: -------------------------------------------------------------------------------- 1 | ## smart urls 2 | autoload -U url-quote-magic 3 | zle -N self-insert url-quote-magic 4 | 5 | ## file rename magick 6 | bindkey "^[m" copy-prev-shell-word 7 | 8 | ## jobs 9 | setopt long_list_jobs 10 | 11 | ## pager 12 | export PAGER=less 13 | export LC_CTYPE=en_US.UTF-8 14 | -------------------------------------------------------------------------------- /themes/geoffgarside.zsh-theme: -------------------------------------------------------------------------------- 1 | # PROMPT="[%*] %n:%c $(git_prompt_info)%(!.#.$) " 2 | PROMPT='[%*] %{$fg[cyan]%}%n%{$reset_color%}:%{$fg[green]%}%c%{$reset_color%}$(git_prompt_info) %(!.#.$) ' 3 | 4 | ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[yellow]%}git:(" 5 | ZSH_THEME_GIT_PROMPT_SUFFIX=")%{$reset_color%}" 6 | -------------------------------------------------------------------------------- /themes/risto.zsh-theme: -------------------------------------------------------------------------------- 1 | # -*- sh -*- vim:set ft=sh ai et sw=4 sts=4: 2 | # It might be bash like, but I can't have my co-workers knowing I use zsh 3 | PROMPT='%{$fg[green]%}%n@%m:%{$fg_bold[blue]%}%2~ $(git_prompt_info)%{$reset_color%}%(!.#.$) ' 4 | 5 | ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[red]%}‹" 6 | ZSH_THEME_GIT_PROMPT_SUFFIX="›%{$reset_color%}" 7 | -------------------------------------------------------------------------------- /themes/maran.zsh-theme: -------------------------------------------------------------------------------- 1 | # Theme with full path names and hostname 2 | # Handy if you work on different servers all the time; 3 | PROMPT='%{$fg[cyan]%}%n%{$reset_color%}@%{$fg[yellow]%}%M:%{$fg[green]%}%/%{$reset_color%} $(git_prompt_info) %(!.#.$) ' 4 | 5 | ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[cyan]%}git:(" 6 | ZSH_THEME_GIT_PROMPT_SUFFIX=")%{$reset_color%}" 7 | -------------------------------------------------------------------------------- /themes/garyblessington.zsh-theme: -------------------------------------------------------------------------------- 1 | PROMPT='%{$fg[cyan]%}%c%{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%}% %{$reset_color%}: ' 2 | 3 | ZSH_THEME_GIT_PROMPT_PREFIX="(%{$fg[blue]%}" 4 | ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" 5 | ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[red]%}✗%{$reset_color%}" 6 | ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})" 7 | -------------------------------------------------------------------------------- /lib/history.zsh: -------------------------------------------------------------------------------- 1 | ## Command history configuration 2 | HISTFILE=$HOME/.zsh_history 3 | HISTSIZE=10000 4 | SAVEHIST=10000 5 | 6 | setopt hist_ignore_dups # ignore duplication command history list 7 | setopt share_history # share command history data 8 | 9 | setopt hist_verify 10 | setopt inc_append_history 11 | setopt extended_history 12 | setopt hist_expire_dups_first 13 | -------------------------------------------------------------------------------- /themes/macovsky.zsh-theme: -------------------------------------------------------------------------------- 1 | # ZSH Theme - Preview: http://gyazo.com/8becc8a7ed5ab54a0262a470555c3eed.png 2 | local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" 3 | 4 | PROMPT='%{$fg[green]%}%~%{$reset_color%} $(git_prompt_info)%{$reset_color%}%B$%b ' 5 | RPS1="${return_code}" 6 | 7 | ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}‹" 8 | ZSH_THEME_GIT_PROMPT_SUFFIX="› %{$reset_color%}" -------------------------------------------------------------------------------- /themes/gallifrey.zsh-theme: -------------------------------------------------------------------------------- 1 | # ZSH Theme - Preview: http://img.skitch.com/20091113-qqtd3j8xinysujg5ugrsbr7x1y.jpg 2 | local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" 3 | 4 | PROMPT='%{$fg[green]%}%m%{$reset_color%} %2~ $(git_prompt_info)%{$reset_color%}%B»%b ' 5 | RPS1="${return_code}" 6 | 7 | ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}‹" 8 | ZSH_THEME_GIT_PROMPT_SUFFIX="› %{$reset_color%}" 9 | -------------------------------------------------------------------------------- /themes/robbyrussell.zsh-theme: -------------------------------------------------------------------------------- 1 | PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}' 2 | 3 | ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$fg[red]%}" 4 | ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" 5 | ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗%{$reset_color%}" 6 | ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})" 7 | -------------------------------------------------------------------------------- /themes/wezm.zsh-theme: -------------------------------------------------------------------------------- 1 | PROMPT='$(git_prompt_info)%(?,,%{${fg_bold[white]}%}[%?]%{$reset_color%} )%{$fg[yellow]%}%#%{$reset_color%} ' 2 | RPROMPT='%{$fg[green]%}%~%{$reset_color%}' 3 | 4 | ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[blue]%}(" 5 | ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} " 6 | ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%})%{$fg[red]%}⚡%{$reset_color%}" 7 | ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})" 8 | -------------------------------------------------------------------------------- /lib/termsupport.zsh: -------------------------------------------------------------------------------- 1 | case "$TERM" in 2 | xterm*|rxvt*) 3 | preexec () { 4 | print -Pn "\e]0;%n@%m: $1\a" # xterm 5 | } 6 | precmd () { 7 | print -Pn "\e]0;%n@%m: %~\a" # xterm 8 | } 9 | ;; 10 | screen*) 11 | preexec () { 12 | local CMD=${1[(wr)^(*=*|sudo|ssh|-*)]} 13 | echo -ne "\ek$CMD\e\\" 14 | print -Pn "\e]0;%n@%m: $1\a" # xterm 15 | } 16 | precmd () { 17 | echo -ne "\ekzsh\e\\" 18 | print -Pn "\e]0;%n@%m: %~\a" # xterm 19 | } 20 | ;; 21 | esac -------------------------------------------------------------------------------- /tools/uninstall.sh: -------------------------------------------------------------------------------- 1 | echo "Removing ~/.oh-my-zsh" 2 | if [[ -d ~/.oh-my-zsh ]] 3 | then 4 | rm -rf ~/.oh-my-zsh 5 | fi 6 | 7 | echo "Looking for an existing zsh config..." 8 | if [ -f ~/.zshrc.pre-oh-my-zsh ] || [ -h ~/.zshrc.pre-oh-my-zsh ] 9 | then 10 | echo "Found ~/.zshrc. Backing up to ~/.zshrc.pre-oh-my-zsh"; 11 | rm ~/.zshrc; 12 | cp ~/.zshrc.pre-oh-my-zsh ~/.zshrc; 13 | source ~/.zshrc; 14 | else 15 | echo "Switching back to bash" 16 | chsh -s /bin/bash 17 | source /etc/profile 18 | fi 19 | 20 | echo "Thanks for trying out Oh My Zsh. It's been uninstalled." -------------------------------------------------------------------------------- /themes/xiong-chiamiov.zsh-theme: -------------------------------------------------------------------------------- 1 | # user, host, full path, and time/date 2 | # on two lines for easier vgrepping 3 | # entry in a nice long thread on the Arch Linux forums: http://bbs.archlinux.org/viewtopic.php?pid=521888#p521888 4 | PROMPT=$'%{\e[0;34m%}%B┌─[%b%{\e[0m%}%{\e[1;32m%}%n%{\e[1;30m%}@%{\e[0m%}%{\e[0;36m%}%m%{\e[0;34m%}%B]%b%{\e[0m%} - %b%{\e[0;34m%}%B[%b%{\e[1;37m%}%~%{\e[0;34m%}%B]%b%{\e[0m%} - %{\e[0;34m%}%B[%b%{\e[0;33m%}'%D{"%a %b %d, %I:%M"}%b$'%{\e[0;34m%}%B]%b%{\e[0m%} 5 | %{\e[0;34m%}%B└─%B[%{\e[1;35m%}$%{\e[0;34m%}%B]>%{\e[0m%}%b ' 6 | PS2=$' \e[0;34m%}%B>%{\e[0m%}%b ' 7 | -------------------------------------------------------------------------------- /oh-my-zsh.sh: -------------------------------------------------------------------------------- 1 | # Initializes Oh My Zsh 2 | 3 | # add a function path 4 | fpath=($ZSH/functions $fpath) 5 | 6 | # Load all of the config files in ~/oh-my-zsh that end in .zsh 7 | # TIP: Add files you don't want in git to .gitignore 8 | for config_file ($ZSH/lib/*.zsh) source $config_file 9 | 10 | # Load all of your custom configurations from custom/ 11 | for config_file ($ZSH/custom/*.zsh) source $config_file 12 | 13 | # Check for updates on initial load... 14 | if [ "$DISABLE_AUTO_UPDATE" = "true" ] 15 | then 16 | return 17 | else 18 | /usr/bin/env zsh $ZSH/tools/check_for_upgrade.sh 19 | fi 20 | -------------------------------------------------------------------------------- /templates/zshrc.zsh-template: -------------------------------------------------------------------------------- 1 | # Path to your oh-my-zsh configuration. 2 | export ZSH=$HOME/.oh-my-zsh 3 | 4 | # Set to the name theme to load. 5 | # Look in ~/.oh-my-zsh/themes/ 6 | export ZSH_THEME="robbyrussell" 7 | 8 | # Set to this to use case-sensitive completion 9 | # export CASE_SENSITIVE="true" 10 | 11 | # Comment this out to disable weekly auto-update checks 12 | # export DISABLE_AUTO_UPDATE="true" 13 | 14 | # Uncomment following line if you want to disable colors in ls 15 | # export DISABLE_LS_COLORS="true" 16 | 17 | source $ZSH/oh-my-zsh.sh 18 | 19 | # Customize to your needs... 20 | -------------------------------------------------------------------------------- /themes/poem.zsh-theme: -------------------------------------------------------------------------------- 1 | 2 | function collapse_pwd { 3 | echo $(pwd | sed -e "s,^$HOME,~,") 4 | } 5 | 6 | function prompt_char { 7 | git branch >/dev/null 2>/dev/null && echo '±' && return 8 | echo '○' 9 | } 10 | 11 | PROMPT=' 12 | %{$fg[magenta]%}%n%{$reset_color%} at %{$fg[yellow]%}%m%{$reset_color%} in %{$fg_bold[green]%}$(collapse_pwd)%{$reset_color%}$(git_prompt_info) 13 | $(prompt_char) ' 14 | 15 | ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[magenta]%}" 16 | ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" 17 | ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%}!" 18 | ZSH_THEME_GIT_PROMPT_CLEAN="" 19 | -------------------------------------------------------------------------------- /themes/xiong-chiamiov-plus.zsh-theme: -------------------------------------------------------------------------------- 1 | # user, host, full path, and time/date 2 | # on two lines for easier vgrepping 3 | # entry in a nice long thread on the Arch Linux forums: http://bbs.archlinux.org/viewtopic.php?pid=521888#p521888 4 | PROMPT=$'%{\e[0;34m%}%B┌─[%b%{\e[0m%}%{\e[1;32m%}%n%{\e[1;30m%}@%{\e[0m%}%{\e[0;36m%}%m%{\e[0;34m%}%B]%b%{\e[0m%} - %b%{\e[0;34m%}%B[%b%{\e[1;37m%}%~%{\e[0;34m%}%B]%b%{\e[0m%} - %{\e[0;34m%}%B[%b%{\e[0;33m%}'%D{"%a %b %d, %I:%M"}%b$'%{\e[0;34m%}%B]%b%{\e[0m%} 5 | %{\e[0;34m%}%B└─%B[%{\e[1;35m%}$%{\e[0;34m%}%B] <$(git_prompt_info)>%{\e[0m%}%b ' 6 | PS2=$' \e[0;34m%}%B>%{\e[0m%}%b ' 7 | -------------------------------------------------------------------------------- /themes/funky.zsh-theme: -------------------------------------------------------------------------------- 1 | # Taken from Tassilo's Blog 2 | # http://tsdh.wordpress.com/2007/12/06/my-funky-zsh-prompt/ 3 | 4 | local blue_op="%{$fg[blue]%}[%{$reset_color%}" 5 | local blue_cp="%{$fg[blue]%}]%{$reset_color%}" 6 | local path_p="${blue_op}%~${blue_cp}" 7 | local user_host="${blue_op}%n@%m${blue_cp}" 8 | local ret_status="${blue_op}%?${blue_cp}" 9 | local hist_no="${blue_op}%h${blue_cp}" 10 | local smiley="%(?,%{$fg[green]%}:%)%{$reset_color%},%{$fg[red]%}:(%{$reset_color%})" 11 | PROMPT="╭─${path_p}─${user_host}─${ret_status}─${hist_no} 12 | ╰─${blue_op}${smiley}${blue_cp} %# " 13 | local cur_cmd="${blue_op}%_${blue_cp}" 14 | PROMPT2="${cur_cmd}> " -------------------------------------------------------------------------------- /themes/darkblood.zsh-theme: -------------------------------------------------------------------------------- 1 | # meh. Dark Blood Rewind, a new beginning. 2 | 3 | PROMPT=$'%{$fg[red]%}┌[%{$fg_bold[white]%}%n%{$reset_color%}%{$fg[red]%}@%{$fg_bold[white]%}%m%{$reset_color%}%{$fg[red]%}] [%{$fg_bold[white]%}/dev/%y%{$reset_color%}%{$fg[red]%}] %{$(git_prompt_info)%}%(?,,%{$fg[red]%}[%{$fg_bold[white]%}%?%{$reset_color%}%{$fg[red]%}]) 4 | %{$fg[red]%}└[%{$fg_bold[white]%}%~%{$reset_color%}%{$fg[red]%}]>%{$reset_color%} ' 5 | PS2=$' %{$fg[red]%}|>%{$reset_color%} ' 6 | 7 | ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[red]%}[%{$fg_bold[white]%}" 8 | ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}%{$fg[red]%}] " 9 | ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}⚡%{$reset_color%}" 10 | -------------------------------------------------------------------------------- /tools/check_for_upgrade.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | function _current_epoch() { 4 | echo $(($(date +%s) / 60 / 60 / 24)) 5 | } 6 | 7 | function _update_zsh_update() { 8 | echo "LAST_EPOCH=$(_current_epoch)" > ~/.zsh-update 9 | } 10 | 11 | if [ -f ~/.zsh-update ] 12 | then 13 | . ~/.zsh-update 14 | 15 | if [[ -z "$LAST_EPOCH" ]]; then 16 | _update_zsh_update && return 0; 17 | fi 18 | 19 | epoch_diff=$((${_current_epoch} - $LAST_EPOCH)) 20 | if [ $epoch_diff -gt 6 ] 21 | then 22 | echo "[Oh My Zsh] Would you like to check for updates?" 23 | echo "Type Y to update oh-my-zsh: \c" 24 | read line 25 | if [ "$line" = Y ] || [ "$line" = y ] 26 | then 27 | /bin/sh $ZSH/tools/upgrade.sh 28 | fi 29 | fi 30 | fi 31 | 32 | # update the zsh file 33 | _update_zsh_update 34 | 35 | -------------------------------------------------------------------------------- /lib/directories.zsh: -------------------------------------------------------------------------------- 1 | # Changing/making/removing directory 2 | setopt auto_name_dirs 3 | setopt auto_pushd 4 | setopt pushd_ignore_dups 5 | 6 | alias ..='cd ..' 7 | alias cd..='cd ..' 8 | alias cd...='cd ../..' 9 | alias cd....='cd ../../..' 10 | alias cd.....='cd ../../../..' 11 | alias cd/='cd /' 12 | 13 | alias 1='cd -' 14 | alias 2='cd +2' 15 | alias 3='cd +3' 16 | alias 4='cd +4' 17 | alias 5='cd +5' 18 | alias 6='cd +6' 19 | alias 7='cd +7' 20 | alias 8='cd +8' 21 | alias 9='cd +9' 22 | 23 | cd () { 24 | if [[ "x$*" == "x..." ]]; then 25 | cd ../.. 26 | elif [[ "x$*" == "x...." ]]; then 27 | cd ../../.. 28 | elif [[ "x$*" == "x....." ]]; then 29 | cd ../../.. 30 | elif [[ "x$*" == "x......" ]]; then 31 | cd ../../../.. 32 | else 33 | builtin cd "$@" 34 | fi 35 | } 36 | 37 | alias md='mkdir -p' 38 | alias rd=rmdir 39 | 40 | alias d='dirs -v' -------------------------------------------------------------------------------- /tools/install.sh: -------------------------------------------------------------------------------- 1 | if [ -d ~/.oh-my-zsh ] 2 | then 3 | echo "You already have Oh My Zsh installed. You'll need to remove ~/.oh-my-zsh if you want to install" 4 | exit 5 | fi 6 | 7 | echo "Cloning Oh My Zsh..." 8 | /usr/bin/env git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh 9 | 10 | echo "Looking for an existing zsh config..." 11 | if [ -f ~/.zshrc ] || [ -h ~/.zshrc ] 12 | then 13 | echo "Found ~/.zshrc. Backing up to ~/.zshrc.pre-oh-my-zsh"; 14 | cp ~/.zshrc ~/.zshrc.pre-oh-my-zsh; 15 | rm ~/.zshrc; 16 | fi 17 | 18 | echo "Using the Oh My Zsh template file and adding it to ~/.zshrc" 19 | cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc 20 | 21 | echo "Copying your current PATH and adding it to the end of ~/.zshrc for you." 22 | echo "export PATH=$PATH" >> ~/.zshrc 23 | 24 | echo "Time to change your default shell to zsh!" 25 | chsh -s /bin/zsh 26 | 27 | echo "Hooray! Oh My Zsh has been installed." 28 | /bin/zsh 29 | source ~/.zshrc 30 | -------------------------------------------------------------------------------- /themes/jnrowe.zsh-theme: -------------------------------------------------------------------------------- 1 | autoload -U add-zsh-hook 2 | autoload -Uz vcs_info 3 | 4 | zstyle ':vcs_info:*' actionformats \ 5 | '%F{5}(%f%s%F{5})%F{3}-%F{5}[%F{2}%b%F{3}|%F{1}%a%F{5}]%f ' 6 | zstyle ':vcs_info:*' formats \ 7 | '%F{2}%s%F{7}:%F{2}(%F{1}%b%F{2})%f ' 8 | zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r' 9 | zstyle ':vcs_info:*' enable git 10 | 11 | add-zsh-hook precmd prompt_jnrowe_precmd 12 | 13 | prompt_jnrowe_precmd () { 14 | vcs_info 15 | 16 | if [ "${vcs_info_msg_0_}" = "" ]; then 17 | dir_status="%F{2}→%f" 18 | elif [[ $(git diff --cached --name-status 2>/dev/null ) != "" ]]; then 19 | dir_status="%F{1}▶%f" 20 | elif [[ $(git diff --name-status 2>/dev/null ) != "" ]]; then 21 | dir_status="%F{3}▶%f" 22 | else 23 | dir_status="%F{2}▶%f" 24 | fi 25 | } 26 | 27 | local ret_status="%(?:%{$fg_bold[green]%}Ξ:%{$fg_bold[red]%}%S↑%s%?)" 28 | 29 | PROMPT='${ret_status}%{$fg_bold[green]%}%p %{$fg_bold[yellow]%}%2~ ${vcs_info_msg_0_}${dir_status}%{$reset_color%} ' 30 | 31 | # vim: set ft=zsh ts=4 sw=4 et: 32 | -------------------------------------------------------------------------------- /lib/git.zsh: -------------------------------------------------------------------------------- 1 | # get the name of the branch we are on 2 | function git_prompt_info() { 3 | ref=$(git symbolic-ref HEAD 2> /dev/null) || return 4 | echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_SUFFIX" 5 | } 6 | 7 | parse_git_dirty () { 8 | if [[ $((git status 2> /dev/null) | tail -n1) != "nothing to commit (working directory clean)" ]]; then 9 | echo "$ZSH_THEME_GIT_PROMPT_DIRTY" 10 | else 11 | echo "$ZSH_THEME_GIT_PROMPT_CLEAN" 12 | fi 13 | } 14 | 15 | # 16 | # Will return the current branch name 17 | # Usage example: git pull origin $(current_branch) 18 | # 19 | function current_branch() { 20 | ref=$(git symbolic-ref HEAD 2> /dev/null) || return 21 | echo ${ref#refs/heads/} 22 | } 23 | 24 | # Aliases 25 | alias g='git' 26 | alias gst='git status' 27 | alias gl='git pull' 28 | alias gup='git fetch && git rebase' 29 | alias gp='git push' 30 | alias gd='git diff | mate' 31 | alias gdv='git diff -w "$@" | vim -R -' 32 | alias gc='git commit -v' 33 | alias gca='git commit -v -a' 34 | alias gb='git branch' 35 | alias gba='git branch -a' 36 | alias gcount='git shortlog -sn' 37 | alias gcp='git cherry-pick' 38 | -------------------------------------------------------------------------------- /lib/rake_completion.zsh: -------------------------------------------------------------------------------- 1 | _rake_does_task_list_need_generating () { 2 | if [ ! -f .rake_tasks~ ]; then return 0; 3 | else 4 | accurate=$(stat -f%m .rake_tasks~) 5 | changed=$(stat -f%m Rakefile) 6 | return $(expr $accurate '>=' $changed) 7 | fi 8 | } 9 | 10 | _rake () { 11 | if [ -f Rakefile ]; then 12 | if _rake_does_task_list_need_generating; then 13 | echo "\nGenerating .rake_tasks~..." > /dev/stderr 14 | rake --silent --tasks | cut -d " " -f 2 > .rake_tasks~ 15 | fi 16 | compadd `cat .rake_tasks~` 17 | fi 18 | } 19 | 20 | compctl -K _rake rake 21 | 22 | function _cap_does_task_list_need_generating () { 23 | if [ ! -f .cap_tasks~ ]; then return 0; 24 | else 25 | accurate=$(stat -f%m .cap_tasks~) 26 | changed=$(stat -f%m config/deploy.rb) 27 | return $(expr $accurate '>=' $changed) 28 | fi 29 | } 30 | 31 | function _cap () { 32 | if [ -f config/deploy.rb ]; then 33 | if _cap_does_task_list_need_generating; then 34 | echo "\nGenerating .cap_tasks~..." > /dev/stderr 35 | cap show_tasks -q | cut -d " " -f 1 | sed -e '/^ *$/D' -e '1,2D' 36 | > .cap_tasks~ 37 | fi 38 | compadd `cat .cap_tasks~` 39 | fi 40 | } 41 | 42 | compctl -K _cap cap 43 | -------------------------------------------------------------------------------- /lib/appearance.zsh: -------------------------------------------------------------------------------- 1 | # ls colors 2 | autoload colors; colors; 3 | export LSCOLORS="Gxfxcxdxbxegedabagacad" 4 | #export LS_COLORS 5 | 6 | # Enable ls colors 7 | if [ "$DISABLE_LS_COLORS" != "true" ] 8 | then 9 | # Find the option for using colors in ls, depending on the version: Linux or BSD 10 | ls --color -d . &>/dev/null 2>&1 && alias ls='ls --color=tty' || alias ls='ls -GF' 11 | fi 12 | 13 | #setopt no_beep 14 | setopt auto_cd 15 | setopt multios 16 | setopt cdablevarS 17 | 18 | if [[ x$WINDOW != x ]] 19 | then 20 | SCREEN_NO="%B$WINDOW%b " 21 | else 22 | SCREEN_NO="" 23 | fi 24 | 25 | # Apply theming defaults 26 | PS1="%n@%m:%~%# " 27 | 28 | # git theming default: Variables for theming the git info prompt 29 | ZSH_THEME_GIT_PROMPT_PREFIX="git:(" # Prefix at the very beginning of the prompt, before the branch name 30 | ZSH_THEME_GIT_PROMPT_SUFFIX=")" # At the very end of the prompt 31 | ZSH_THEME_GIT_PROMPT_DIRTY="*" # Text to display if the branch is dirty 32 | ZSH_THEME_GIT_PROMPT_CLEAN="" # Text to display if the branch is clean 33 | 34 | # Setup the prompt with pretty colors 35 | setopt prompt_subst 36 | 37 | # Load the theme 38 | source "$ZSH/themes/$ZSH_THEME.zsh-theme" 39 | -------------------------------------------------------------------------------- /themes/tonotdo.zsh-theme: -------------------------------------------------------------------------------- 1 | PROMPT='%{$fg_no_bold[cyan]%}%n%{$fg_no_bold[magenta]%}➜%{$fg_no_bold[green]%}%3~$(git_prompt_info)%{$reset_color%}» ' 2 | RPROMPT='[%*]' 3 | 4 | # git theming 5 | ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}(%{$fg_no_bold[red]%}" 6 | ZSH_THEME_GIT_PROMPT_SUFFIX="" 7 | ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg_bold[blue]%})" 8 | ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[yellow]%}✗%{$fg_bold[blue]%})" 9 | 10 | # LS colors, made with http://geoff.greer.fm/lscolors/ 11 | export LSCOLORS="Gxfxcxdxbxegedabagacad" 12 | export LS_COLORS='no=00:fi=00:di=01;34:ln=00;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=41;33;01:ex=00;32:*.cmd=00;32:*.exe=01;32:*.com=01;32:*.bat=01;32:*.btm=01;32:*.dll=01;32:*.tar=00;31:*.tbz=00;31:*.tgz=00;31:*.rpm=00;31:*.deb=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.lzma=00;31:*.zip=00;31:*.zoo=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.tb2=00;31:*.tz2=00;31:*.tbz2=00;31:*.avi=01;35:*.bmp=01;35:*.fli=01;35:*.gif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mng=01;35:*.mov=01;35:*.mpg=01;35:*.pcx=01;35:*.pbm=01;35:*.pgm=01;35:*.png=01;35:*.ppm=01;35:*.tga=01;35:*.tif=01;35:*.xbm=01;35:*.xpm=01;35:*.dl=01;35:*.gl=01;35:*.wmv=01;35:*.aiff=00;32:*.au=00;32:*.mid=00;32:*.mp3=00;32:*.ogg=00;32:*.voc=00;32:*.wav=00;32:' -------------------------------------------------------------------------------- /lib/key-bindings.zsh: -------------------------------------------------------------------------------- 1 | # TODO: Explain what some of this does.. 2 | autoload -U compinit 3 | compinit 4 | 5 | bindkey -e 6 | bindkey '\ew' kill-region 7 | bindkey -s '\el' "ls\n" 8 | bindkey -s '\e.' "..\n" 9 | bindkey '^r' history-incremental-search-backward 10 | bindkey "^[[5~" up-line-or-history 11 | bindkey "^[[6~" down-line-or-history 12 | 13 | # make search up and down work, so partially type and hit up/down to find relevant stuff 14 | bindkey '^[[A' up-line-or-search 15 | bindkey '^[[B' down-line-or-search 16 | 17 | bindkey "^[[H" beginning-of-line 18 | bindkey "^[[1~" beginning-of-line 19 | bindkey "^[[F" end-of-line 20 | bindkey "^[[4~" end-of-line 21 | bindkey ' ' magic-space # also do history expansion on space 22 | 23 | 24 | # consider emacs keybindings: 25 | 26 | #bindkey -e ## emacs key bindings 27 | # 28 | #bindkey '^[[A' up-line-or-search 29 | #bindkey '^[[B' down-line-or-search 30 | #bindkey '^[^[[C' emacs-forward-word 31 | #bindkey '^[^[[D' emacs-backward-word 32 | # 33 | #bindkey -s '^X^Z' '%-^M' 34 | #bindkey '^[e' expand-cmd-path 35 | #bindkey '^[^I' reverse-menu-complete 36 | #bindkey '^X^N' accept-and-infer-next-history 37 | #bindkey '^W' kill-region 38 | #bindkey '^I' complete-word 39 | ## Fix weird sequence that rxvt produces 40 | #bindkey -s '^[[Z' '\t' 41 | # -------------------------------------------------------------------------------- /themes/clean.zsh-theme: -------------------------------------------------------------------------------- 1 | if [ "$(whoami)" = "root" ]; then NCOLOR="red"; else NCOLOR="white"; fi 2 | 3 | PROMPT='%{$fg[$NCOLOR]%}%B%n%b%{$reset_color%}:%{$fg[blue]%}%B%c/%b%{$reset_color%} $(git_prompt_info)%(!.#.$) ' 4 | RPROMPT='[%*]' 5 | 6 | # git theming 7 | ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}(%{$fg_no_bold[yellow]%}%B" 8 | ZSH_THEME_GIT_PROMPT_SUFFIX="%b%{$fg_bold[blue]%})%{$reset_color%} " 9 | ZSH_THEME_GIT_PROMPT_CLEAN="" 10 | ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[red]%}✗" 11 | 12 | # LS colors, made with http://geoff.greer.fm/lscolors/ 13 | export LSCOLORS="Gxfxcxdxbxegedabagacad" 14 | export LS_COLORS='no=00:fi=00:di=01;34:ln=00;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=41;33;01:ex=00;32:*.cmd=00;32:*.exe=01;32:*.com=01;32:*.bat=01;32:*.btm=01;32:*.dll=01;32:*.tar=00;31:*.tbz=00;31:*.tgz=00;31:*.rpm=00;31:*.deb=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.lzma=00;31:*.zip=00;31:*.zoo=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.tb2=00;31:*.tz2=00;31:*.tbz2=00;31:*.avi=01;35:*.bmp=01;35:*.fli=01;35:*.gif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mng=01;35:*.mov=01;35:*.mpg=01;35:*.pcx=01;35:*.pbm=01;35:*.pgm=01;35:*.png=01;35:*.ppm=01;35:*.tga=01;35:*.tif=01;35:*.xbm=01;35:*.xpm=01;35:*.dl=01;35:*.gl=01;35:*.wmv=01;35:*.aiff=00;32:*.au=00;32:*.mid=00;32:*.mp3=00;32:*.ogg=00;32:*.voc=00;32:*.wav=00;32:' 15 | -------------------------------------------------------------------------------- /lib/aliases.zsh: -------------------------------------------------------------------------------- 1 | #!/bin/zsh 2 | 3 | # Push and pop directories on directory stack 4 | alias pu='pushd' 5 | alias po='popd' 6 | 7 | alias ss='thin --stats "/thin/stats" start' 8 | alias sg='ruby script/generate' 9 | alias sd='ruby script/destroy' 10 | alias sp='ruby script/plugin' 11 | alias ssp='ruby script/spec' 12 | alias rdbm='rake db:migrate' 13 | alias sc='ruby script/console' 14 | alias sd='ruby script/server --debugger' 15 | alias devlog='tail -f log/development.log' 16 | 17 | # Basic directory operations 18 | alias .='pwd' 19 | alias ...='cd ../..' 20 | alias -- -='cd -' 21 | 22 | # Super user 23 | alias _='sudo' 24 | alias ss='sudo su -' 25 | 26 | #alias g='grep -in' 27 | 28 | # Show history 29 | alias history='fc -l 1' 30 | 31 | # List direcory contents 32 | alias lsa='ls -lah' 33 | alias l='ls -la' 34 | alias ll='ls -alr' 35 | alias sl=ls # often screw this up 36 | 37 | alias sgem='sudo gem' 38 | 39 | # Find ruby file 40 | alias rfind='find . -name *.rb | xargs grep -n' 41 | alias afind='ack-grep -il' 42 | 43 | # Git and svn mix 44 | alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk' 45 | 46 | # TextMate 47 | alias et='mate . &' 48 | alias ett='mate app config lib db public spec test Rakefile Capfile Todo &' 49 | alias etp='mate app config lib db public spec test vendor/plugins vendor/gems Rakefile Capfile Todo &' 50 | alias etts='mate app config lib db public script spec test vendor/plugins vendor/gems Rakefile Capfile Todo &' 51 | 52 | # Editor Ruby file in TextMate 53 | alias mr='mate CHANGELOG app config db lib public script spec test' 54 | -------------------------------------------------------------------------------- /lib/completion.zsh: -------------------------------------------------------------------------------- 1 | ## fixme - the load process here seems a bit bizarre 2 | 3 | setopt noautomenu 4 | setopt complete_in_word 5 | setopt always_to_end 6 | 7 | unsetopt flowcontrol 8 | 9 | WORDCHARS='' 10 | 11 | autoload -U compinit 12 | compinit 13 | 14 | zmodload -i zsh/complist 15 | 16 | ## case-insensitive (all),partial-word and then substring completion 17 | if [ "x$CASE_SENSITIVE" = "xtrue" ]; then 18 | zstyle ':completion:*' matcher-list 'r:|[._-]=* r:|=*' 'l:|=* r:|=*' 19 | unset CASE_SENSITIVE 20 | else 21 | zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*' 22 | fi 23 | 24 | zstyle ':completion:*' list-colors '' 25 | 26 | 27 | unsetopt MENU_COMPLETE 28 | #setopt AUTO_MENU 29 | 30 | # should this be in keybindings? 31 | bindkey -M menuselect '^o' accept-and-infer-next-history 32 | 33 | zstyle ':completion:*:*:*:*:*' menu yes select 34 | # zstyle ':completion:*:*:*:*:processes' force-list always 35 | 36 | zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;34=0=01' 37 | zstyle ':completion:*:*:*:*:processes' command "ps -u `whoami` -o pid,user,comm -w -w" 38 | 39 | # Load known hosts file for auto-completion with ssh and scp commands 40 | if [ -f ~/.ssh/known_hosts ]; then 41 | zstyle ':completion:*' hosts $( sed 's/[, ].*$//' $HOME/.ssh/known_hosts ) 42 | zstyle ':completion:*:*:(ssh|scp):*:*' hosts `sed 's/^\([^ ,]*\).*$/\1/' ~/.ssh/known_hosts` 43 | fi 44 | 45 | # Complete on history 46 | #zstyle ':completion:*:history-words' stop yes 47 | #zstyle ':completion:*:history-words' remove-all-dups yes 48 | #zstyle ':completion:*:history-words' list false 49 | #zstyle ':completion:*:history-words' menu yes 50 | -------------------------------------------------------------------------------- /functions/_brew: -------------------------------------------------------------------------------- 1 | #compdef brew 2 | 3 | # copied from _fink 4 | 5 | _brew_all_formulae() { 6 | formulae=(`brew search`) 7 | } 8 | 9 | _brew_installed_formulae() { 10 | installed_formulae=(`brew list`) 11 | } 12 | 13 | local -a _1st_arguments 14 | _1st_arguments=( 15 | 'install:install a formula' 16 | 'remove:remove a formula' 17 | 'search:search for a formula (/regex/ or string)' 18 | 'list:list files in a formula or not-installed formulae' 19 | 'link:link a formula' 20 | 'unlink:unlink a formula' 21 | 'home:visit the homepage of a formula or the brew project' 22 | 'info:information about a formula' 23 | 'prune:remove dead links' 24 | 'update:freshen up links' 25 | 'log:git commit log for a formula' 26 | 'create:create a new formula' 27 | 'edit:edit a formula' 28 | ) 29 | 30 | local expl 31 | local -a formula installed_formulae 32 | 33 | _arguments \ 34 | '(-v --verbose)'{-v,--verbose}'[verbose]' \ 35 | '(--version)--version[version information]' \ 36 | '(--prefix)--prefix[where brew lives on this system]' \ 37 | '(--cache)--cache[brew cache]' \ 38 | '*:: :->subcmds' && return 0 39 | 40 | if (( CURRENT == 1 )); then 41 | _describe -t commands "brew subcommand" _1st_arguments 42 | return 43 | fi 44 | 45 | case "$words[1]" in 46 | list) 47 | _arguments \ 48 | '(--unbrewed)--unbrewed[files in brew --prefix not controlled by brew]' \ 49 | '1: :->forms' && return 0 50 | 51 | if [[ "$state" == forms ]]; then 52 | _brew_installed_formulae 53 | _requested installed_formulae expl 'installed formulae' compadd -a installed_formulae 54 | fi ;; 55 | install|home|log|info) 56 | _brew_all_formulae 57 | _wanted formulae expl 'all formulae' compadd -a formulae ;; 58 | remove|edit|xo) 59 | _brew_installed_formulae 60 | _wanted installed_formulae expl 'installed formulae' compadd -a installed_formulae ;; 61 | esac 62 | -------------------------------------------------------------------------------- /lib/functions.zsh: -------------------------------------------------------------------------------- 1 | ## fixme, i duplicated this in xterms - oops 2 | function title { 3 | if [[ $TERM == "screen" ]]; then 4 | # Use these two for GNU Screen: 5 | print -nR $'\033k'$1$'\033'\\\ 6 | 7 | print -nR $'\033]0;'$2$'\a' 8 | elif [[ $TERM == "xterm" || $TERM == "rxvt" ]]; then 9 | # Use this one instead for XTerms: 10 | print -nR $'\033]0;'$*$'\a' 11 | fi 12 | } 13 | 14 | function precmd { 15 | title zsh "$PWD" 16 | } 17 | 18 | function preexec { 19 | emulate -L zsh 20 | local -a cmd; cmd=(${(z)1}) 21 | title $cmd[1]:t "$cmd[2,-1]" 22 | } 23 | 24 | function remote_console() { 25 | /usr/bin/env ssh $1 "( cd $2 && ruby script/console production )" 26 | } 27 | 28 | function zsh_stats() { 29 | history | awk '{print $2}' | sort | uniq -c | sort -rn | head 30 | } 31 | 32 | function uninstall_oh_my_zsh() { 33 | /bin/sh $ZSH/tools/uninstall.sh 34 | } 35 | 36 | function upgrade_oh_my_zsh() { 37 | /bin/sh $ZSH/tools/upgrade.sh 38 | } 39 | 40 | function tab() { 41 | osascript 2>/dev/null <