├── plugins ├── brew │ └── brew.plugin.zsh ├── npm │ └── npm.plugin.zsh ├── osx │ └── _man-preview ├── themes │ ├── _theme │ └── themes.plugin.zsh ├── cloudapp │ ├── cloudapp.plugin.zsh │ └── cloudapp.rb ├── thor │ └── _thor ├── laravel │ ├── laravel.plugin.zsh │ └── _artisan ├── powder │ └── _powder ├── nyan │ └── nyan.plugin.zsh ├── wakeonlan │ ├── _wake │ ├── wakeonlan.plugin.zsh │ └── README ├── history │ └── history.plugin.zsh ├── encode64 │ └── encode64.plugin.zsh ├── colemak │ ├── colemak-less │ └── colemak.plugin.zsh ├── kate │ └── kate.plugin.zsh ├── jruby │ └── jruby.plugin.zsh ├── fasd │ └── fasd.plugin.zsh ├── supervisor │ ├── supervisor.plugin.zsh │ └── _supervisord ├── ruby │ └── ruby.plugin.zsh ├── node │ └── node.plugin.zsh ├── gitfast │ ├── gitfast.plugin.zsh │ └── _git ├── rsync │ └── rsync.plugin.zsh ├── extract │ ├── _extract │ └── extract.plugin.zsh ├── suse │ └── suse.plugin.zsh ├── command-not-found │ └── command-not-found.plugin.zsh ├── macports │ ├── macports.plugin.zsh │ └── _port ├── history-substring-search │ ├── README │ └── history-substring-search.plugin.zsh ├── nanoc │ ├── nanoc.plugin.zsh │ └── _nanoc ├── rake │ └── rake.plugin.zsh ├── capistrano │ └── _capistrano ├── stv │ └── stv.plugin.zsh ├── symfony │ └── symfony.plugin.zsh ├── python │ └── python.plugin.zsh ├── mysql-macports │ └── mysql-macports.plugin.zsh ├── bwana │ └── bwana.plugin.zsh ├── apache2-macports │ └── apache2-macports.plugin.zsh ├── dircycle │ └── dircycle.plugin.zsh ├── systemd │ └── systemd.plugin.zsh ├── symfony2 │ └── symfony2.plugin.zsh ├── textmate │ └── textmate.plugin.zsh ├── mercurial │ └── mercurial.plugin.zsh ├── phing │ └── phing.plugin.zsh ├── jake-node │ └── jake-node.plugin.zsh ├── cp │ └── cp.plugin.zsh ├── lighthouse │ └── lighthouse.plugin.zsh ├── rails │ └── rails.plugin.zsh ├── git-remote-branch │ └── git-remote-branch.plugin.zsh ├── vundle │ └── vundle.plugin.zsh ├── gpg-agent │ └── gpg-agent.plugin.zsh ├── ant │ └── ant.plugin.zsh ├── compleat │ └── compleat.plugin.zsh ├── sublime │ └── sublime.plugin.zsh ├── rails3 │ └── rails3.plugin.zsh ├── autojump │ └── autojump.plugin.zsh ├── lol │ └── lol.plugin.zsh ├── last-working-dir │ └── last-working-dir.plugin.zsh ├── yum │ └── yum.plugin.zsh ├── taskwarrior │ └── taskwarrior.plugin.zsh ├── cake │ └── cake.plugin.zsh ├── gas │ └── _gas ├── composer │ └── composer.plugin.zsh ├── vi-mode │ └── vi-mode.plugin.zsh ├── pj │ └── pj.plugin.zsh ├── terminitor │ └── _terminitor ├── jira │ └── jira.plugin.zsh ├── bundler │ └── bundler.plugin.zsh ├── zeus │ ├── README.md │ └── zeus.plugin.zsh ├── dirpersist │ └── dirpersist.plugin.zsh ├── forklift │ └── forklift.plugin.zsh ├── rvm │ └── rvm.plugin.zsh ├── github │ ├── _github │ └── github.plugin.zsh ├── terminalapp │ └── terminalapp.plugin.zsh ├── grails │ └── grails.plugin.zsh ├── rbfu │ └── rbfu.plugin.zsh ├── perl │ └── perl.plugin.zsh ├── virtualenvwrapper │ └── virtualenvwrapper.plugin.zsh ├── rbenv │ └── rbenv.plugin.zsh ├── pow │ └── pow.plugin.zsh ├── ssh-agent │ └── ssh-agent.plugin.zsh ├── svn │ └── svn.plugin.zsh ├── lein │ └── lein.plugin.zsh ├── urltools │ └── urltools.plugin.zsh ├── screen │ └── screen.plugin.zsh ├── sprunge │ └── sprunge.plugin.zsh └── gem │ └── _gem ├── SpotSpecific_theme.png ├── themes ├── evan.zsh-theme ├── imajes.zsh-theme ├── example.zsh-theme ├── jispwoso.zsh-theme ├── sammy.zsh-theme ├── lambda.zsh-theme ├── simple.zsh-theme ├── norm.zsh-theme ├── cypher.zsh-theme ├── mgutz.zsh-theme ├── geoffgarside.zsh-theme ├── nanotech.zsh-theme ├── rgm.zsh-theme ├── gentoo.zsh-theme ├── kardan.zsh-theme ├── risto.zsh-theme ├── daveverwer.zsh-theme ├── maran.zsh-theme ├── garyblessington.zsh-theme ├── skaro.zsh-theme ├── wuffers.zsh-theme ├── 3den.zsh-theme ├── aussiegeek.zsh-theme ├── fwalch.zsh-theme ├── edvardm.zsh-theme ├── gallifrey.zsh-theme ├── jbergantine.zsh-theme ├── robbyrussell.zsh-theme ├── terminalparty.zsh-theme ├── wezm.zsh-theme ├── miloshadzic.zsh-theme ├── candy.zsh-theme ├── mrtazz.zsh-theme ├── afowler.zsh-theme ├── kafeitu.zsh-theme ├── wezm+.zsh-theme ├── cloud.zsh-theme ├── kennethreitz.zsh-theme ├── pygmalion.zsh-theme ├── frontcube.zsh-theme ├── rkj.zsh-theme ├── fox.zsh-theme ├── duellj.zsh-theme ├── jtriley.zsh-theme ├── arrow.zsh-theme ├── xiong-chiamiov.zsh-theme ├── obraun.zsh-theme ├── tjkirch_mod.zsh-theme ├── dst.zsh-theme ├── tjkirch.zsh-theme ├── xiong-chiamiov-plus.zsh-theme ├── dpoggi.zsh-theme ├── theunraveler.zsh-theme ├── funky.zsh-theme ├── jreese.zsh-theme ├── sporty_256.zsh-theme ├── darkblood.zsh-theme ├── gozilla.zsh-theme ├── zhann.zsh-theme ├── murilasso.zsh-theme ├── minimal.zsh-theme ├── macovsky.zsh-theme ├── macovsky-ruby.zsh-theme ├── flazz.zsh-theme ├── dstufft.zsh-theme ├── re5et.zsh-theme ├── awesomepanda.zsh-theme ├── kolo.zsh-theme ├── bira.zsh-theme ├── sunaku.zsh-theme ├── SpotSpecific.zsh-theme ├── takashiyoshida.zsh-theme ├── rixius.zsh-theme ├── frisk.zsh-theme ├── apple.zsh-theme ├── mikeh.zsh-theme ├── eastwood.zsh-theme ├── gallois.zsh-theme ├── lukerandall.zsh-theme ├── fishy.zsh-theme ├── nebirhos.zsh-theme ├── superjarin.zsh-theme ├── blinks.zsh-theme ├── humza.zsh-theme ├── af-magic.zsh-theme ├── alanpeabody.zsh-theme ├── intheloop.zsh-theme ├── muse.zsh-theme ├── jnrowe.zsh-theme ├── tonotdo.zsh-theme ├── fletcherm.zsh-theme ├── pmcgee.zsh-theme ├── suvash.zsh-theme ├── clean.zsh-theme ├── josh.zsh-theme ├── philips.zsh-theme ├── mgdm.zsh-theme ├── candy-kingdom.zsh-theme ├── junkfood.zsh-theme ├── fino-time.zsh-theme ├── michelebologna.zsh-theme ├── adben.zsh-theme ├── rkj-repos.zsh-theme ├── mh.zsh-theme ├── fino.zsh-theme ├── juanghurtado.zsh-theme ├── dallas.zsh-theme ├── nicoulaj.zsh-theme ├── kphoen.zsh-theme ├── sorin.zsh-theme ├── gnzh.zsh-theme ├── crunch.zsh-theme ├── mortalscumbag.zsh-theme └── dieter.zsh-theme ├── lib ├── edit-command-line.zsh ├── grep.zsh ├── correction.zsh ├── misc.zsh ├── rvm.zsh ├── history.zsh ├── functions.zsh ├── aliases.zsh ├── spectrum.zsh ├── directories.zsh ├── theme-and-appearance.zsh ├── termsupport.zsh └── key-bindings.zsh ├── .gitignore ├── custom ├── example.zsh └── example │ └── example.plugin.zsh ├── log └── .easter-egg ├── tools ├── uninstall.sh ├── upgrade.sh ├── check_for_upgrade.sh └── install.sh ├── MIT-LICENSE.txt ├── templates └── zshrc.zsh-template └── oh-my-zsh.sh /plugins/brew/brew.plugin.zsh: -------------------------------------------------------------------------------- 1 | alias brews='brew list -1' 2 | -------------------------------------------------------------------------------- /plugins/npm/npm.plugin.zsh: -------------------------------------------------------------------------------- 1 | eval "$(npm completion 2>/dev/null)" 2 | -------------------------------------------------------------------------------- /plugins/osx/_man-preview: -------------------------------------------------------------------------------- 1 | #compdef man-preview 2 | #autoload 3 | 4 | _man 5 | 6 | -------------------------------------------------------------------------------- /plugins/themes/_theme: -------------------------------------------------------------------------------- 1 | #compdef theme 2 | 3 | _arguments "1: :($(lstheme | tr "\n" " "))" 4 | -------------------------------------------------------------------------------- /SpotSpecific_theme.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mgdm/oh-my-zsh/master/SpotSpecific_theme.png -------------------------------------------------------------------------------- /plugins/cloudapp/cloudapp.plugin.zsh: -------------------------------------------------------------------------------- 1 | #!/bin/zsh 2 | alias cloudapp=$ZSH/plugins/cloudapp/cloudapp.rb 3 | -------------------------------------------------------------------------------- /plugins/thor/_thor: -------------------------------------------------------------------------------- 1 | #compdef thor 2 | #autoload 3 | 4 | compadd `thor list | grep thor | cut -d " " -f 2` 5 | -------------------------------------------------------------------------------- /plugins/laravel/laravel.plugin.zsh: -------------------------------------------------------------------------------- 1 | #!zsh 2 | alias artisan='php artisan' 3 | alias bob='php artisan bob::build' 4 | -------------------------------------------------------------------------------- /themes/evan.zsh-theme: -------------------------------------------------------------------------------- 1 | # Evan describes this sexy prompt as: "a skinny, topless prompt" 2 | PROMPT='%m :: %2~ %B»%b ' -------------------------------------------------------------------------------- /plugins/powder/_powder: -------------------------------------------------------------------------------- 1 | #compdef powder 2 | #autoload 3 | 4 | compadd `powder help | grep powder | cut -d " " -f 4` 5 | -------------------------------------------------------------------------------- /lib/edit-command-line.zsh: -------------------------------------------------------------------------------- 1 | autoload -U edit-command-line 2 | zle -N edit-command-line 3 | bindkey '\C-x\C-e' edit-command-line 4 | -------------------------------------------------------------------------------- /plugins/nyan/nyan.plugin.zsh: -------------------------------------------------------------------------------- 1 | if [[ -x `which nc` ]]; then 2 | alias nyan='nc -v miku.acm.uiuc.edu 23' # nyan cat 3 | fi 4 | 5 | 6 | -------------------------------------------------------------------------------- /plugins/wakeonlan/_wake: -------------------------------------------------------------------------------- 1 | #compdef wake 2 | #autoload 3 | 4 | _arguments "1:device to wake:_files -W '$HOME/.wakeonlan'" && return 0 5 | -------------------------------------------------------------------------------- /plugins/history/history.plugin.zsh: -------------------------------------------------------------------------------- 1 | alias h='history' 2 | 3 | function hs 4 | { 5 | history | grep $* 6 | } 7 | 8 | alias hsi='hs -i' 9 | -------------------------------------------------------------------------------- /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' -------------------------------------------------------------------------------- /plugins/encode64/encode64.plugin.zsh: -------------------------------------------------------------------------------- 1 | encode64(){ echo -n $1 | base64 } 2 | decode64(){ echo -n $1 | base64 -D } 3 | alias e64=encode64 4 | alias d64=decode64 5 | -------------------------------------------------------------------------------- /plugins/colemak/colemak-less: -------------------------------------------------------------------------------- 1 | n forw-line 2 | e back-line 3 | k repeat-search 4 | \ek repeat-search-all 5 | K reverse-search 6 | \eK reverse-search-all 7 | -------------------------------------------------------------------------------- /plugins/kate/kate.plugin.zsh: -------------------------------------------------------------------------------- 1 | 2 | # Kate 3 | # Start kate always silent 4 | alias kate='kate >/dev/null 2>&1' 5 | 6 | function kt () { 7 | cd $1 8 | kate $1 9 | } -------------------------------------------------------------------------------- /plugins/jruby/jruby.plugin.zsh: -------------------------------------------------------------------------------- 1 | # Aliases 2 | alias jrspec='jruby --debug -S rspec --debug' 3 | alias jprofile='jruby --profile.api -S rspec' 4 | alias jexec='jruby -S' 5 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | locals.zsh 2 | log/.zsh_history 3 | projects.zsh 4 | custom/* 5 | !custom/example 6 | !custom/example.zsh 7 | *.swp 8 | !custom/example.zshcache 9 | cache/ 10 | -------------------------------------------------------------------------------- /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 | # -------------------------------------------------------------------------------- /plugins/fasd/fasd.plugin.zsh: -------------------------------------------------------------------------------- 1 | if [ $commands[fasd] ]; then # check if fasd is installed 2 | eval "$(fasd --init auto)" 3 | alias v='f -e vim' 4 | alias o='a -e open' 5 | fi 6 | 7 | -------------------------------------------------------------------------------- /plugins/supervisor/supervisor.plugin.zsh: -------------------------------------------------------------------------------- 1 | # DECLARION: This plugin was created by hhatto. What I did is just making a portal from https://bitbucket.org/hhatto/zshcompfunc4supervisor. 2 | -------------------------------------------------------------------------------- /custom/example/example.plugin.zsh: -------------------------------------------------------------------------------- 1 | # Add your own custom plugins in the custom/plugins directory. Plugins placed 2 | # here will override ones with the same name in the main plugins directory. 3 | -------------------------------------------------------------------------------- /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%}%% " -------------------------------------------------------------------------------- /themes/jispwoso.zsh-theme: -------------------------------------------------------------------------------- 1 | PROMPT=$'%{$fg[green]%}%n@%m: %{$reset_color%}%{$fg[blue]%}%/%{$reset_color%} 2 | %{$fg_bold[red]%}➜ %{$reset_color%} ' 3 | 4 | PROMPT2="%{$fg_blod[black]%}%_> %{$reset_color%}" 5 | -------------------------------------------------------------------------------- /themes/sammy.zsh-theme: -------------------------------------------------------------------------------- 1 | PROMPT='%{$fg[white]%}%c$(git_prompt_info)$ % %{$reset_color%}' 2 | 3 | ZSH_THEME_GIT_PROMPT_PREFIX="(" 4 | ZSH_THEME_GIT_PROMPT_SUFFIX="" 5 | ZSH_THEME_GIT_PROMPT_DIRTY="*)" 6 | ZSH_THEME_GIT_PROMPT_CLEAN=")" 7 | -------------------------------------------------------------------------------- /plugins/ruby/ruby.plugin.zsh: -------------------------------------------------------------------------------- 1 | # TODO: Make this compatible with rvm. 2 | # Run sudo gem on the system ruby, not the active ruby. 3 | alias sgem='sudo gem' 4 | 5 | # Find ruby file 6 | alias rfind='find . -name "*.rb" | xargs grep -n' 7 | -------------------------------------------------------------------------------- /themes/lambda.zsh-theme: -------------------------------------------------------------------------------- 1 | # ZSH Theme - Preview: http://cl.ly/350F0F0k1M2y3A2i3p1S 2 | 3 | PROMPT='λ %~/ $(git_prompt_info)%{$reset_color%}' 4 | 5 | ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}" 6 | ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} " 7 | -------------------------------------------------------------------------------- /plugins/node/node.plugin.zsh: -------------------------------------------------------------------------------- 1 | # Open the node api for your current version to the optional section. 2 | # TODO: Make the section part easier to use. 3 | function node-docs { 4 | open "http://nodejs.org/docs/$(node --version)/api/all.html#all_$1" 5 | } 6 | -------------------------------------------------------------------------------- /themes/simple.zsh-theme: -------------------------------------------------------------------------------- 1 | PROMPT='%{$fg[green]%}%~%{$fg_bold[blue]%}$(git_prompt_info)%{$reset_color%} ' 2 | 3 | ZSH_THEME_GIT_PROMPT_PREFIX="(" 4 | ZSH_THEME_GIT_PROMPT_SUFFIX=")" 5 | ZSH_THEME_GIT_PROMPT_DIRTY=" ✗" 6 | ZSH_THEME_GIT_PROMPT_CLEAN=" ✔" 7 | -------------------------------------------------------------------------------- /plugins/gitfast/gitfast.plugin.zsh: -------------------------------------------------------------------------------- 1 | dir=$(dirname $0) 2 | source $dir/../git/git.plugin.zsh 3 | source $dir/git-prompt.sh 4 | 5 | function git_prompt_info() { 6 | __git_ps1 "${ZSH_THEME_GIT_PROMPT_PREFIX//\%/%%}%s${ZSH_THEME_GIT_PROMPT_SUFFIX//\%/%%}" 7 | } 8 | -------------------------------------------------------------------------------- /plugins/rsync/rsync.plugin.zsh: -------------------------------------------------------------------------------- 1 | alias rsync-copy="rsync -av --progress -h" 2 | alias rsync-move="rsync -av --progress -h --remove-source-files" 3 | alias rsync-update="rsync -avu --progress -h" 4 | alias rsync-synchronize="rsync -avu --delete --progress -h" 5 | -------------------------------------------------------------------------------- /themes/norm.zsh-theme: -------------------------------------------------------------------------------- 1 | PROMPT='%{$fg[yellow]%}λ %m %{$fg[green]%}%c %{$fg[yellow]%}→ $(git_prompt_info)%{$reset_color%}' 2 | 3 | ZSH_THEME_GIT_PROMPT_PREFIX="λ %{$fg[blue]%}git %{$fg[red]%}" 4 | ZSH_THEME_GIT_PROMPT_SUFFIX="%{$fg[yellow]%} → %{$reset_color%}" 5 | -------------------------------------------------------------------------------- /plugins/extract/_extract: -------------------------------------------------------------------------------- 1 | #compdef extract 2 | #autoload 3 | 4 | _arguments \ 5 | '(-r --remove)'{-r,--remove}'[Remove archive.]' \ 6 | "*::archive file:_files -g '(#i)*.(tar|tgz|tbz|tbz2|txz|tlz|gz|bz2|xz|lzma|Z|zip|rar|7z|deb)(-.)'" && return 0 7 | 8 | 9 | -------------------------------------------------------------------------------- /plugins/suse/suse.plugin.zsh: -------------------------------------------------------------------------------- 1 | alias zi='sudo zypper install' 2 | alias zrf='sudo zypper refresh' 3 | alias zs='zypper search' 4 | alias zup='sudo zypper dist-upgrade' 5 | alias zrm='sudo zypper remove' 6 | alias zp='sudo zypper patch' 7 | alias zps='sudo zypper ps' 8 | -------------------------------------------------------------------------------- /plugins/command-not-found/command-not-found.plugin.zsh: -------------------------------------------------------------------------------- 1 | # Uses the command-not-found package zsh support 2 | # as seen in http://www.porcheron.info/command-not-found-for-zsh/ 3 | # this is installed in Ubuntu 4 | 5 | [[ -e /etc/zsh_command_not_found ]] && source /etc/zsh_command_not_found 6 | -------------------------------------------------------------------------------- /plugins/macports/macports.plugin.zsh: -------------------------------------------------------------------------------- 1 | #Aliases 2 | alias pc="sudo port clean --all installed" 3 | alias pi="sudo port install $1" 4 | alias psu="sudo port selfupdate" 5 | alias puni="sudo port uninstall inactive" 6 | alias puo="sudo port upgrade outdated" 7 | alias pup="psu && puo" 8 | 9 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /themes/mgutz.zsh-theme: -------------------------------------------------------------------------------- 1 | PROMPT='%{$fg_bold[magenta]%}%1~$(git_prompt_info) %{$fg_bold[magenta]%}%# %{$reset_color%}' 2 | 3 | ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[yellow]%}[" 4 | ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" 5 | ZSH_THEME_GIT_PROMPT_DIRTY="*]" 6 | ZSH_THEME_GIT_PROMPT_CLEAN="]" 7 | -------------------------------------------------------------------------------- /plugins/history-substring-search/README: -------------------------------------------------------------------------------- 1 | To activate this script, load it into an interactive ZSH session: 2 | 3 | % source history-substring-search.zsh 4 | 5 | See the "history-substring-search.zsh" file for more information: 6 | 7 | % sed -n '2,/^$/s/^#//p' history-substring-search.zsh | more 8 | -------------------------------------------------------------------------------- /plugins/nanoc/nanoc.plugin.zsh: -------------------------------------------------------------------------------- 1 | alias n='nanoc' 2 | alias na='nanoc autocompile' 3 | alias nco='nanoc compile' 4 | alias nci='nanoc create_item' 5 | alias ncl='nanoc create_layout' 6 | alias ncs='nanoc create_site' 7 | alias nd='nanoc deploy' 8 | alias nv='nanoc view' 9 | alias nw='nanoc watch' 10 | -------------------------------------------------------------------------------- /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/nanotech.zsh-theme: -------------------------------------------------------------------------------- 1 | PROMPT='%F{green}%2c%F{blue} [%f ' 2 | RPROMPT='$(git_prompt_info) %F{blue}] %F{green}%D{%L:%M} %F{yellow}%D{%p}%f' 3 | 4 | ZSH_THEME_GIT_PROMPT_PREFIX="%F{yellow}" 5 | ZSH_THEME_GIT_PROMPT_SUFFIX="%f" 6 | ZSH_THEME_GIT_PROMPT_DIRTY=" %F{red}*%f" 7 | ZSH_THEME_GIT_PROMPT_CLEAN="" 8 | -------------------------------------------------------------------------------- /themes/rgm.zsh-theme: -------------------------------------------------------------------------------- 1 | PROMPT=' 2 | %n@%m %{$fg[cyan]%}%~ 3 | %? $(git_prompt_info)%{$fg_bold[blue]%}%% %{$reset_color%}' 4 | 5 | ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[red]%}" 6 | ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} " 7 | ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}" 8 | ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%}" 9 | -------------------------------------------------------------------------------- /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 | alias ebuild='nocorrect ebuild' 10 | alias hpodder='nocorrect hpodder' 11 | -------------------------------------------------------------------------------- /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 LESS="-R" 14 | 15 | export LC_CTYPE=$LANG 16 | -------------------------------------------------------------------------------- /plugins/rake/rake.plugin.zsh: -------------------------------------------------------------------------------- 1 | alias rake="noglob rake" # allows square brackts for rake task invocation 2 | alias brake='noglob bundle exec rake' # execute the bundled rake gem 3 | alias srake='noglob sudo rake' # noglob must come before sudo 4 | alias sbrake='noglob sudo bundle exec rake' # altogether now ... 5 | 6 | 7 | -------------------------------------------------------------------------------- /themes/gentoo.zsh-theme: -------------------------------------------------------------------------------- 1 | function prompt_char { 2 | if [ $UID -eq 0 ]; then echo "#"; else echo $; fi 3 | } 4 | 5 | PROMPT='%(!.%{$fg_bold[red]%}.%{$fg_bold[green]%}%n@)%m %{$fg_bold[blue]%}%(!.%1~.%~) $(git_prompt_info)%_$(prompt_char)%{$reset_color%} ' 6 | 7 | ZSH_THEME_GIT_PROMPT_PREFIX="(" 8 | ZSH_THEME_GIT_PROMPT_SUFFIX=") " 9 | -------------------------------------------------------------------------------- /themes/kardan.zsh-theme: -------------------------------------------------------------------------------- 1 | # Simple theme based on my old zsh settings. 2 | 3 | function get_host { 4 | echo '@'`hostname`'' 5 | } 6 | 7 | PROMPT='> ' 8 | RPROMPT='%~$(git_prompt_info)$(get_host)' 9 | 10 | ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[yellow]%}✗%{$reset_color%}" 11 | ZSH_THEME_GIT_PROMPT_PREFIX="(" 12 | ZSH_THEME_GIT_PROMPT_SUFFIX=")" -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /plugins/capistrano/_capistrano: -------------------------------------------------------------------------------- 1 | #compdef cap 2 | #autoload 3 | 4 | if [ -f config/deploy.rb ]; then 5 | if [[ ! -f .cap_tasks~ || config/deploy.rb -nt .cap_tasks~ ]]; then 6 | echo "\nGenerating .cap_tasks~..." > /dev/stderr 7 | cap --tasks | grep '#' | cut -d " " -f 2 > .cap_tasks~ 8 | fi 9 | compadd `cat .cap_tasks~` 10 | fi 11 | -------------------------------------------------------------------------------- /themes/daveverwer.zsh-theme: -------------------------------------------------------------------------------- 1 | # Copied and modified from the oh-my-zsh theme from geoffgarside 2 | # Red server name, green cwd, blue git status 3 | 4 | PROMPT='%{$fg[red]%}%m%{$reset_color%}:%{$fg[green]%}%c%{$reset_color%}$(git_prompt_info) %(!.#.$) ' 5 | 6 | ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[blue]%}(" 7 | ZSH_THEME_GIT_PROMPT_SUFFIX=")%{$reset_color%}" 8 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /themes/skaro.zsh-theme: -------------------------------------------------------------------------------- 1 | PROMPT='%{$fg_bold[green]%}%h %{$fg[cyan]%}%2~ %{$fg_bold[blue]%}$(git_prompt_info) %{$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 | 8 | -------------------------------------------------------------------------------- /themes/wuffers.zsh-theme: -------------------------------------------------------------------------------- 1 | ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}[" 2 | ZSH_THEME_GIT_PROMPT_SUFFIX="]%{$reset_color%} " 3 | ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[red]%} x%{$fg_bold[blue]%}" 4 | 5 | PROMPT='%{$(git_prompt_info)%}%{$fg_bold[green]%}{%{$(rvm current 2>/dev/null || rbenv version-name 2>/dev/null)%}}%{$reset_color%} %{$fg[cyan]%}%c%{$reset_color%} ' 6 | -------------------------------------------------------------------------------- /plugins/stv/stv.plugin.zsh: -------------------------------------------------------------------------------- 1 | function stv_app_name { 2 | echo $PWD | grep 'globals_codeigniter' > /dev/null 3 | if [ $? -eq 0 ]; then 4 | echo globals 5 | else 6 | echo $PWD | sed -E -n 's/.*(:?Sites|phpapps)\/([^/]*)\.stv\.tv.*/\2/p' 7 | fi 8 | } 9 | 10 | function stv_prompt { 11 | echo $ZSH_THEME_STV_APP_PREFIX$(stv_app_name)$ZSH_THEME_STV_APP_SUFFIX 12 | } 13 | -------------------------------------------------------------------------------- /themes/3den.zsh-theme: -------------------------------------------------------------------------------- 1 | PROMPT=$'%{$fg[white]%}$(~/.rvm/bin/rvm-prompt) %{$fg_bold[cyan]%}%~%{$reset_color%}$(git_prompt_info) %{$fg[cyan]%}%D{[%I:%M:%S]}\ 2 | %{$fg_bold[green]%}%n$%{$reset_color%} ' 3 | 4 | ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[white]%}(" 5 | ZSH_THEME_GIT_PROMPT_SUFFIX=")%{$reset_color%}" 6 | ZSH_THEME_GIT_PROMPT_DIRTY="*" 7 | ZSH_THEME_GIT_PROMPT_CLEAN="" 8 | -------------------------------------------------------------------------------- /themes/aussiegeek.zsh-theme: -------------------------------------------------------------------------------- 1 | 2 | PROMPT='$fg_bold[blue][ $fg[red]%t $fg_bold[blue]] $fg_bold[blue] [ $fg[red]%n@%m:%~$(git_prompt_info)$fg[yellow]$(rvm_prompt_info)$fg_bold[blue] ]$reset_color 3 | $ ' 4 | # git theming 5 | ZSH_THEME_GIT_PROMPT_PREFIX="$fg_bold[green](" 6 | ZSH_THEME_GIT_PROMPT_SUFFIX=")" 7 | ZSH_THEME_GIT_PROMPT_CLEAN="✔" 8 | ZSH_THEME_GIT_PROMPT_DIRTY="✗" 9 | -------------------------------------------------------------------------------- /themes/fwalch.zsh-theme: -------------------------------------------------------------------------------- 1 | PROMPT='%{$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=" (%{$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 | -------------------------------------------------------------------------------- /lib/rvm.zsh: -------------------------------------------------------------------------------- 1 | # get the name of the ruby version 2 | function rvm_prompt_info() { 3 | [ -f $HOME/.rvm/bin/rvm-prompt ] || return 4 | local rvm_prompt 5 | rvm_prompt=$($HOME/.rvm/bin/rvm-prompt ${ZSH_THEME_RVM_PROMPT_OPTIONS} 2>/dev/null) 6 | [[ "${rvm_prompt}x" == "x" ]] && return 7 | echo "${ZSH_THEME_RVM_PROMPT_PREFIX:=(}${rvm_prompt}${ZSH_THEME_RVM_PROMPT_SUFFIX:=)}" 8 | } 9 | -------------------------------------------------------------------------------- /plugins/symfony/symfony.plugin.zsh: -------------------------------------------------------------------------------- 1 | # symfony basic command completion 2 | 3 | _symfony_get_command_list () { 4 | ./symfony | sed "1,/Available tasks/d" | awk 'BEGIN { cat=null; } /^[A-Za-z]+$/ { cat = $1; } /^ :[a-z]+/ { print cat $1; }' 5 | } 6 | 7 | _symfony () { 8 | if [ -f symfony ]; then 9 | compadd `_symfony_get_command_list` 10 | fi 11 | } 12 | 13 | compdef _symfony symfony 14 | -------------------------------------------------------------------------------- /themes/edvardm.zsh-theme: -------------------------------------------------------------------------------- 1 | PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%p %{$fg_bold[white]%}%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/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/jbergantine.zsh-theme: -------------------------------------------------------------------------------- 1 | PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[white]%}$(git_prompt_info)%{$fg_bold[white]%} % %{$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[white]%}) %{$fg[yellow]%}✗%{$reset_color%}" 6 | ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[white]%})" 7 | -------------------------------------------------------------------------------- /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/terminalparty.zsh-theme: -------------------------------------------------------------------------------- 1 | PROMPT='%{$fg[green]%} %% ' 2 | # RPS1='%{$fg[blue]%}%~%{$reset_color%} ' 3 | RPS1='%{$fg[white]%}%2~$(git_prompt_info) %{$fg_bold[blue]%}%m%{$reset_color%}' 4 | 5 | ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[yellow]%}(" 6 | ZSH_THEME_GIT_PROMPT_SUFFIX=")%{$reset_color%}" 7 | ZSH_THEME_GIT_PROMPT_CLEAN="" 8 | ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%} ⚡%{$fg[yellow]%}" 9 | 10 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /themes/miloshadzic.zsh-theme: -------------------------------------------------------------------------------- 1 | # Yay! High voltage and arrows! 2 | 3 | ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[green]%}" 4 | ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} " 5 | ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[yellow]%}⚡%{$reset_color%}" 6 | ZSH_THEME_GIT_PROMPT_CLEAN="" 7 | 8 | PROMPT='%{$fg[cyan]%}%1~%{$reset_color%}%{$fg[red]%}|%{$reset_color%}$(git_prompt_info)%{$fg[cyan]%}⇒%{$reset_color%} ' 9 | -------------------------------------------------------------------------------- /themes/candy.zsh-theme: -------------------------------------------------------------------------------- 1 | PROMPT=$'%{$fg_bold[green]%}%n@%m %{$fg[blue]%}%D{[%I:%M:%S]} %{$reset_color%}%{$fg[white]%}[%~]%{$reset_color%} $(git_prompt_info)\ 2 | %{$fg[blue]%}->%{$fg_bold[blue]%} %#%{$reset_color%} ' 3 | 4 | ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}[" 5 | ZSH_THEME_GIT_PROMPT_SUFFIX="]%{$reset_color%}" 6 | ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}*%{$fg[green]%}" 7 | ZSH_THEME_GIT_PROMPT_CLEAN="" 8 | -------------------------------------------------------------------------------- /themes/mrtazz.zsh-theme: -------------------------------------------------------------------------------- 1 | PROMPT='%{$fg_bold[red]%}%m%{$reset_color%}:%{$fg[cyan]%}%c%{$reset_color%}:%# ' 2 | RPROMPT='%{$fg_bold[green]%}$(git_prompt_info)%{$reset_color%}% ' 3 | 4 | ZSH_THEME_GIT_PROMPT_PREFIX="<%{$fg[red]%}" 5 | ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" 6 | ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%} %{$fg[yellow]%}✗%{$fg[green]%}>%{$reset_color%}" 7 | ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%}>" 8 | -------------------------------------------------------------------------------- /plugins/python/python.plugin.zsh: -------------------------------------------------------------------------------- 1 | # Find python file 2 | alias pyfind='find . -name "*.py"' 3 | 4 | # Remove python compiled byte-code in either current directory or in a 5 | # list of specified directories 6 | function pyclean() { 7 | ZSH_PYCLEAN_PLACES=${*:-'.'} 8 | find ${ZSH_PYCLEAN_PLACES} -type f -name "*.py[co]" -delete 9 | } 10 | 11 | # Grep among .py files 12 | alias pygrep='grep --include="*.py"' 13 | -------------------------------------------------------------------------------- /lib/history.zsh: -------------------------------------------------------------------------------- 1 | ## Command history configuration 2 | HISTFILE=$HOME/.zsh_history 3 | HISTSIZE=10000 4 | SAVEHIST=10000 5 | 6 | setopt append_history 7 | setopt extended_history 8 | setopt hist_expire_dups_first 9 | setopt hist_ignore_dups # ignore duplication command history list 10 | setopt hist_ignore_space 11 | setopt hist_verify 12 | setopt inc_append_history 13 | setopt share_history # share command history data 14 | -------------------------------------------------------------------------------- /plugins/mysql-macports/mysql-macports.plugin.zsh: -------------------------------------------------------------------------------- 1 | # commands to control local mysql-server installation 2 | # paths are for osx installation via macports 3 | 4 | alias mysqlstart='sudo /opt/local/share/mysql5/mysql/mysql.server start' 5 | alias mysqlstop='sudo /opt/local/share/mysql5/mysql/mysql.server stop' 6 | alias mysqlrestart='sudo /opt/local/share/mysql5/mysql/mysql.server restart' 7 | 8 | alias mysqlstatus='mysqladmin5 -u root -p ping' 9 | -------------------------------------------------------------------------------- /plugins/wakeonlan/wakeonlan.plugin.zsh: -------------------------------------------------------------------------------- 1 | function wake() { 2 | local config_file="$HOME/.wakeonlan/$1" 3 | if [[ ! -f "$config_file" ]]; then 4 | echo "ERROR: There is no configuration file at \"$config_file\"." 5 | return 1 6 | fi 7 | 8 | if (( ! $+commands[wakeonlan] )); then 9 | echo "ERROR: Can't find \"wakeonlan\". Are you sure it's installed?" 10 | return 1 11 | fi 12 | 13 | wakeonlan -f "$config_file" 14 | } 15 | -------------------------------------------------------------------------------- /themes/afowler.zsh-theme: -------------------------------------------------------------------------------- 1 | if [ $UID -eq 0 ]; then CARETCOLOR="red"; else CARETCOLOR="blue"; fi 2 | 3 | local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" 4 | 5 | PROMPT='%m %{${fg_bold[blue]}%}:: %{$reset_color%}%{${fg[green]}%}%3~ $(git_prompt_info)%{${fg_bold[$CARETCOLOR]}%}»%{${reset_color}%} ' 6 | 7 | RPS1="${return_code}" 8 | 9 | ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}‹" 10 | ZSH_THEME_GIT_PROMPT_SUFFIX="› %{$reset_color%}" 11 | -------------------------------------------------------------------------------- /themes/kafeitu.zsh-theme: -------------------------------------------------------------------------------- 1 | PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%n%{$fg[cyan]%}@%{$fg_bold[green]%}%m %{$fg_bold[green]%}%p %{$fg[cyan]%}%~ %{$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 | -------------------------------------------------------------------------------- /plugins/bwana/bwana.plugin.zsh: -------------------------------------------------------------------------------- 1 | # 2 | # Requires http://www.bruji.com/bwana/ 3 | # 4 | if [[ -e /Applications/Bwana.app ]] || 5 | ( system_profiler -detailLevel mini SPApplicationsDataType | grep -q Bwana ) 6 | then 7 | function man() { 8 | open "man:$1" 9 | } 10 | else 11 | echo "Bwana lets you read man files in Safari through a man: URI scheme" 12 | echo "To use it within Zsh, install it from http://www.bruji.com/bwana/" 13 | fi 14 | -------------------------------------------------------------------------------- /plugins/apache2-macports/apache2-macports.plugin.zsh: -------------------------------------------------------------------------------- 1 | # commands to control local apache2 server installation 2 | # paths are for osx installation via macports 3 | 4 | alias apache2start='sudo /opt/local/etc/LaunchDaemons/org.macports.apache2/apache2.wrapper start' 5 | alias apache2stop='sudo /opt/local/etc/LaunchDaemons/org.macports.apache2/apache2.wrapper stop' 6 | alias apache2restart='sudo /opt/local/etc/LaunchDaemons/org.macports.apache2/apache2.wrapper restart' 7 | -------------------------------------------------------------------------------- /plugins/dircycle/dircycle.plugin.zsh: -------------------------------------------------------------------------------- 1 | ## 2 | # dircycle plugin: enables cycling through the directory 3 | # stack using Ctrl+Shift+Left/Right 4 | 5 | eval "insert-cycledleft () { zle push-line; LBUFFER='pushd -q +1'; zle accept-line }" 6 | zle -N insert-cycledleft 7 | bindkey "\e[1;6D" insert-cycledleft 8 | eval "insert-cycledright () { zle push-line; LBUFFER='pushd -q -0'; zle accept-line }" 9 | zle -N insert-cycledright 10 | bindkey "\e[1;6C" insert-cycledright 11 | -------------------------------------------------------------------------------- /themes/wezm+.zsh-theme: -------------------------------------------------------------------------------- 1 | PROMPT='%{${fg_bold[yellow]}%}%n%{$reset_color%}%{${fg[yellow]}%}@%m%{$reset_color%} $(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 | -------------------------------------------------------------------------------- /plugins/history-substring-search/history-substring-search.plugin.zsh: -------------------------------------------------------------------------------- 1 | # This file integrates the history-substring-search script into oh-my-zsh. 2 | 3 | source "$ZSH/plugins/history-substring-search/history-substring-search.zsh" 4 | 5 | if test "$CASE_SENSITIVE" = true; then 6 | unset HISTORY_SUBSTRING_SEARCH_GLOBBING_FLAGS 7 | fi 8 | 9 | if test "$DISABLE_COLOR" = true; then 10 | unset HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND 11 | unset HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND 12 | fi 13 | -------------------------------------------------------------------------------- /plugins/systemd/systemd.plugin.zsh: -------------------------------------------------------------------------------- 1 | user_commands=( 2 | list-units is-active status show help list-unit-files 3 | is-enabled list-jobs show-environment) 4 | 5 | sudo_commands=( 6 | start stop reload restart try-restart isolate kill 7 | reset-failed enable disable reenable preset mask unmask 8 | link load cancel set-environment unset-environment) 9 | 10 | for c in $user_commands; do; alias sc-$c="systemctl $c"; done 11 | for c in $sudo_commands; do; alias sc-$c="sudo systemctl $c"; done 12 | -------------------------------------------------------------------------------- /lib/functions.zsh: -------------------------------------------------------------------------------- 1 | function zsh_stats() { 2 | history | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n20 3 | } 4 | 5 | function uninstall_oh_my_zsh() { 6 | /usr/bin/env ZSH=$ZSH /bin/sh $ZSH/tools/uninstall.sh 7 | } 8 | 9 | function upgrade_oh_my_zsh() { 10 | /usr/bin/env ZSH=$ZSH /bin/sh $ZSH/tools/upgrade.sh 11 | } 12 | 13 | function take() { 14 | mkdir -p $1 15 | cd $1 16 | } 17 | 18 | -------------------------------------------------------------------------------- /plugins/symfony2/symfony2.plugin.zsh: -------------------------------------------------------------------------------- 1 | # Symfony2 basic command completion 2 | 3 | _symfony2_get_command_list () { 4 | app/console --no-ansi | sed "1,/Available commands/d" | awk '/^ [a-z]+/ { print $1 }' 5 | } 6 | 7 | _symfony2 () { 8 | if [ -f app/console ]; then 9 | compadd `_symfony2_get_command_list` 10 | fi 11 | } 12 | 13 | compdef _symfony2 app/console 14 | compdef _symfony2 sf 15 | 16 | #Alias 17 | alias sf2='php app/console' 18 | alias sf2clear='php app/console cache:clear' 19 | 20 | -------------------------------------------------------------------------------- /themes/cloud.zsh-theme: -------------------------------------------------------------------------------- 1 | if [[ -z $ZSH_THEME_CLOUD_PREFIX ]]; then 2 | ZSH_THEME_CLOUD_PREFIX='☁' 3 | fi 4 | 5 | PROMPT='%{$fg_bold[cyan]%}$ZSH_THEME_CLOUD_PREFIX %{$fg_bold[green]%}%p %{$fg[green]%}%c %{$fg_bold[cyan]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}' 6 | 7 | ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}[%{$fg[cyan]%}" 8 | ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" 9 | ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%}] %{$fg[yellow]%}⚡%{$reset_color%}" 10 | ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%}]" -------------------------------------------------------------------------------- /themes/kennethreitz.zsh-theme: -------------------------------------------------------------------------------- 1 | local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" 2 | 3 | PROMPT='%{$fg[green]%}%c \ 4 | $(git_prompt_info)\ 5 | %{$fg[red]%}%(!.#.»)%{$reset_color%} ' 6 | PROMPT2='%{$fg[red]%}\ %{$reset_color%}' 7 | RPS1='%{$fg[blue]%}%~%{$reset_color%} ${return_code} ' 8 | 9 | ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}:: %{$fg[yellow]%}(" 10 | ZSH_THEME_GIT_PROMPT_SUFFIX=")%{$reset_color%} " 11 | ZSH_THEME_GIT_PROMPT_CLEAN="" 12 | ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}*%{$fg[yellow]%}" 13 | 14 | -------------------------------------------------------------------------------- /plugins/textmate/textmate.plugin.zsh: -------------------------------------------------------------------------------- 1 | alias et='mate .' 2 | alias ett='mate Gemfile app config features lib db public spec test Rakefile Capfile Todo' 3 | alias etp='mate app config lib db public spec test vendor/plugins vendor/gems Rakefile Capfile Todo' 4 | alias etts='mate app config lib db public script spec test vendor/plugins vendor/gems Rakefile Capfile Todo' 5 | 6 | # Edit Ruby app in TextMate 7 | alias mr='mate CHANGELOG app config db lib public script spec test' 8 | 9 | function tm() { 10 | cd $1 11 | mate $1 12 | } 13 | -------------------------------------------------------------------------------- /themes/pygmalion.zsh-theme: -------------------------------------------------------------------------------- 1 | # Yay! High voltage and arrows! 2 | 3 | ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[green]%}" 4 | ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} " 5 | ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[yellow]%}⚡%{$reset_color%}" 6 | ZSH_THEME_GIT_PROMPT_CLEAN="" 7 | 8 | PROMPT='%{$fg[magenta]%}%n%{$reset_color%}%{$fg[cyan]%}@%{$reset_color%}%{$fg[yellow]%}%m%{$reset_color%}%{$fg[red]%}:%{$reset_color%}%{$fg[cyan]%}%0~%{$reset_color%}%{$fg[red]%}|%{$reset_color%}$(git_prompt_info)%{$fg[cyan]%}⇒%{$reset_color%} ' 9 | 10 | -------------------------------------------------------------------------------- /themes/frontcube.zsh-theme: -------------------------------------------------------------------------------- 1 | local rvm="%{$fg[green]%}[$(rvm-prompt i v g)]%{$reset_color%}" 2 | 3 | PROMPT=' 4 | %{$fg_bold[gray]%}%~%{$fg_bold[blue]%}%{$fg_bold[blue]%} % %{$reset_color%} 5 | %{$fg[green]%}➞ %{$reset_color%' 6 | 7 | RPROMPT='$(git_prompt_info) $(rvm)' 8 | 9 | ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}[git:" 10 | ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" 11 | ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}] %{$fg[red]%}✖ %{$reset_color%}" 12 | ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%}] %{$fg[green]%}✔%{$reset_color%}" 13 | -------------------------------------------------------------------------------- /lib/aliases.zsh: -------------------------------------------------------------------------------- 1 | # Push and pop directories on directory stack 2 | alias pu='pushd' 3 | alias po='popd' 4 | 5 | # Basic directory operations 6 | alias ...='cd ../..' 7 | alias -- -='cd -' 8 | 9 | # Super user 10 | alias _='sudo' 11 | alias please='sudo' 12 | 13 | #alias g='grep -in' 14 | 15 | # Show history 16 | alias history='fc -l 1' 17 | 18 | # List direcory contents 19 | alias lsa='ls -lah' 20 | alias l='ls -lA1' 21 | alias ll='ls -l' 22 | alias la='ls -lA' 23 | alias sl=ls # often screw this up 24 | 25 | alias afind='ack-grep -il' 26 | 27 | -------------------------------------------------------------------------------- /plugins/mercurial/mercurial.plugin.zsh: -------------------------------------------------------------------------------- 1 | 2 | # Mercurial 3 | alias hgc='hg commit' 4 | alias hgb='hg branch' 5 | alias hgba='hg branches' 6 | alias hgco='hg checkout' 7 | alias hgd='hg diff' 8 | alias hged='hg diffmerge' 9 | # pull and update 10 | alias hgl='hg pull -u' 11 | alias hgp='hg push' 12 | alias hgs='hg status' 13 | # this is the 'git commit --amend' equivalent 14 | alias hgca='hg qimport -r tip ; hg qrefresh -e ; hg qfinish tip' 15 | 16 | function hg_current_branch() { 17 | if [ -d .hg ]; then 18 | echo hg:$(hg branch) 19 | fi 20 | } -------------------------------------------------------------------------------- /themes/rkj.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 | 5 | 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{"%Y-%m-%d %I:%M:%S"}%b$'%{\e[0;34m%}%B]%b%{\e[0m%} 6 | %{\e[0;34m%}%B└─%B[%{\e[1;35m%}$%{\e[0;34m%}%B]%{\e[0m%}%b ' 7 | 8 | 9 | -------------------------------------------------------------------------------- /themes/fox.zsh-theme: -------------------------------------------------------------------------------- 1 | #fox theme 2 | PROMPT='%{$fg[cyan]%}┌[%{$fg_bold[white]%}%n%{$reset_color%}%{$fg[cyan]%}☮%{$fg_bold[white]%}%M%{$reset_color%}%{$fg[cyan]%}]%{$fg[white]%}-%{$fg[cyan]%}(%{$fg_bold[white]%}%~%{$reset_color%}%{$fg[cyan]%})$(git_prompt_info) 3 | └> % %{$reset_color%}' 4 | 5 | ZSH_THEME_GIT_PROMPT_PREFIX="-[%{$reset_color%}%{$fg[white]%}git://%{$fg_bold[white]%}" 6 | ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}%{$fg[cyan]%}]-" 7 | ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}✗%{$reset_color%}" 8 | ZSH_THEME_GIT_PROMPT_CLEAN=" %{$fg[green]%}✔%{$reset_color%}" 9 | -------------------------------------------------------------------------------- /plugins/phing/phing.plugin.zsh: -------------------------------------------------------------------------------- 1 | _phing_does_target_list_need_generating () { 2 | if [ ! -f .phing_targets ]; then return 0; 3 | else 4 | accurate=$(stat -f%m .phing_targets) 5 | changed=$(stat -f%m build.xml) 6 | return $(expr $accurate '>=' $changed) 7 | fi 8 | } 9 | 10 | _phing () { 11 | if [ -f build.xml ]; then 12 | if _phing_does_target_list_need_generating; then 13 | phing -l |grep -v ":" |grep -v "^$"|grep -v "\-" > .phing_targets 14 | fi 15 | compadd `cat .phing_targets` 16 | fi 17 | } 18 | 19 | compdef _phing phing 20 | -------------------------------------------------------------------------------- /themes/duellj.zsh-theme: -------------------------------------------------------------------------------- 1 | 2 | # user, host, full path, and time/date 3 | # on two lines for easier vgrepping 4 | # entry in a nice long thread on the Arch Linux forums: http://bbs.archlinux.org/viewtopic.php?pid=521888#p521888 5 | PROMPT=$'%{\e[0;34m%}%B┌─[%b%{\e[0m%}%{\e[1;32m%}%n%{\e[1;34m%}@%{\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%}%!%{\e[0;34m%}%B]%b%{\e[0m%} 6 | %{\e[0;34m%}%B└─%B[%{\e[1;35m%}$%{\e[0;34m%}%B]%{\e[0m%}%b ' 7 | RPROMPT='[%*]' 8 | PS2=$' \e[0;34m%}%B>%{\e[0m%}%b ' 9 | -------------------------------------------------------------------------------- /themes/jtriley.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 | PROMPT="%{$fg_bold[cyan]%}%T%{$fg_bold[green]%} %{$fg_bold[white]%}%n%{$fg[magenta]%}@%{$fg_bold[white]%}%m %{$fg_bold[green]%}%d 3 | %{$fg_bold[yellow]%}%% %{$reset_color%}" 4 | 5 | #ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$fg[red]%}" 6 | #ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" 7 | #ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗%{$reset_color%}" 8 | #ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})" 9 | -------------------------------------------------------------------------------- /themes/arrow.zsh-theme: -------------------------------------------------------------------------------- 1 | if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="yellow"; fi 2 | 3 | PROMPT='%{$fg[$NCOLOR]%}%c ➤ %{$reset_color%}' 4 | RPROMPT='%{$fg[$NCOLOR]%}%p $(git_prompt_info)%{$reset_color%}' 5 | 6 | ZSH_THEME_GIT_PROMPT_PREFIX="git:" 7 | ZSH_THEME_GIT_PROMPT_SUFFIX="" 8 | ZSH_THEME_GIT_PROMPT_DIRTY="*" 9 | ZSH_THEME_GIT_PROMPT_CLEAN="" 10 | 11 | # See http://geoff.greer.fm/lscolors/ 12 | export LSCOLORS="exfxcxdxbxbxbxbxbxbxbx" 13 | export LS_COLORS="di=34;40:ln=35;40:so=32;40:pi=33;40:ex=31;40:bd=31;40:cd=31;40:su=31;40:sg=31;40:tw=31;40:ow=31;40:" 14 | 15 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /themes/obraun.zsh-theme: -------------------------------------------------------------------------------- 1 | if [ "$(whoami)" = "root" ]; then CARETCOLOR="red"; else CARETCOLOR="blue"; fi 2 | 3 | local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" 4 | 5 | PROMPT='%{$fg[green]%}[%*]%{$reset_color%} %{$fg_no_bold[cyan]%}%n %{${fg_bold[blue]}%}::%{$reset_color%} %{$fg[yellow]%}%m%{$reset_color%} %{$fg_no_bold[magenta]%} ➜ %{$reset_color%} %{${fg[green]}%}%3~ $(git_prompt_info)%{${fg_bold[$CARETCOLOR]}%}»%{${reset_color}%} ' 6 | 7 | RPS1="${return_code}" 8 | 9 | ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[red]%}‹" 10 | ZSH_THEME_GIT_PROMPT_SUFFIX="› %{$reset_color%}" 11 | 12 | -------------------------------------------------------------------------------- /themes/tjkirch_mod.zsh-theme: -------------------------------------------------------------------------------- 1 | ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[green]%}" 2 | ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" 3 | ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}⚡" 4 | ZSH_THEME_GIT_PROMPT_CLEAN="" 5 | 6 | function prompt_char { 7 | if [ $UID -eq 0 ]; then echo "%{$fg[red]%}#%{$reset_color%}"; else echo $; fi 8 | } 9 | 10 | PROMPT='%(?,,%{$fg[red]%}FAIL: $?%{$reset_color%} 11 | )%{$fg[magenta]%}%n%{$reset_color%}@%{$fg[yellow]%}%m%{$reset_color%}: %{$fg_bold[blue]%}%~%{$reset_color%}$(git_prompt_info) %_$(prompt_char) ' 12 | 13 | RPROMPT='%{$fg[green]%}[%*]%{$reset_color%}' 14 | -------------------------------------------------------------------------------- /plugins/themes/themes.plugin.zsh: -------------------------------------------------------------------------------- 1 | function theme 2 | { 3 | if [ "$1" = "random" ]; then 4 | themes=($ZSH/themes/*zsh-theme) 5 | N=${#themes[@]} 6 | ((N=(RANDOM%N)+1)) 7 | RANDOM_THEME=${themes[$N]} 8 | source "$RANDOM_THEME" 9 | echo "[oh-my-zsh] Random theme '$RANDOM_THEME' loaded..." 10 | else 11 | if [ -f "$ZSH_CUSTOM/$1.zsh-theme" ] 12 | then 13 | source "$ZSH_CUSTOM/$1.zsh-theme" 14 | else 15 | source "$ZSH/themes/$1.zsh-theme" 16 | fi 17 | fi 18 | } 19 | 20 | function lstheme 21 | { 22 | cd $ZSH/themes 23 | ls *zsh-theme | sed 's,\.zsh-theme$,,' 24 | } 25 | -------------------------------------------------------------------------------- /themes/dst.zsh-theme: -------------------------------------------------------------------------------- 1 | 2 | ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[green]%}" 3 | ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" 4 | ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}!" 5 | ZSH_THEME_GIT_PROMPT_CLEAN="" 6 | 7 | function prompt_char { 8 | if [ $UID -eq 0 ]; then echo "%{$fg[red]%}#%{$reset_color%}"; else echo $; fi 9 | } 10 | 11 | PROMPT='%(?, ,%{$fg[red]%}FAIL%{$reset_color%} 12 | ) 13 | %{$fg[magenta]%}%n%{$reset_color%}@%{$fg[yellow]%}%m%{$reset_color%}: %{$fg_bold[blue]%}%~%{$reset_color%}$(git_prompt_info) 14 | %_ $(prompt_char) ' 15 | 16 | RPROMPT='%{$fg[green]%}[%*]%{$reset_color%}' 17 | -------------------------------------------------------------------------------- /themes/tjkirch.zsh-theme: -------------------------------------------------------------------------------- 1 | ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[green]%}" 2 | ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" 3 | ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}⚡" 4 | ZSH_THEME_GIT_PROMPT_CLEAN="" 5 | 6 | function prompt_char { 7 | if [ $UID -eq 0 ]; then echo "%{$fg[red]%}#%{$reset_color%}"; else echo $; fi 8 | } 9 | 10 | PROMPT='%(?, ,%{$fg[red]%}FAIL: $?%{$reset_color%} 11 | ) 12 | %{$fg[magenta]%}%n%{$reset_color%}@%{$fg[yellow]%}%m%{$reset_color%}: %{$fg_bold[blue]%}%~%{$reset_color%}$(git_prompt_info) 13 | %_$(prompt_char) ' 14 | 15 | RPROMPT='%{$fg[green]%}[%*]%{$reset_color%}' 16 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /plugins/jake-node/jake-node.plugin.zsh: -------------------------------------------------------------------------------- 1 | #---oh-my-zsh plugin : task Autocomplete for Jake tool--- 2 | # Jake : https://github.com/mde/jake 3 | # Warning : Jakefile should have the right case : Jakefile or jakefile 4 | # Tested on : MacOSX 10.7 (Lion), Ubuntu 11.10 5 | # Author : Alexandre Lacheze (@al3xstrat) 6 | # Inspiration : http://weblog.rubyonrails.org/2006/3/9/fast-rake-task-completion-for-zsh 7 | 8 | function _jake () { 9 | if [ -f Jakefile ]||[ -f jakefile ]; then 10 | compadd `jake -T | cut -d " " -f 2 | sed -E "s/.\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"` 11 | fi 12 | } 13 | 14 | compdef _jake jake -------------------------------------------------------------------------------- /plugins/cp/cp.plugin.zsh: -------------------------------------------------------------------------------- 1 | #Show progress while file is copying 2 | 3 | # Rsync options are: 4 | # -p - preserve permissions 5 | # -o - preserve owner 6 | # -g - preserve group 7 | # -h - output in human-readable format 8 | # --progress - display progress 9 | # -b - instead of just overwriting an existing file, save the original 10 | # --backup-dir=/tmp/rsync - move backup copies to "/tmp/rsync" 11 | # -e /dev/null - only work on local files 12 | # -- - everything after this is an argument, even if it looks like an option 13 | 14 | alias cpv="rsync -poghb --backup-dir=/tmp/rsync -e /dev/null --progress --" 15 | -------------------------------------------------------------------------------- /plugins/lighthouse/lighthouse.plugin.zsh: -------------------------------------------------------------------------------- 1 | # To use: add a .lighthouse file into your directory with the URL to the 2 | # individual project. For example: 3 | # https://rails.lighthouseapp.com/projects/8994 4 | # Example usage: http://screencast.com/t/ZDgwNDUwNT 5 | open_lighthouse_ticket () { 6 | if [ ! -f .lighthouse-url ]; then 7 | echo "There is no .lighthouse-url file in the current directory..." 8 | return 0; 9 | else 10 | lighthouse_url=$(cat .lighthouse-url); 11 | echo "Opening ticket #$1"; 12 | `open $lighthouse_url/tickets/$1`; 13 | fi 14 | } 15 | 16 | alias lho='open_lighthouse_ticket' 17 | -------------------------------------------------------------------------------- /plugins/rails/rails.plugin.zsh: -------------------------------------------------------------------------------- 1 | alias ss='thin --stats "/thin/stats" start' 2 | alias sg='ruby script/generate' 3 | alias sd='ruby script/destroy' 4 | alias sp='ruby script/plugin' 5 | alias sr='ruby script/runner' 6 | alias ssp='ruby script/spec' 7 | alias rdbm='rake db:migrate' 8 | alias rdbtp='rake db:test:prepare' 9 | alias migrate='rake db:migrate && rake db:test:prepare' 10 | alias sc='ruby script/console' 11 | alias sd='ruby script/server --debugger' 12 | alias devlog='tail -f log/development.log' 13 | 14 | function remote_console() { 15 | /usr/bin/env ssh $1 "( cd $2 && ruby script/console production )" 16 | } 17 | -------------------------------------------------------------------------------- /plugins/git-remote-branch/git-remote-branch.plugin.zsh: -------------------------------------------------------------------------------- 1 | _git_remote_branch() { 2 | ref=$(git symbolic-ref HEAD 2> /dev/null) 3 | if [[ -n $ref ]]; then 4 | if (( CURRENT == 2 )); then 5 | # first arg: operation 6 | compadd create publish rename delete track 7 | elif (( CURRENT == 3 )); then 8 | # second arg: remote branch name 9 | compadd `git branch -r | grep -v HEAD | sed "s/.*\///" | sed "s/ //g"` 10 | elif (( CURRENT == 4 )); then 11 | # third arg: remote name 12 | compadd `git remote` 13 | fi 14 | else; 15 | _files 16 | fi 17 | } 18 | compdef _git_remote_branch grb 19 | -------------------------------------------------------------------------------- /plugins/vundle/vundle.plugin.zsh: -------------------------------------------------------------------------------- 1 | function vundle-init () { 2 | if [ ! -d ~/.vim/bundle/vundle/ ] 3 | then 4 | mkdir -p ~/.vim/bundle/vundle/ 5 | fi 6 | 7 | if [ ! -d ~/.vim/bundle/vundle/.git/ ] 8 | then 9 | git clone http://github.com/gmarik/vundle.git ~/.vim/bundle/vundle 10 | echo "\n\tRead about vim configuration for vundle at https://github.com/gmarik/vundle\n" 11 | fi 12 | } 13 | 14 | function vundle () { 15 | vundle-init 16 | vim -c "execute \"BundleInstall\" | q | q" 17 | } 18 | 19 | 20 | function vundle-update () { 21 | vundle-init 22 | vim -c "execute \"BundleInstall!\" | q | q" 23 | } 24 | -------------------------------------------------------------------------------- /themes/dpoggi.zsh-theme: -------------------------------------------------------------------------------- 1 | if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="green"; fi 2 | local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" 3 | 4 | PROMPT='%{$fg[$NCOLOR]%}%n%{$reset_color%}@%{$fg[cyan]%}%m\ 5 | %{$reset_color%}:%{$fg[magenta]%}%~\ 6 | $(git_prompt_info) \ 7 | %{$fg[red]%}%(!.#.»)%{$reset_color%} ' 8 | PROMPT2='%{$fg[red]%}\ %{$reset_color%}' 9 | RPS1='${return_code}' 10 | 11 | ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}(" 12 | ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%}○%{$reset_color%}" 13 | ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}⚡%{$reset_color%}" 14 | ZSH_THEME_GIT_PROMPT_SUFFIX="%{$fg[yellow]%})%{$reset_color%}" 15 | -------------------------------------------------------------------------------- /themes/theunraveler.zsh-theme: -------------------------------------------------------------------------------- 1 | # Comment 2 | 3 | PROMPT='%{$fg[magenta]%}[%c] %{$reset_color%}' 4 | 5 | RPROMPT='%{$fg[magenta]%}$(git_prompt_info)%{$reset_color%} $(git_prompt_status)%{$reset_color%}' 6 | 7 | ZSH_THEME_GIT_PROMPT_PREFIX="" 8 | ZSH_THEME_GIT_PROMPT_SUFFIX="" 9 | ZSH_THEME_GIT_PROMPT_DIRTY="" 10 | ZSH_THEME_GIT_PROMPT_CLEAN="" 11 | ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[cyan]%} ✈" 12 | ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[yellow]%} ✭" 13 | ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%} ✗" 14 | ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[blue]%} ➦" 15 | ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[magenta]%} ✂" 16 | ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[grey]%} ✱" -------------------------------------------------------------------------------- /plugins/colemak/colemak.plugin.zsh: -------------------------------------------------------------------------------- 1 | # ctrl-j newline 2 | bindkey '^n' accept-line 3 | bindkey -a '^n' accept-line 4 | 5 | # another rotation to match qwerty 6 | bindkey -a 'n' down-line-or-history 7 | bindkey -a 'e' up-line-or-history 8 | bindkey -a 'i' vi-forward-char 9 | 10 | # make qwerty 11 | bindkey -a 'k' vi-repeat-search 12 | bindkey -a 'K' vi-rev-repeat-search 13 | bindkey -a 'u' vi-insert 14 | bindkey -a 'U' vi-insert-bol 15 | bindkey -a 'l' vi-undo-change 16 | bindkey -a 'N' vi-join 17 | 18 | # spare 19 | bindkey -a 'j' vi-forward-word-end 20 | bindkey -a 'J' vi-forward-blank-word-end 21 | 22 | lesskey $ZSH_CUSTOM/plugins/colemak/colemak-less 23 | -------------------------------------------------------------------------------- /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/jreese.zsh-theme: -------------------------------------------------------------------------------- 1 | # ZSH Theme - Preview: http://dl.dropbox.com/u/1552408/Screenshots/2010-04-08-oh-my-zsh.png 2 | 3 | if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="green"; fi 4 | local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" 5 | 6 | PROMPT='%{$fg[$NCOLOR]%}%n%{$fg[green]%}@%m%{$reset_color%} %~ \ 7 | $(git_prompt_info)\ 8 | %{$fg[red]%}%(!.#.»)%{$reset_color%} ' 9 | PROMPT2='%{$fg[red]%}\ %{$reset_color%}' 10 | RPS1='${return_code}' 11 | 12 | ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}±%{$fg[yellow]%}" 13 | ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} " 14 | ZSH_THEME_GIT_PROMPT_CLEAN="" 15 | ZSH_THEME_GIT_PROMPT_DIRTY="⚡" 16 | 17 | -------------------------------------------------------------------------------- /themes/sporty_256.zsh-theme: -------------------------------------------------------------------------------- 1 | # zsh theme requires 256 color enabled terminal 2 | # i.e TERM=xterm-256color 3 | # Preview - http://www.flickr.com/photos/adelcampo/4556482563/sizes/o/ 4 | # based on robbyrussell's shell but louder! 5 | 6 | PROMPT='%{$fg_bold[blue]%}$(git_prompt_info) %F{208}%c%f 7 | %{$fg_bold[white]%}%# %{$reset_color%}' 8 | RPROMPT='%B%F{208}%n%f%{$fg_bold[white]%}@%F{039}%m%f%{$reset_color%}' 9 | 10 | ZSH_THEME_GIT_PROMPT_PREFIX="%F{154}±|%f%F{124}" 11 | ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" 12 | ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}%B✘%b%F{154}|%f%{$reset_color%}" 13 | ZSH_THEME_GIT_PROMPT_CLEAN=" %{$fg[green]%}✔%F{154}|" 14 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /themes/gozilla.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="(" 4 | ZSH_THEME_GIT_PROMPT_SUFFIX=")" 5 | ZSH_THEME_GIT_PROMPT_DIRTY="" 6 | ZSH_THEME_GIT_PROMPT_CLEAN="" 7 | 8 | RPROMPT='$(git_prompt_status)%{$reset_color%}' 9 | 10 | ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[cyan]%} ✈" 11 | ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[yellow]%} ✭" 12 | ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%} ✗" 13 | ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[blue]%} ➦" 14 | ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[magenta]%} ✂" 15 | ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[grey]%} ✱" 16 | -------------------------------------------------------------------------------- /themes/zhann.zsh-theme: -------------------------------------------------------------------------------- 1 | PROMPT='%{$fg_bold[green]%}%p %{$fg[cyan]%}%c%{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}' 2 | 3 | if which rvm-prompt &> /dev/null; then 4 | RPROMPT='%{$reset_color%} %{$fg[red]%}$(~/.rvm/bin/rvm-prompt i v g) %{$reset_color%}' 5 | else 6 | if which rbenv &> /dev/null; then 7 | RPROMPT='%{$reset_color%} %{$fg[red]%}$(rbenv version | sed -e "s/ (set.*$//") %{$reset_color%}' 8 | fi 9 | fi 10 | 11 | 12 | ZSH_THEME_GIT_PROMPT_PREFIX=" (%{$fg[red]%}" 13 | ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" 14 | ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗%{$reset_color%}" 15 | ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})" 16 | -------------------------------------------------------------------------------- /plugins/gpg-agent/gpg-agent.plugin.zsh: -------------------------------------------------------------------------------- 1 | # Based on ssh-agent code 2 | 3 | local GPG_ENV=$HOME/.gnupg/gpg-agent.env 4 | 5 | function start_agent { 6 | /usr/bin/env gpg-agent --daemon --enable-ssh-support --write-env-file ${GPG_ENV} > /dev/null 7 | chmod 600 ${GPG_ENV} 8 | . ${GPG_ENV} > /dev/null 9 | } 10 | 11 | # Source GPG agent settings, if applicable 12 | if [ -f "${GPG_ENV}" ]; then 13 | . ${GPG_ENV} > /dev/null 14 | ps -ef | grep ${SSH_AGENT_PID} | grep gpg-agent > /dev/null || { 15 | start_agent; 16 | } 17 | else 18 | start_agent; 19 | fi 20 | 21 | export GPG_AGENT_INFO 22 | export SSH_AUTH_SOCK 23 | export SSH_AGENT_PID 24 | 25 | GPG_TTY=$(tty) 26 | export GPG_TTY 27 | -------------------------------------------------------------------------------- /themes/murilasso.zsh-theme: -------------------------------------------------------------------------------- 1 | local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" 2 | local user_host='%{$terminfo[bold]$fg[green]%}%n@%m%{$reset_color%}' 3 | local current_dir='%{$terminfo[bold]$fg[blue]%}%~%{$reset_color%}' 4 | local rvm_ruby='%{$fg[red]%}$(rvm_prompt_info || rbenv_prompt_info)%{$reset_color%}' 5 | local git_branch='%{$fg[blue]%}$(git_prompt_info)%{$reset_color%}' 6 | 7 | PROMPT="${user_host}:${current_dir} ${rvm_ruby} 8 | ${git_branch} %B$%b " 9 | RPS1="${return_code}" 10 | 11 | ZSH_THEME_GIT_PROMPT_PREFIX="" 12 | ZSH_THEME_GIT_PROMPT_SUFFIX="" 13 | ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}✗%{$reset_color%}" 14 | ZSH_THEME_GIT_PROMPT_CLEAN=" %{$fg[green]%}✔%{$reset_color%}" 15 | -------------------------------------------------------------------------------- /plugins/ant/ant.plugin.zsh: -------------------------------------------------------------------------------- 1 | stat -f%m . > /dev/null 2>&1 2 | if [ "$?" = 0 ]; then 3 | stat_cmd=(stat -f%m) 4 | else 5 | stat_cmd=(stat -L --format=%Y) 6 | fi 7 | 8 | _ant_does_target_list_need_generating () { 9 | if [ ! -f .ant_targets ]; then return 0; 10 | else 11 | accurate=$($stat_cmd .ant_targets) 12 | changed=$($stat_cmd build.xml) 13 | return $(expr $accurate '>=' $changed) 14 | fi 15 | } 16 | 17 | _ant () { 18 | if [ -f build.xml ]; then 19 | if _ant_does_target_list_need_generating; then 20 | sed -n '/ .ant_targets 21 | fi 22 | compadd `cat .ant_targets` 23 | fi 24 | } 25 | 26 | compdef _ant ant 27 | -------------------------------------------------------------------------------- /themes/minimal.zsh-theme: -------------------------------------------------------------------------------- 1 | ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[white]%}[" 2 | ZSH_THEME_GIT_PROMPT_SUFFIX="" 3 | ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}●%{$reset_color%}]%{$reset_color%} " 4 | ZSH_THEME_GIT_PROMPT_CLEAN="]%{$reset_color%} " 5 | ZSH_THEME_SVN_PROMPT_PREFIX=$ZSH_THEME_GIT_PROMPT_PREFIX 6 | ZSH_THEME_SVN_PROMPT_SUFFIX=$ZSH_THEME_GIT_PROMPT_SUFFIX 7 | ZSH_THEME_SVN_PROMPT_DIRTY=$ZSH_THEME_GIT_PROMPT_DIRTY 8 | ZSH_THEME_SVN_PROMPT_CLEAN=$ZSH_THEME_GIT_PROMPT_CLEAN 9 | 10 | vcs_status() { 11 | if [[ ( $(whence in_svn) != "" ) && ( $(in_svn) == 1 ) ]]; then 12 | svn_prompt_info 13 | else 14 | git_prompt_info 15 | fi 16 | } 17 | 18 | PROMPT='%2~ $(vcs_status)»%b ' -------------------------------------------------------------------------------- /themes/macovsky.zsh-theme: -------------------------------------------------------------------------------- 1 | # ZSH Theme - Preview: http://gyazo.com/8becc8a7ed5ab54a0262a470555c3eed.png 2 | local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" 3 | 4 | if which rvm-prompt &> /dev/null; then 5 | PROMPT='%{$fg[green]%}%~%{$reset_color%} %{$fg[red]%}‹$(~/.rvm/bin/rvm-prompt i v)› %{$reset_color%} $(git_prompt_info)%{$reset_color%}%B$%b ' 6 | else 7 | if which rbenv &> /dev/null; then 8 | PROMPT='%{$fg[green]%}%~%{$reset_color%} %{$fg[red]%}‹$(rbenv version | sed -e "s/ (set.*$//")› %{$reset_color%} $(git_prompt_info)%{$reset_color%}%B$%b ' 9 | fi 10 | fi 11 | RPS1="${return_code}" 12 | 13 | ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}‹" 14 | ZSH_THEME_GIT_PROMPT_SUFFIX="› %{$reset_color%}" 15 | -------------------------------------------------------------------------------- /themes/macovsky-ruby.zsh-theme: -------------------------------------------------------------------------------- 1 | # ZSH Theme - Preview: http://gyazo.com/8becc8a7ed5ab54a0262a470555c3eed.png 2 | local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" 3 | 4 | if which rvm-prompt &> /dev/null; then 5 | PROMPT='%{$fg[green]%}%~%{$reset_color%} %{$fg[red]%}‹$(~/.rvm/bin/rvm-prompt i v)› %{$reset_color%} $(git_prompt_info)%{$reset_color%}%B$%b ' 6 | else 7 | if which rbenv &> /dev/null; then 8 | PROMPT='%{$fg[green]%}%~%{$reset_color%} %{$fg[red]%}‹$(rbenv version | sed -e "s/ (set.*$//")› %{$reset_color%} $(git_prompt_info)%{$reset_color%}%B$%b ' 9 | fi 10 | fi 11 | 12 | RPS1="${return_code}" 13 | 14 | ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}‹" 15 | ZSH_THEME_GIT_PROMPT_SUFFIX="› %{$reset_color%}" 16 | -------------------------------------------------------------------------------- /plugins/compleat/compleat.plugin.zsh: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------------ 2 | # FILE: compleat.plugin.zsh 3 | # DESCRIPTION: oh-my-zsh plugin file. 4 | # AUTHOR: Sorin Ionescu (sorin.ionescu@gmail.com) 5 | # VERSION: 1.0.0 6 | # ------------------------------------------------------------------------------ 7 | 8 | if (( ${+commands[compleat]} )); then 9 | local prefix="${commands[compleat]:h:h}" 10 | local setup="${prefix}/share/compleat-1.0/compleat_setup" 11 | 12 | if [[ -f "$setup" ]]; then 13 | if ! bashcompinit >/dev/null 2>&1; then 14 | autoload -U bashcompinit 15 | bashcompinit -i 16 | fi 17 | 18 | source "$setup" 19 | fi 20 | fi 21 | -------------------------------------------------------------------------------- /themes/flazz.zsh-theme: -------------------------------------------------------------------------------- 1 | if [ "$(whoami)" = "root" ] 2 | then CARETCOLOR="red" 3 | else CARETCOLOR="blue" 4 | fi 5 | 6 | local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" 7 | 8 | PROMPT='%m%{${fg_bold[magenta]}%} :: %{$reset_color%}%{${fg[green]}%}%3~ $(git_prompt_info)%{${fg_bold[$CARETCOLOR]}%}%#%{${reset_color}%} ' 9 | 10 | RPS1='$(vi_mode_prompt_info) ${return_code}' 11 | 12 | ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[cyan]%}‹" 13 | ZSH_THEME_GIT_PROMPT_SUFFIX="› %{$reset_color%}" 14 | 15 | MODE_INDICATOR="%{$fg_bold[magenta]%}<%{$reset_color%}%{$fg[magenta]%}<<%{$reset_color%}" 16 | 17 | # TODO use 265 colors 18 | #MODE_INDICATOR="$FX[bold]$FG[020]<$FX[no_bold]%{$fg[blue]%}<<%{$reset_color%}" 19 | # TODO use two lines if git 20 | -------------------------------------------------------------------------------- /plugins/sublime/sublime.plugin.zsh: -------------------------------------------------------------------------------- 1 | # Sublime Text 2 Aliases 2 | #unamestr = 'uname' 3 | 4 | local _sublime_darwin_subl=/Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl 5 | 6 | if [[ $('uname') == 'Linux' ]]; then 7 | if [ -f '/usr/bin/sublime_text' ]; then 8 | st_run() { nohup /usr/bin/sublime_text $@ > /dev/null & } 9 | else 10 | st_run() { nohup /usr/bin/sublime-text $@ > /dev/null & } 11 | fi 12 | alias st=st_run 13 | elif [[ $('uname') == 'Darwin' ]]; then 14 | # Check if Sublime is installed in user's home application directory 15 | if [[ -a $HOME/${_sublime_darwin_subl} ]]; then 16 | alias st='$HOME/${_sublime_darwin_subl}' 17 | else 18 | alias st='${_sublime_darwin_subl}' 19 | fi 20 | fi 21 | alias stt='st .' 22 | -------------------------------------------------------------------------------- /themes/dstufft.zsh-theme: -------------------------------------------------------------------------------- 1 | function prompt_char { 2 | git branch >/dev/null 2>/dev/null && echo '±' && return 3 | hg root >/dev/null 2>/dev/null && echo 'Hg' && return 4 | echo '○' 5 | } 6 | 7 | function virtualenv_info { 8 | [ $VIRTUAL_ENV ] && echo '('`basename $VIRTUAL_ENV`') ' 9 | } 10 | 11 | PROMPT=' 12 | %{$fg[magenta]%}%n%{$reset_color%} at %{$fg[yellow]%}%m%{$reset_color%} in %{$fg_bold[green]%}${PWD/#$HOME/~}%{$reset_color%}$(git_prompt_info) 13 | $(virtualenv_info)$(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_UNTRACKED="%{$fg[green]%}?" 19 | ZSH_THEME_GIT_PROMPT_CLEAN="" 20 | -------------------------------------------------------------------------------- /themes/re5et.zsh-theme: -------------------------------------------------------------------------------- 1 | if [ "$(whoami)" = "root" ]; then CARETCOLOR="red"; else CARETCOLOR="magenta"; fi 2 | 3 | local return_code="%(?..%{$fg_bold[red]%}:( %?%{$reset_color%})" 4 | 5 | PROMPT=' 6 | %{$fg_bold[cyan]%}%n%{$reset_color%}%{$fg[yellow]%}@%{$reset_color%}%{$fg_bold[blue]%}%m%{$reset_color%}:%{${fg_bold[green]}%}%~%{$reset_color%}$(git_prompt_info) 7 | %{${fg[$CARETCOLOR]}%}%# %{${reset_color}%}' 8 | 9 | RPS1='${return_code} %D - %*' 10 | 11 | ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[magenta]%}^%{$reset_color%}%{$fg_bold[yellow]%}" 12 | ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" 13 | ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[red]%} ±" 14 | ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[cyan]%} ?" 15 | ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg_bold[red]%} ♥" 16 | -------------------------------------------------------------------------------- /plugins/rails3/rails3.plugin.zsh: -------------------------------------------------------------------------------- 1 | # Rails 3 aliases, backwards-compatible with Rails 2. 2 | 3 | function _rails_command () { 4 | if [ -e "script/server" ]; then 5 | ruby script/$@ 6 | else 7 | ruby script/rails $@ 8 | fi 9 | } 10 | 11 | alias rc='_rails_command console' 12 | alias rd='_rails_command destroy' 13 | alias rdb='_rails_command dbconsole' 14 | alias rdbm='rake db:migrate db:test:clone' 15 | alias rg='_rails_command generate' 16 | alias rgm='_rails_command generate migration' 17 | alias rp='_rails_command plugin' 18 | alias ru='_rails_command runner' 19 | alias rs='_rails_command server' 20 | alias rsd='_rails_command server --debugger' 21 | alias devlog='tail -f log/development.log' 22 | alias rdm='rake db:migrate' 23 | alias rdr='rake db:rollback' 24 | -------------------------------------------------------------------------------- /themes/awesomepanda.zsh-theme: -------------------------------------------------------------------------------- 1 | # the svn plugin has to be activated for this to work. 2 | 3 | PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%}$(svn_prompt_info)%{$reset_color%}' 4 | 5 | ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$fg[red]%}" 6 | ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" 7 | ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%})%{$fg[yellow]%} ✗ %{$reset_color%}" 8 | ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%}) " 9 | 10 | 11 | 12 | ZSH_PROMPT_BASE_COLOR="%{$fg_bold[blue]%}" 13 | ZSH_THEME_REPO_NAME_COLOR="%{$fg_bold[red]%}" 14 | 15 | ZSH_THEME_SVN_PROMPT_PREFIX="svn:(" 16 | ZSH_THEME_SVN_PROMPT_SUFFIX=")" 17 | ZSH_THEME_SVN_PROMPT_DIRTY="%{$fg[red]%} ✘ %{$reset_color%}" 18 | ZSH_THEME_SVN_PROMPT_CLEAN=" " -------------------------------------------------------------------------------- /plugins/autojump/autojump.plugin.zsh: -------------------------------------------------------------------------------- 1 | if [ $commands[autojump] ]; then # check if autojump is installed 2 | if [ -f /usr/share/autojump/autojump.zsh ]; then # debian and ubuntu package 3 | . /usr/share/autojump/autojump.zsh 4 | elif [ -f /etc/profile.d/autojump.zsh ]; then # manual installation 5 | . /etc/profile.d/autojump.zsh 6 | elif [ -f $HOME/.autojump/etc/profile.d/autojump.zsh ]; then # manual user-local installation 7 | . $HOME/.autojump/etc/profile.d/autojump.zsh 8 | elif [ -f /opt/local/etc/profile.d/autojump.zsh ]; then # mac os x with ports 9 | . /opt/local/etc/profile.d/autojump.zsh 10 | elif [ $commands[brew] -a -f `brew --prefix`/etc/autojump.zsh ]; then # mac os x with brew 11 | . `brew --prefix`/etc/autojump.zsh 12 | fi 13 | fi 14 | -------------------------------------------------------------------------------- /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 original zsh config..." 8 | if [ -f ~/.zshrc.pre-oh-my-zsh ] || [ -h ~/.zshrc.pre-oh-my-zsh ] 9 | then 10 | echo "Found ~/.zshrc.pre-oh-my-zsh -- Restoring to ~/.zshrc"; 11 | 12 | if [ -f ~/.zshrc ] || [ -h ~/.zshrc ] 13 | then 14 | ZSHRC_SAVE=".zshrc.omz-uninstalled-`date +%Y%m%d%H%M%S`"; 15 | echo "Found ~/.zshrc -- Renaming to ~/${ZSHRC_SAVE}"; 16 | mv ~/.zshrc ~/${ZSHRC_SAVE}; 17 | fi 18 | 19 | mv ~/.zshrc.pre-oh-my-zsh ~/.zshrc; 20 | 21 | source ~/.zshrc; 22 | else 23 | echo "Switching back to bash" 24 | chsh -s /bin/bash 25 | source /etc/profile 26 | fi 27 | 28 | echo "Thanks for trying out Oh My Zsh. It's been uninstalled." 29 | -------------------------------------------------------------------------------- /themes/kolo.zsh-theme: -------------------------------------------------------------------------------- 1 | autoload -U colors && colors 2 | 3 | autoload -Uz vcs_info 4 | 5 | zstyle ':vcs_info:*' stagedstr '%F{green}●' 6 | zstyle ':vcs_info:*' unstagedstr '%F{yellow}●' 7 | zstyle ':vcs_info:*' check-for-changes true 8 | zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{11}%r' 9 | zstyle ':vcs_info:*' enable git svn 10 | theme_precmd () { 11 | if [[ -z $(git ls-files --other --exclude-standard 2> /dev/null) ]] { 12 | zstyle ':vcs_info:*' formats ' [%b%c%u%B%F{green}]' 13 | } else { 14 | zstyle ':vcs_info:*' formats ' [%b%c%u%B%F{red}●%F{green}]' 15 | } 16 | 17 | vcs_info 18 | } 19 | 20 | setopt prompt_subst 21 | PROMPT='%B%F{magenta}%c%B%F{green}${vcs_info_msg_0_}%B%F{magenta} %{$reset_color%}%% ' 22 | 23 | autoload -U add-zsh-hook 24 | add-zsh-hook precmd theme_precmd 25 | -------------------------------------------------------------------------------- /plugins/lol/lol.plugin.zsh: -------------------------------------------------------------------------------- 1 | # LOL!!1 2 | # Source: http://aur.archlinux.org/packages/lolbash/lolbash/lolbash.sh 3 | 4 | alias wtf='dmesg' 5 | alias onoz='cat /var/log/errors.log' 6 | alias rtfm='man' 7 | 8 | alias :3='echo' 9 | alias visible='echo' 10 | alias invisible='cat' 11 | alias moar='more' 12 | alias tldr='less' 13 | alias alwayz='tail -f' 14 | 15 | alias icanhas='mkdir' 16 | alias gimmeh='touch' 17 | alias donotwant='rm' 18 | alias dowant='cp' 19 | alias gtfo='mv' 20 | alias nowai='chmod' 21 | 22 | alias hai='cd' 23 | alias iz='ls' 24 | alias plz='pwd' 25 | alias ihasbucket='df -h' 26 | 27 | alias inur='locate' 28 | alias iminurbase='finger' 29 | 30 | alias btw='nice' 31 | alias obtw='nohup' 32 | 33 | alias nomz='ps aux' 34 | alias nomnom='killall' 35 | 36 | alias byes='exit' 37 | alias cya='reboot' 38 | alias kthxbai='halt' 39 | -------------------------------------------------------------------------------- /themes/bira.zsh-theme: -------------------------------------------------------------------------------- 1 | # ZSH Theme - Preview: http://gyazo.com/8becc8a7ed5ab54a0262a470555c3eed.png 2 | local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" 3 | 4 | local user_host='%{$terminfo[bold]$fg[green]%}%n@%m%{$reset_color%}' 5 | local current_dir='%{$terminfo[bold]$fg[blue]%} %~%{$reset_color%}' 6 | local rvm_ruby='' 7 | if which rvm-prompt &> /dev/null; then 8 | rvm_ruby='%{$fg[red]%}‹$(rvm-prompt i v g)›%{$reset_color%}' 9 | else 10 | if which rbenv &> /dev/null; then 11 | rvm_ruby='%{$fg[red]%}‹$(rbenv version | sed -e "s/ (set.*$//")›%{$reset_color%}' 12 | fi 13 | fi 14 | local git_branch='$(git_prompt_info)%{$reset_color%}' 15 | 16 | PROMPT="╭─${user_host} ${current_dir} ${rvm_ruby} ${git_branch} 17 | ╰─%B$%b " 18 | RPS1="${return_code}" 19 | 20 | ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}‹" 21 | ZSH_THEME_GIT_PROMPT_SUFFIX="› %{$reset_color%}" 22 | -------------------------------------------------------------------------------- /plugins/last-working-dir/last-working-dir.plugin.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | # Keeps track of the last used working directory and automatically jumps 3 | # into it for new shells. 4 | 5 | # Flag indicating if we've previously jumped to last directory. 6 | typeset -g ZSH_LAST_WORKING_DIRECTORY 7 | mkdir -p "$ZSH/cache" 8 | local cache_file="$ZSH/cache/last-working-dir" 9 | 10 | # Updates the last directory once directory is changed. 11 | function chpwd() { 12 | echo "$PWD" > "$cache_file" 13 | } 14 | 15 | # Changes directory to the last working directory. 16 | function lwd() { 17 | [[ ! -r "$cache_file" ]] || cd `cat "$cache_file"` 18 | } 19 | 20 | # Automatically jump to last working directory unless this isn't the first time 21 | # this plugin has been loaded. 22 | if [[ -z "$ZSH_LAST_WORKING_DIRECTORY" ]]; then 23 | lwd 2>/dev/null && ZSH_LAST_WORKING_DIRECTORY=1 || true 24 | fi 25 | -------------------------------------------------------------------------------- /lib/spectrum.zsh: -------------------------------------------------------------------------------- 1 | #! /bin/zsh 2 | # A script to make using 256 colors in zsh less painful. 3 | # P.C. Shyamshankar 4 | # Copied from http://github.com/sykora/etc/blob/master/zsh/functions/spectrum/ 5 | 6 | typeset -Ag FX FG BG 7 | 8 | FX=( 9 | reset "%{%}" 10 | bold "%{%}" no-bold "%{%}" 11 | italic "%{%}" no-italic "%{%}" 12 | underline "%{%}" no-underline "%{%}" 13 | blink "%{%}" no-blink "%{%}" 14 | reverse "%{%}" no-reverse "%{%}" 15 | ) 16 | 17 | for color in {000..255}; do 18 | FG[$color]="%{[38;5;${color}m%}" 19 | BG[$color]="%{[48;5;${color}m%}" 20 | done 21 | 22 | # Show all 256 colors with color number 23 | function spectrum_ls() { 24 | for code in {000..255}; do 25 | print -P -- "$code: %F{$code}Test%f" 26 | done 27 | } 28 | 29 | -------------------------------------------------------------------------------- /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 | alias d='dirs -v | head -10' 40 | -------------------------------------------------------------------------------- /themes/sunaku.zsh-theme: -------------------------------------------------------------------------------- 1 | # Git-centric variation of the "fishy" theme. 2 | # See screenshot at http://ompldr.org/vOHcwZg 3 | 4 | ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[green]%}+" 5 | ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[magenta]%}!" 6 | ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%}-" 7 | ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[blue]%}>" 8 | ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[cyan]%}#" 9 | ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[yellow]%}?" 10 | 11 | ZSH_THEME_GIT_PROMPT_PREFIX="" 12 | ZSH_THEME_GIT_PROMPT_SUFFIX=" " 13 | ZSH_THEME_GIT_PROMPT_DIRTY="" 14 | ZSH_THEME_GIT_PROMPT_CLEAN="" 15 | 16 | local user_color='green' 17 | test $UID -eq 0 && user_color='red' 18 | 19 | PROMPT='%(?..%{$fg_bold[red]%}exit %? 20 | %{$reset_color%})'\ 21 | '%{$bold_color%}$(git_prompt_status)%{$reset_color%}'\ 22 | '$(git_prompt_info)'\ 23 | '%{$fg[$user_color]%}%~%{$reset_color%}'\ 24 | '%(!.#.>) ' 25 | 26 | PROMPT2='%{$fg[red]%}\ %{$reset_color%}' 27 | -------------------------------------------------------------------------------- /themes/SpotSpecific.zsh-theme: -------------------------------------------------------------------------------- 1 | if [ "$(whoami)" = "root" ] 2 | then CARETCOLOR="red" 3 | else CARETCOLOR="blue" 4 | fi 5 | 6 | local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" 7 | 8 | PROMPT='%{${fg[green]}%}${USER}%{${fg[yellow]}%}@%{${fg[blue]}%}%m%{${fg[magenta]}%}ᐉ %{$reset_color%}%{${fg[green]}%}%3~ %{${fg_bold[$CARETCOLOR]}%}%#%{${reset_color}%} ' 9 | 10 | RPS1=' ${return_code} $(git_prompt_info)' 11 | 12 | ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[blue]%}git:‹%{$fg_bold[cyan]%}" 13 | ZSH_THEME_GIT_PROMPT_SUFFIX="%{$fg[blue]%}›%{$reset_color%}" 14 | ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%} %{$fg[red]%}✗%{$reset_color%}" 15 | ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%}" 16 | 17 | MODE_INDICATOR="%{$fg_bold[magenta]%}<%{$reset_color%}%{$fg[magenta]%}<<%{$reset_color%}" 18 | 19 | # TODO use 265 colors 20 | #MODE_INDICATOR="$FX[bold]$FG[020]<$FX[no_bold]%{$fg[blue]%}<<%{$reset_color%}" 21 | # TODO use two lines if git 22 | -------------------------------------------------------------------------------- /themes/takashiyoshida.zsh-theme: -------------------------------------------------------------------------------- 1 | # 2 | # PROMPT 3 | # 4 | PROMPT_BRACKET_BEGIN='%{$fg_bold[white]%}[' 5 | PROMPT_HOST='%{$fg_bold[cyan]%}%m' 6 | PROMPT_SEPARATOR='%{$reset_color%}:' 7 | PROMPT_DIR='%{$fg_bold[yellow]%}%c' 8 | PROMPT_BRACKET_END='%{$fg_bold[white]%}]' 9 | 10 | PROMPT_USER='%{$fg_bold[white]%}%n' 11 | PROMPT_SIGN='%{$reset_color%}%#' 12 | 13 | GIT_PROMPT_INFO='$(git_prompt_info)' 14 | 15 | # My current prompt looks like: 16 | # [host:current_dir] (git_prompt_info) 17 | # [username]% 18 | PROMPT="${PROMPT_BRACKET_BEGIN}${PROMPT_HOST}${PROMPT_SEPARATOR}${PROMPT_DIR}${PROMPT_BRACKET_END}${GIT_PROMPT_INFO} 19 | ${PROMPT_BRACKET_BEGIN}${PROMPT_USER}${PROMPT_BRACKET_END}${PROMPT_SIGN} " 20 | 21 | # 22 | # Git repository 23 | # 24 | ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[magenta]%}" 25 | ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" 26 | ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%}!" 27 | ZSH_THEME_GIT_PROMPT_CLEAN='' 28 | -------------------------------------------------------------------------------- /plugins/yum/yum.plugin.zsh: -------------------------------------------------------------------------------- 1 | ## Aliases 2 | 3 | alias ys="yum search" # search package 4 | alias yp="yum info" # show package info 5 | alias yl="yum list" # list packages 6 | alias ygl="yum grouplist" # list package groups 7 | alias yli="yum list installed" # print all installed packages 8 | alias ymc="yum makecache" # rebuilds the yum package list 9 | 10 | alias yu="sudo yum update" # upgrate packages 11 | alias yi="sudo yum install" # install package 12 | alias ygi="sudo yum groupinstall" # install package group 13 | alias yr="sudo yum remove" # remove package 14 | alias ygr="sudo yum groupremove" # remove pagage group 15 | alias yrl="sudo yum remove --remove-leaves" # remove package and leaves 16 | alias yc="sudo yum clean all" # clean cache -------------------------------------------------------------------------------- /themes/rixius.zsh-theme: -------------------------------------------------------------------------------- 1 | # /|/ Code by Stephen 2 | # /|/ "Rixius" Middleton 3 | # 4 | # name in folder (github) 5 | # ± if in github repo, or ≥ if otherwise Time in 24-hour format is on right. 6 | function collapse_pwd { 7 | echo $(pwd | sed -e "s,^$HOME,~,") 8 | } 9 | function prompt_char { 10 | echo -n "%{$bg[white]%}%{$fg[red]%}" 11 | git branch >/dev/null 2>/dev/null && echo "±%{$reset_color%}" && return 12 | echo "≥%{$reset_color%}" 13 | } 14 | RIXIUS_PRE="%{$bg[white]%}%{$fg[red]%}" 15 | 16 | PROMPT=' 17 | %{$RIXIUS_PRE%}%n%{$reset_color%} in %{$fg_bold[green]%}$(collapse_pwd)%{$reset_color%}$(git_prompt_info) 18 | $(prompt_char) ' 19 | RPROMPT='%{$RIXIUS_PRE%}%T%{$reset_color%}' 20 | 21 | ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[magenta]%}" 22 | ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" 23 | ZSH_THEME_GIT_PROMPT_DIRTY=" %{$RIXIUS_PRE%}!%{$reset_color%}" 24 | ZSH_THEME_GIT_PROMPT_CLEAN=" %{$RIXIUS_PRE%}√%{$reset_color%}" 25 | -------------------------------------------------------------------------------- /plugins/taskwarrior/taskwarrior.plugin.zsh: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # Author: Pete Clark 3 | # Email: pete[dot]clark[at]gmail[dot]com 4 | # Version: 0.1 (05/24/2011) 5 | # License: WTFPL 6 | # 7 | # This oh-my-zsh plugin adds smart tab completion for 8 | # TaskWarrior. It uses the zsh tab completion 9 | # script (_task) distributed with TaskWarrior for the completion definitions. 10 | # 11 | # Typing task[tabtab] will give you a list of current tasks, task 66[tabtab] 12 | # gives a list of available modifications for that task, etc. 13 | ################################################################################ 14 | 15 | zstyle ':completion:*:*:task:*' verbose yes 16 | zstyle ':completion:*:*:task:*:descriptions' format '%U%B%d%b%u' 17 | 18 | zstyle ':completion:*:*:task:*' group-name '' 19 | 20 | alias t=task 21 | compdef _task t=task 22 | -------------------------------------------------------------------------------- /themes/frisk.zsh-theme: -------------------------------------------------------------------------------- 1 | PROMPT=$' 2 | %{$fg[blue]%}%/%{$reset_color%} $(git_prompt_info)$(bzr_prompt_info)%{$fg[white]%}[%n@%m]%{$reset_color%} %{$fg[white]%}[%T]%{$reset_color%} 3 | %{$fg_bold[black]%}>%{$reset_color%} ' 4 | 5 | PROMPT2="%{$fg_blod[black]%}%_> %{$reset_color%}" 6 | 7 | GIT_CB="git::" 8 | ZSH_THEME_SCM_PROMPT_PREFIX="%{$fg[green]%}[" 9 | ZSH_THEME_GIT_PROMPT_PREFIX=$ZSH_THEME_SCM_PROMPT_PREFIX$GIT_CB 10 | ZSH_THEME_GIT_PROMPT_SUFFIX="]%{$reset_color%} " 11 | ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}*%{$fg[green]%}" 12 | ZSH_THEME_GIT_PROMPT_CLEAN="" 13 | 14 | ## Bazaar integration 15 | bzr_prompt_info() { 16 | BZR_CB=`bzr nick 2> /dev/null | grep -v "ERROR" | cut -d ":" -f2 | awk -F / '{print "bzr::"$1}'` 17 | if [ -n "$BZR_CB" ]; then 18 | BZR_DIRTY="" 19 | [[ -n `bzr status` ]] && BZR_DIRTY="%{$fg[red]%} *%{$reset_color%}" 20 | echo "$ZSH_THEME_SCM_PROMPT_PREFIX$BZR_CB$BZR_DIRTY$ZSH_THEME_GIT_PROMPT_SUFFIX" 21 | fi 22 | } 23 | -------------------------------------------------------------------------------- /plugins/cake/cake.plugin.zsh: -------------------------------------------------------------------------------- 1 | # Set this to 1 if you want to cache the tasks 2 | _cake_cache_task_list=1 3 | 4 | # Cache filename 5 | _cake_task_cache_file='.cake_task_cache' 6 | 7 | _cake_get_target_list () { 8 | cake | grep '^cake ' | sed -e "s/cake \([^ ]*\) .*/\1/" | grep -v '^$' 9 | } 10 | 11 | _cake_does_target_list_need_generating () { 12 | 13 | if [ ${_cake_cache_task_list} -eq 0 ]; then 14 | return 1; 15 | fi 16 | 17 | if [ ! -f ${_cake_task_cache_file} ]; then return 0; 18 | else 19 | accurate=$(stat -f%m $_cake_task_cache_file) 20 | changed=$(stat -f%m Cakefile) 21 | return $(expr $accurate '>=' $changed) 22 | fi 23 | } 24 | 25 | _cake () { 26 | if [ -f Cakefile ]; then 27 | if _cake_does_target_list_need_generating; then 28 | _cake_get_target_list > ${_cake_task_cache_file} 29 | compadd `cat ${_cake_task_cache_file}` 30 | else 31 | compadd `_cake_get_target_list` 32 | fi 33 | fi 34 | } 35 | 36 | compdef _cake cake -------------------------------------------------------------------------------- /themes/apple.zsh-theme: -------------------------------------------------------------------------------- 1 | function toon { 2 | echo -n "" 3 | } 4 | 5 | get_git_dirty() { 6 | git diff --quiet || echo '*' 7 | } 8 | 9 | autoload -Uz vcs_info 10 | autoload -U colors && colors 11 | zstyle ':vcs_info:*' check-for-changes true 12 | zstyle ':vcs_info:*' unstagedstr '%F{red}*' # display this when there are unstaged changes 13 | zstyle ':vcs_info:*' stagedstr '%F{yellow}+' # display this when there are staged changes 14 | zstyle ':vcs_info:*' actionformats \ 15 | '%F{5}%F{5}[%F{2}%b%F{3}|%F{1}%a%c%u%F{5}]%f ' 16 | zstyle ':vcs_info:*' formats \ 17 | '%F{5}%F{5}[%F{2}%b%c%u%F{5}]%f ' 18 | zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r' 19 | zstyle ':vcs_info:*' enable git cvs svn 20 | 21 | theme_precmd () { 22 | vcs_info 23 | } 24 | 25 | setopt prompt_subst 26 | PROMPT='%{$fg[magenta]%}$(toon)%{$reset_color%} %~/ %{$reset_color%}${vcs_info_msg_0_}%{$reset_color%}' 27 | 28 | autoload -U add-zsh-hook 29 | add-zsh-hook precmd theme_precmd -------------------------------------------------------------------------------- /themes/mikeh.zsh-theme: -------------------------------------------------------------------------------- 1 | setopt prompt_subst 2 | autoload colors 3 | colors 4 | 5 | autoload -U add-zsh-hook 6 | autoload -Uz vcs_info 7 | 8 | # check-for-changes can be really slow. 9 | # you should disable it, if you work with large repositories 10 | zstyle ':vcs_info:*:prompt:*' check-for-changes true 11 | 12 | add-zsh-hook precmd mikeh_precmd 13 | 14 | mikeh_precmd() { 15 | vcs_info 16 | } 17 | 18 | # user, host, full path, and time/date 19 | # on two lines for easier vgrepping 20 | # entry in a nice long thread on the Arch Linux forums: http://bbs.archlinux.org/viewtopic.php?pid=521888#p521888 21 | 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%} 22 | %{\e[0;34m%}%B..%B[%{\e[1;35m%}$%{\e[0;34m%}%B] <($vcs_info_msg_0_)>%{\e[0m%}%b ' 23 | PS2=$' \e[0;34m%}%B>%{\e[0m%}%b ' -------------------------------------------------------------------------------- /themes/eastwood.zsh-theme: -------------------------------------------------------------------------------- 1 | #RVM settings 2 | if [[ -s ~/.rvm/scripts/rvm ]] ; then 3 | RPS1="%{$fg[yellow]%}rvm:%{$reset_color%}%{$fg[red]%}\$(~/.rvm/bin/rvm-prompt)%{$reset_color%} $EPS1" 4 | else 5 | if which rbenv &> /dev/null; then 6 | RPS1="%{$fg[yellow]%}rbenv:%{$reset_color%}%{$fg[red]%}\$(rbenv version | sed -e 's/ (set.*$//')%{$reset_color%} $EPS1" 7 | fi 8 | fi 9 | 10 | ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[green]%}[" 11 | ZSH_THEME_GIT_PROMPT_SUFFIX="]%{$reset_color%}" 12 | ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}*%{$reset_color%}" 13 | ZSH_THEME_GIT_PROMPT_CLEAN="" 14 | 15 | #Customized git status, oh-my-zsh currently does not allow render dirty status before branch 16 | git_custom_status() { 17 | local cb=$(current_branch) 18 | if [ -n "$cb" ]; then 19 | echo "$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_PREFIX$(current_branch)$ZSH_THEME_GIT_PROMPT_SUFFIX" 20 | fi 21 | } 22 | 23 | PROMPT='$(git_custom_status)%{$fg[cyan]%}[%~% ]%{$reset_color%}%B$%b ' 24 | -------------------------------------------------------------------------------- /plugins/gas/_gas: -------------------------------------------------------------------------------- 1 | #compdef gas 2 | 3 | local curcontext="$curcontext" state line cmds ret=1 4 | 5 | _arguments -C \ 6 | '(- 1 *)'{-v,--version}'[display version information]' \ 7 | '(-h|--help)'{-h,--help}'[show help information]' \ 8 | '1: :->cmds' \ 9 | '*: :->args' && ret=0 10 | 11 | case $state in 12 | cmds) 13 | cmds=( 14 | "version:Prints Gas's version" 15 | "use:Uses author" 16 | "show:Shows your current user" 17 | "list:Lists your authors" 18 | "import:Imports current user to gasconfig" 19 | "help:Describe available tasks or one specific task" 20 | "delete:Deletes author" 21 | "add:Adds author to gasconfig" 22 | ) 23 | _describe -t commands 'gas command' cmds && ret=0 24 | ;; 25 | args) 26 | case $line[1] in 27 | (use|delete) 28 | _values -S , 'authors' $(cat ~/.gas | sed -n -e 's/^\[\(.*\)\]/\1/p') && ret=0 29 | ;; 30 | esac 31 | ;; 32 | esac 33 | 34 | return ret 35 | -------------------------------------------------------------------------------- /plugins/composer/composer.plugin.zsh: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------------ 2 | # FILE: composer.plugin.zsh 3 | # DESCRIPTION: oh-my-zsh composer plugin file. 4 | # AUTHOR: Daniel Gomes (me@danielcsgomes.com) 5 | # VERSION: 1.0.0 6 | # ------------------------------------------------------------------------------ 7 | 8 | # Composer basic command completion 9 | _composer_get_command_list () { 10 | composer --no-ansi | sed "1,/Available commands/d" | awk '/^ [a-z]+/ { print $1 }' 11 | } 12 | 13 | _composer () { 14 | if [ -f composer.json ]; then 15 | compadd `_composer_get_command_list` 16 | fi 17 | } 18 | 19 | compdef _composer composer 20 | 21 | # Aliases 22 | alias c='composer' 23 | alias csu='composer self-update' 24 | alias cu='composer update' 25 | alias ci='composer install' 26 | alias ccp='composer create-project' 27 | 28 | # install composer in the current directory 29 | alias cget='curl -s https://getcomposer.org/installer | php' -------------------------------------------------------------------------------- /themes/gallois.zsh-theme: -------------------------------------------------------------------------------- 1 | ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[green]%}[" 2 | ZSH_THEME_GIT_PROMPT_SUFFIX="]%{$reset_color%}" 3 | ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}*%{$reset_color%}" 4 | ZSH_THEME_GIT_PROMPT_CLEAN="" 5 | 6 | #Customized git status, oh-my-zsh currently does not allow render dirty status before branch 7 | git_custom_status() { 8 | local cb=$(current_branch) 9 | if [ -n "$cb" ]; then 10 | echo "$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_PREFIX$(current_branch)$ZSH_THEME_GIT_PROMPT_SUFFIX" 11 | fi 12 | } 13 | 14 | #RVM and git settings 15 | if [[ -s ~/.rvm/scripts/rvm ]] ; then 16 | RPS1='$(git_custom_status)%{$fg[red]%}[`~/.rvm/bin/rvm-prompt`]%{$reset_color%} $EPS1' 17 | else 18 | if which rbenv &> /dev/null; then 19 | RPS1='$(git_custom_status)%{$fg[red]%}[`rbenv version | sed -e "s/ (set.*$//"`]%{$reset_color%} $EPS1' 20 | else 21 | RPS1='$(git_custom_status) $EPS1' 22 | fi 23 | fi 24 | 25 | PROMPT='%{$fg[cyan]%}[%~% ]%(?.%{$fg[green]%}.%{$fg[red]%})%B$%b ' 26 | -------------------------------------------------------------------------------- /themes/lukerandall.zsh-theme: -------------------------------------------------------------------------------- 1 | # ZSH Theme - Preview: http://cl.ly/f701d00760f8059e06dc 2 | # Thanks to gallifrey, upon whose theme this is based 3 | 4 | local return_code="%(?..%{$fg_bold[red]%}%? ↵%{$reset_color%})" 5 | 6 | function my_git_prompt_info() { 7 | ref=$(git symbolic-ref HEAD 2> /dev/null) || return 8 | GIT_STATUS=$(git_prompt_status) 9 | [[ -n $GIT_STATUS ]] && GIT_STATUS=" $GIT_STATUS" 10 | echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$GIT_STATUS$ZSH_THEME_GIT_PROMPT_SUFFIX" 11 | } 12 | 13 | PROMPT='%{$fg_bold[green]%}%n@%m%{$reset_color%} %{$fg_bold[blue]%}%2~%{$reset_color%} $(my_git_prompt_info)%{$reset_color%}%B»%b ' 14 | RPS1="${return_code}" 15 | 16 | ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}(" 17 | ZSH_THEME_GIT_PROMPT_SUFFIX=") %{$reset_color%}" 18 | ZSH_THEME_GIT_PROMPT_UNTRACKED="%%" 19 | ZSH_THEME_GIT_PROMPT_ADDED="+" 20 | ZSH_THEME_GIT_PROMPT_MODIFIED="*" 21 | ZSH_THEME_GIT_PROMPT_RENAMED="~" 22 | ZSH_THEME_GIT_PROMPT_DELETED="!" 23 | ZSH_THEME_GIT_PROMPT_UNMERGED="?" 24 | 25 | -------------------------------------------------------------------------------- /themes/fishy.zsh-theme: -------------------------------------------------------------------------------- 1 | # ZSH Theme emulating the Fish shell's default prompt. 2 | 3 | _fishy_collapsed_wd() { 4 | echo $(pwd | perl -pe "s|^$HOME|~|g; s|/([^/])[^/]*(?=/)|/\$1|g") 5 | } 6 | 7 | local user_color='green'; [ $UID -eq 0 ] && user_color='red' 8 | PROMPT='%n@%m %{$fg[$user_color]%}$(_fishy_collapsed_wd)%{$reset_color%}%(!.#.>) ' 9 | PROMPT2='%{$fg[red]%}\ %{$reset_color%}' 10 | 11 | local return_status="%{$fg_bold[red]%}%(?..%?)%{$reset_color%}" 12 | RPROMPT='${return_status}$(git_prompt_info)$(git_prompt_status)%{$reset_color%}' 13 | 14 | ZSH_THEME_GIT_PROMPT_PREFIX=" " 15 | ZSH_THEME_GIT_PROMPT_SUFFIX="" 16 | ZSH_THEME_GIT_PROMPT_DIRTY="" 17 | ZSH_THEME_GIT_PROMPT_CLEAN="" 18 | 19 | ZSH_THEME_GIT_PROMPT_ADDED="%{$fg_bold[green]%}+" 20 | ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg_bold[blue]%}!" 21 | ZSH_THEME_GIT_PROMPT_DELETED="%{$fg_bold[red]%}-" 22 | ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg_bold[magenta]%}>" 23 | ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg_bold[yellow]%}#" 24 | ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg_bold[cyan]%}?" 25 | -------------------------------------------------------------------------------- /tools/upgrade.sh: -------------------------------------------------------------------------------- 1 | current_path=`pwd` 2 | printf '\033[0;34m%s\033[0m\n' "Upgrading Oh My Zsh" 3 | cd $ZSH 4 | 5 | if git pull origin master 6 | then 7 | printf '\033[0;32m%s\033[0m\n' ' __ __ ' 8 | printf '\033[0;32m%s\033[0m\n' ' ____ / /_ ____ ___ __ __ ____ _____/ /_ ' 9 | printf '\033[0;32m%s\033[0m\n' ' / __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \ ' 10 | printf '\033[0;32m%s\033[0m\n' '/ /_/ / / / / / / / / / / /_/ / / /_(__ ) / / / ' 11 | printf '\033[0;32m%s\033[0m\n' '\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ ' 12 | printf '\033[0;32m%s\033[0m\n' ' /____/ ' 13 | printf '\033[0;34m%s\033[0m\n' 'Hooray! Oh My Zsh has been updated and/or is at the current version.' 14 | printf '\033[0;34m%s\033[1m%s\033[0m\n' 'To keep up on the latest, be sure to follow Oh My Zsh on twitter: ' 'http://twitter.com/ohmyzsh' 15 | else 16 | printf '\033[0;31m%s\033[0m\n' 'There was an error updating. Try again later?' 17 | fi 18 | 19 | cd "$current_path" -------------------------------------------------------------------------------- /themes/nebirhos.zsh-theme: -------------------------------------------------------------------------------- 1 | # Based on robbyrussell's theme, with host and rvm indicators. Example: 2 | # @host ➜ currentdir rvm:(rubyversion@gemset) git:(branchname) 3 | 4 | # Get the current ruby version in use with RVM: 5 | if [ -e ~/.rvm/bin/rvm-prompt ]; then 6 | RUBY_PROMPT_="%{$fg_bold[blue]%}rvm:(%{$fg[green]%}\$(~/.rvm/bin/rvm-prompt s i v g)%{$fg_bold[blue]%})%{$reset_color%} " 7 | else 8 | if which rbenv &> /dev/null; then 9 | RUBY_PROMPT_="%{$fg_bold[blue]%}rbenv:(%{$fg[green]%}\$(rbenv version | sed -e 's/ (set.*$//')%{$fg_bold[blue]%})%{$reset_color%} " 10 | fi 11 | fi 12 | 13 | # Get the host name (first 4 chars) 14 | HOST_PROMPT_="%{$fg_bold[red]%}@$HOST[0,4] ➜ %{$fg_bold[cyan]%}%c " 15 | GIT_PROMPT="%{$fg_bold[blue]%}\$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}" 16 | PROMPT="$HOST_PROMPT_$RUBY_PROMPT_$GIT_PROMPT" 17 | 18 | ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$fg[red]%}" 19 | ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" 20 | ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗%{$reset_color%}" 21 | ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})" 22 | -------------------------------------------------------------------------------- /themes/superjarin.zsh-theme: -------------------------------------------------------------------------------- 1 | # Grab the current version of ruby in use (via RVM): [ruby-1.8.7] 2 | if which rvm-prompt &> /dev/null; then 3 | JARIN_CURRENT_RUBY_="%{$fg[white]%}[%{$fg[red]%}\$(~/.rvm/bin/rvm-prompt i v)%{$fg[white]%}]%{$reset_color%}" 4 | else 5 | if which rbenv &> /dev/null; then 6 | JARIN_CURRENT_RUBY_="%{$fg[white]%}[%{$fg[red]%}\$(rbenv version | sed -e 's/ (set.*$//')%{$fg[white]%}]%{$reset_color%}" 7 | fi 8 | fi 9 | 10 | # Grab the current filepath, use shortcuts: ~/Desktop 11 | # Append the current git branch, if in a git repository 12 | JARIN_CURRENT_LOCA_="%{$fg_bold[cyan]%}%~\$(git_prompt_info)%{$reset_color%}" 13 | ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[white]%} <%{$fg[magenta]%}" 14 | ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" 15 | 16 | # Do nothing if the branch is clean (no changes). 17 | ZSH_THEME_GIT_PROMPT_CLEAN="%{$reset_color%}>" 18 | 19 | # Add a yellow ✗ if the branch is dirty 20 | ZSH_THEME_GIT_PROMPT_DIRTY="%{$reset_color%}> %{$fg[yellow]%}✗" 21 | 22 | # Put it all together! 23 | PROMPT="$JARIN_CURRENT_RUBY_ $JARIN_CURRENT_LOCA_ " 24 | 25 | -------------------------------------------------------------------------------- /plugins/vi-mode/vi-mode.plugin.zsh: -------------------------------------------------------------------------------- 1 | # Ensures that $terminfo values are valid and updates editor information when 2 | # the keymap changes. 3 | function zle-keymap-select zle-line-init zle-line-finish { 4 | # The terminal must be in application mode when ZLE is active for $terminfo 5 | # values to be valid. 6 | if (( ${+terminfo[smkx]} )); then 7 | printf '%s' ${terminfo[smkx]} 8 | fi 9 | if (( ${+terminfo[rmkx]} )); then 10 | printf '%s' ${terminfo[rmkx]} 11 | fi 12 | 13 | zle reset-prompt 14 | zle -R 15 | } 16 | 17 | zle -N zle-line-init 18 | zle -N zle-line-finish 19 | zle -N zle-keymap-select 20 | 21 | bindkey -v 22 | 23 | # if mode indicator wasn't setup by theme, define default 24 | if [[ "$MODE_INDICATOR" == "" ]]; then 25 | MODE_INDICATOR="%{$fg_bold[red]%}<%{$fg[red]%}<<%{$reset_color%}" 26 | fi 27 | 28 | function vi_mode_prompt_info() { 29 | echo "${${KEYMAP/vicmd/$MODE_INDICATOR}/(main|viins)/}" 30 | } 31 | 32 | # define right prompt, if it wasn't defined by a theme 33 | if [[ "$RPS1" == "" && "$RPROMPT" == "" ]]; then 34 | RPS1='$(vi_mode_prompt_info)' 35 | fi 36 | -------------------------------------------------------------------------------- /themes/blinks.zsh-theme: -------------------------------------------------------------------------------- 1 | # https://github.com/blinks zsh theme 2 | 3 | function _prompt_char() { 4 | if $(git rev-parse --is-inside-work-tree >/dev/null 2>&1); then 5 | echo "%{%F{blue}%}±%{%f%k%b%}" 6 | else 7 | echo ' ' 8 | fi 9 | } 10 | 11 | # This theme works with both the "dark" and "light" variants of the 12 | # Solarized color schema. Set the SOLARIZED_THEME variable to one of 13 | # these two values to choose. If you don't specify, we'll assume you're 14 | # using the "dark" variant. 15 | 16 | case ${SOLARIZED_THEME:-dark} in 17 | light) bkg=white;; 18 | *) bkg=black;; 19 | esac 20 | 21 | ZSH_THEME_GIT_PROMPT_PREFIX=" [%{%B%F{blue}%}" 22 | ZSH_THEME_GIT_PROMPT_SUFFIX="%{%f%k%b%K{${bkg}}%B%F{green}%}]" 23 | ZSH_THEME_GIT_PROMPT_DIRTY=" %{%F{red}%}*%{%f%k%b%}" 24 | ZSH_THEME_GIT_PROMPT_CLEAN="" 25 | 26 | PROMPT='%{%f%k%b%} 27 | %{%K{${bkg}}%B%F{green}%}%n%{%B%F{blue}%}@%{%B%F{cyan}%}%m%{%B%F{green}%} %{%b%F{yellow}%K{${bkg}}%}%~%{%B%F{green}%}$(git_prompt_info)%E%{%f%k%b%} 28 | %{%K{${bkg}}%}$(_prompt_char)%{%K{${bkg}}%} %#%{%f%k%b%} ' 29 | 30 | RPROMPT='!%{%B%F{cyan}%}%!%{%f%k%b%}' 31 | -------------------------------------------------------------------------------- /themes/humza.zsh-theme: -------------------------------------------------------------------------------- 1 | # ZSH THEME Preview: https://skitch.com/huyy/rk979/humza.zshtheme 2 | 3 | let TotalBytes=0 4 | for Bytes in $(ls -l | grep "^-" | awk '{ print $5 }') 5 | do 6 | let TotalBytes=$TotalBytes+$Bytes 7 | done 8 | # should it say b, kb, Mb, or Gb 9 | if [ $TotalBytes -lt 1024 ]; then 10 | TotalSize=$(echo -e "scale=3 \n$TotalBytes \nquit" | bc) 11 | suffix="b" 12 | elif [ $TotalBytes -lt 1048576 ]; then 13 | TotalSize=$(echo -e "scale=3 \n$TotalBytes/1024 \nquit" | bc) 14 | suffix="kb" 15 | elif [ $TotalBytes -lt 1073741824 ]; then 16 | TotalSize=$(echo -e "scale=3 \n$TotalBytes/1048576 \nquit" | bc) 17 | suffix="Mb" 18 | else 19 | TotalSize=$(echo -e "scale=3 \n$TotalBytes/1073741824 \nquit" | bc) 20 | suffix="Gb" 21 | fi 22 | 23 | PROMPT='%{$reset_color%}%n %{$fg[green]%}{%{$reset_color%}%~%{$fg[green]%}}%{$reset_color%}$(git_prompt_info) greetings, earthling %{$fg[green]%}[%{$reset_color%}%{$TotalSize%}%{$suffix%}%{$fg[green]%}]%{$fg[red]%}$%{$reset_color%} ☞ ' 24 | 25 | ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[red]%}±(" 26 | ZSH_THEME_GIT_PROMPT_SUFFIX=");%{$reset_color%}" 27 | -------------------------------------------------------------------------------- /plugins/wakeonlan/README: -------------------------------------------------------------------------------- 1 | This plugin provides a wrapper around the "wakeonlan" tool available from most 2 | distributions' package repositories, or from the following website: 3 | 4 | http://gsd.di.uminho.pt/jpo/software/wakeonlan/ 5 | 6 | In order to use this wrapper, create the ~/.wakeonlan directory, and place in 7 | that directory one file for each device you would like to be able to wake. Give 8 | the file a name that describes the device, such as its hostname. Each file 9 | should contain a line with the mac address of the target device and the network 10 | broadcast address. 11 | 12 | For instance, there might be a file ~/.wakeonlan/leto with the following 13 | contents: 14 | 15 | 00:11:22:33:44:55:66 192.168.0.255 16 | 17 | To wake that device, use the following command: 18 | 19 | # wake leto 20 | 21 | The available device names will be autocompleted, so: 22 | 23 | # wake 24 | 25 | ...will suggest "leto", along with any other configuration files that were 26 | placed in the ~/.wakeonlan directory. 27 | 28 | For more information regarding the configuration file format, check the 29 | wakeonlan man page. 30 | -------------------------------------------------------------------------------- /themes/af-magic.zsh-theme: -------------------------------------------------------------------------------- 1 | # af-magic.zsh-theme 2 | # 3 | # Author: Andy Fleming 4 | # URL: http://andyfleming.com/ 5 | # Repo: https://github.com/andyfleming/oh-my-zsh 6 | # Direct Link: https://github.com/andyfleming/oh-my-zsh/blob/master/themes/af-magic.zsh-theme 7 | # 8 | # Created on: June 19, 2012 9 | # Last modified on: June 20, 2012 10 | 11 | 12 | 13 | if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="green"; fi 14 | local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" 15 | 16 | # primary prompt 17 | PROMPT='$FG[237]------------------------------------------------------------%{$reset_color%} 18 | $FG[032]%~\ 19 | $(git_prompt_info) \ 20 | $FG[105]%(!.#.»)%{$reset_color%} ' 21 | PROMPT2='%{$fg[red]%}\ %{$reset_color%}' 22 | RPS1='${return_code}' 23 | 24 | 25 | # color vars 26 | eval my_gray='$FG[237]' 27 | eval my_orange='$FG[214]' 28 | 29 | # right prompt 30 | RPROMPT='$my_gray%n@%m%{$reset_color%}%' 31 | 32 | # git settings 33 | ZSH_THEME_GIT_PROMPT_PREFIX="$FG[075](branch:" 34 | ZSH_THEME_GIT_PROMPT_CLEAN="" 35 | ZSH_THEME_GIT_PROMPT_DIRTY="$my_orange*%{$reset_color%}" 36 | ZSH_THEME_GIT_PROMPT_SUFFIX="$FG[075])%{$reset_color%}" 37 | -------------------------------------------------------------------------------- /themes/alanpeabody.zsh-theme: -------------------------------------------------------------------------------- 1 | 2 | local user='%{$fg[magenta]%}%n@%{$fg[magenta]%}%m%{$reset_color%}' 3 | local pwd='%{$fg[blue]%}%~%{$reset_color%}' 4 | local rvm='' 5 | if which rvm-prompt &> /dev/null; then 6 | rvm='%{$fg[green]%}‹$(rvm-prompt i v g)›%{$reset_color%}' 7 | else 8 | if which rbenv &> /dev/null; then 9 | rvm='%{$fg[green]%}‹$(rbenv version | sed -e "s/ (set.*$//")›%{$reset_color%}' 10 | fi 11 | fi 12 | local return_code='%(?..%{$fg[red]%}%? ↵%{$reset_color%})' 13 | local git_branch='$(git_prompt_status)%{$reset_color%}$(git_prompt_info)%{$reset_color%}' 14 | 15 | ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}" 16 | ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" 17 | ZSH_THEME_GIT_PROMPT_DIRTY="" 18 | ZSH_THEME_GIT_PROMPT_CLEAN="" 19 | 20 | ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[green]%} ✚" 21 | ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[blue]%} ✹" 22 | ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%} ✖" 23 | ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[magenta]%} ➜" 24 | ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[yellow]%} ═" 25 | ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[cyan]%} ✭" 26 | 27 | PROMPT="${user} ${pwd}$ " 28 | RPROMPT="${return_code} ${git_branch} ${rvm}" 29 | -------------------------------------------------------------------------------- /themes/intheloop.zsh-theme: -------------------------------------------------------------------------------- 1 | # ZSH theme by James Smith (http://loopj.com) 2 | # A multiline prompt with username, hostname, full path, return status, git branch, git dirty status, git remote status 3 | 4 | local return_status="%{$fg[red]%}%(?..⏎)%{$reset_color%}" 5 | 6 | local host_color="green" 7 | if [ -n "$SSH_CLIENT" ]; then 8 | local host_color="red" 9 | fi 10 | 11 | PROMPT=' 12 | %{$fg_bold[grey]%}[%{$reset_color%}%{$fg_bold[${host_color}]%}%n@%m%{$reset_color%}%{$fg_bold[grey]%}]%{$reset_color%} %{$fg_bold[blue]%}%10c%{$reset_color%} $(git_prompt_info) $(git_remote_status) 13 | %{$fg_bold[cyan]%}❯%{$reset_color%} ' 14 | 15 | 16 | RPROMPT='${return_status}%{$reset_color%}' 17 | 18 | ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[grey]%}(%{$fg[red]%}" 19 | ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" 20 | ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[grey]%}) %{$fg[yellow]%}⚡%{$reset_color%}" 21 | ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[grey]%})" 22 | ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE="%{$fg_bold[magenta]%}↓%{$reset_color%}" 23 | ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE="%{$fg_bold[magenta]%}↑%{$reset_color%}" 24 | ZSH_THEME_GIT_PROMPT_DIVERGED_REMOTE="%{$fg_bold[magenta]%}↕%{$reset_color%}" -------------------------------------------------------------------------------- /plugins/pj/pj.plugin.zsh: -------------------------------------------------------------------------------- 1 | #!/bin/zsh 2 | 3 | # 4 | # Original idea by DefV (Jan De Poorter) 5 | # Source: https://gist.github.com/pjaspers/368394#comment-1016 6 | # 7 | # Usage: 8 | # - Set `$PROJECT_PATHS` in your ~/.zshrc 9 | # e.g.: PROJECT_PATHS=(~/src ~/work) 10 | # - In ZSH you now can open a project directory with the command: `pj my-project` 11 | # the plugin will locate the `my-project` directory in one of the $PROJECT_PATHS 12 | # Also tab completion is supported. 13 | # - `pjo my-project` will open the directory in $EDITOR 14 | # 15 | 16 | function pj() { 17 | cmd="cd" 18 | file=$1 19 | 20 | if [[ "open" == "$file" ]] then 21 | file=$2 22 | cmd=(${(s: :)EDITOR}) 23 | fi 24 | 25 | for project in $PROJECT_PATHS; do 26 | if [[ -d $project/$file ]] then 27 | $cmd "$project/$file" 28 | unset project # Unset project var 29 | return 30 | fi 31 | done 32 | 33 | echo "No such project $1" 34 | } 35 | 36 | alias pjo="pj open" 37 | 38 | function _pj () { 39 | compadd `/bin/ls -l $PROJECT_PATHS 2>/dev/null | awk '{ print $9 }'` 40 | } 41 | 42 | compdef _pj pj 43 | -------------------------------------------------------------------------------- /lib/theme-and-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 -G' 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 | -------------------------------------------------------------------------------- /plugins/terminitor/_terminitor: -------------------------------------------------------------------------------- 1 | #compdef terminitor 2 | #autoload 3 | 4 | # terminitor zsh completion 5 | 6 | _terminitor_available_scripts() { 7 | scripts=(`for SCRIPT in ~/.config/terminitor/*.term ; do basename $SCRIPT .term ; done`) 8 | } 9 | 10 | local -a _1st_arguments 11 | _1st_arguments=( 12 | 'create:create a Termfile in directory' 13 | 'delete:delete terminitor script' 14 | 'edit:open termitor script' 15 | 'fetch:clone the designated repo and run setup' 16 | 'help:Describe available tasks or one specific task' 17 | 'init:create initial root terminitor folder' 18 | 'list:lists all terminitor scripts' 19 | 'setup:execute setup in the terminitor script' 20 | 'start:runs the terminitor script' 21 | 'update:update Terminitor to new global path(.config/.terminitor)' 22 | ) 23 | 24 | local expl 25 | 26 | _arguments \ 27 | '*:: :->subcmds' && return 0 28 | 29 | if (( CURRENT == 1 )); then 30 | _describe -t commands "terminitor task" _1st_arguments 31 | return 32 | fi 33 | 34 | case "$words[1]" in 35 | start|edit|delete|setup) 36 | _terminitor_available_scripts 37 | _wanted scripts expl 'installed scripts' compadd -a scripts ;; 38 | esac 39 | -------------------------------------------------------------------------------- /themes/muse.zsh-theme: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | #local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" 3 | 4 | setopt promptsubst 5 | 6 | autoload -U add-zsh-hook 7 | 8 | PROMPT_SUCCESS_COLOR=$FG[117] 9 | PROMPT_FAILURE_COLOR=$FG[124] 10 | PROMPT_VCS_INFO_COLOR=$FG[242] 11 | PROMPT_PROMPT=$FG[077] 12 | GIT_DIRTY_COLOR=$FG[133] 13 | GIT_CLEAN_COLOR=$FG[118] 14 | GIT_PROMPT_INFO=$FG[012] 15 | 16 | PROMPT='%{$PROMPT_SUCCESS_COLOR%}%~%{$reset_color%} %{$GIT_PROMPT_INFO%}$(git_prompt_info)%{$GIT_DIRTY_COLOR%}$(git_prompt_status) %{$reset_color%}%{$PROMPT_PROMPT%}ᐅ%{$reset_color%} ' 17 | 18 | #RPS1="${return_code}" 19 | 20 | ZSH_THEME_GIT_PROMPT_PREFIX="(" 21 | ZSH_THEME_GIT_PROMPT_SUFFIX="%{$GIT_PROMPT_INFO%})" 22 | ZSH_THEME_GIT_PROMPT_DIRTY=" %{$GIT_DIRTY_COLOR%}✘" 23 | ZSH_THEME_GIT_PROMPT_CLEAN=" %{$GIT_CLEAN_COLOR%}✔" 24 | 25 | ZSH_THEME_GIT_PROMPT_ADDED="%{$FG[082]%}✚%{$reset_color%}" 26 | ZSH_THEME_GIT_PROMPT_MODIFIED="%{$FG[166]%}✹%{$reset_color%}" 27 | ZSH_THEME_GIT_PROMPT_DELETED="%{$FG[160]%}✖%{$reset_color%}" 28 | ZSH_THEME_GIT_PROMPT_RENAMED="%{$FG[220]%}➜%{$reset_color%}" 29 | ZSH_THEME_GIT_PROMPT_UNMERGED="%{$FG[082]%}═%{$reset_color%}" 30 | ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$FG[190]%}✭%{$reset_color%}" 31 | -------------------------------------------------------------------------------- /plugins/jira/jira.plugin.zsh: -------------------------------------------------------------------------------- 1 | # To use: add a .jira-url file in the base of your project 2 | # You can also set JIRA_URL in your .zshrc or put .jira-url in your home directory 3 | # .jira-url in the current directory takes precedence 4 | # 5 | # If you use Rapid Board, set: 6 | #JIRA_RAPID_BOARD="yes" 7 | # in you .zshrc 8 | # 9 | # Setup: cd to/my/project 10 | # echo "https://name.jira.com" >> .jira-url 11 | # Usage: jira # opens a new issue 12 | # jira ABC-123 # Opens an existing issue 13 | open_jira_issue () { 14 | if [ -f .jira-url ]; then 15 | jira_url=$(cat .jira-url) 16 | elif [ -f ~/.jira-url ]; then 17 | jira_url=$(cat ~/.jira-url) 18 | elif [[ "x$JIRA_URL" != "x" ]]; then 19 | jira_url=$JIRA_URL 20 | else 21 | echo "JIRA url is not specified anywhere." 22 | return 0 23 | fi 24 | 25 | if [ -z "$1" ]; then 26 | echo "Opening new issue" 27 | `open $jira_url/secure/CreateIssue!default.jspa` 28 | else 29 | echo "Opening issue #$1" 30 | if [[ "x$JIRA_RAPID_BOARD" = "yes" ]]; then 31 | `open $jira_url/issues/$1` 32 | else 33 | `open $jira_url/browse/$1` 34 | fi 35 | fi 36 | } 37 | 38 | alias jira='open_jira_issue' 39 | -------------------------------------------------------------------------------- /plugins/bundler/bundler.plugin.zsh: -------------------------------------------------------------------------------- 1 | alias be="bundle exec" 2 | alias bi="bundle install" 3 | alias bl="bundle list" 4 | alias bp="bundle package" 5 | alias bu="bundle update" 6 | 7 | # The following is based on https://github.com/gma/bundler-exec 8 | 9 | bundled_commands=(annotate cap capify cucumber foreman guard middleman nanoc rackup rainbows rake rspec ruby shotgun spec spork thin thor unicorn unicorn_rails puma zeus) 10 | 11 | ## Functions 12 | 13 | _bundler-installed() { 14 | which bundle > /dev/null 2>&1 15 | } 16 | 17 | _within-bundled-project() { 18 | local check_dir=$PWD 19 | while [ $check_dir != "/" ]; do 20 | [ -f "$check_dir/Gemfile" ] && return 21 | check_dir="$(dirname $check_dir)" 22 | done 23 | false 24 | } 25 | 26 | _run-with-bundler() { 27 | if _bundler-installed && _within-bundled-project; then 28 | bundle exec $@ 29 | else 30 | $@ 31 | fi 32 | } 33 | 34 | ## Main program 35 | for cmd in $bundled_commands; do 36 | eval "function unbundled_$cmd () { $cmd \$@ }" 37 | eval "function bundled_$cmd () { _run-with-bundler $cmd \$@}" 38 | alias $cmd=bundled_$cmd 39 | 40 | if which _$cmd > /dev/null 2>&1; then 41 | compdef _$cmd bundled_$cmd=$cmd 42 | fi 43 | done 44 | -------------------------------------------------------------------------------- /MIT-LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2009-2013 Robby Russell and contributors (see https://github.com/robbyrussell/oh-my-zsh/contributors) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /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 '%F{2}%s%F{7}:%F{2}(%F{1}%b%F{2})%f ' 7 | zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r' 8 | zstyle ':vcs_info:*' enable git 9 | 10 | add-zsh-hook precmd prompt_vcs 11 | 12 | prompt_vcs () { 13 | vcs_info 14 | 15 | if [ "${vcs_info_msg_0_}" = "" ]; then 16 | dir_status="%F{2}→%f" 17 | elif [[ $(git diff --cached --name-status 2>/dev/null ) != "" ]]; then 18 | dir_status="%F{1}▶%f" 19 | elif [[ $(git diff --name-status 2>/dev/null ) != "" ]]; then 20 | dir_status="%F{3}▶%f" 21 | else 22 | dir_status="%F{2}▶%f" 23 | fi 24 | } 25 | 26 | function { 27 | if [[ -n "$SSH_CLIENT" ]]; then 28 | PROMPT_HOST=" ($HOST)" 29 | else 30 | PROMPT_HOST='' 31 | fi 32 | } 33 | 34 | local ret_status="%(?:%{$fg_bold[green]%}Ξ:%{$fg_bold[red]%}%S↑%s%?)" 35 | 36 | PROMPT='${ret_status}%{$fg[blue]%}${PROMPT_HOST}%{$fg_bold[green]%}%p %{$fg_bold[yellow]%}%2~ ${vcs_info_msg_0_}${dir_status}%{$reset_color%} ' 37 | 38 | # vim: set ft=zsh ts=4 sw=4 et: 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:' -------------------------------------------------------------------------------- /plugins/laravel/_artisan: -------------------------------------------------------------------------------- 1 | #compdef artisan 2 | 3 | # Laravel autocompletion 4 | # Author: John Hamelink 5 | # 6 | # This plugin does the following: 7 | # - Adds aliases and autocompletion for artisan 8 | # - Adds aliases and autocompletion for bob 9 | 10 | local curcontext="$curcontext" state line _opts _bundles ret=1 11 | _arguments -C \ 12 | '1: :->cmds' \ 13 | '*:: :->args' && ret=0 14 | 15 | case $state in 16 | cmds) 17 | 18 | _values "Artisan command" \ 19 | 'session\:install[Create a session table]' \ 20 | 'migrate[Manage Migrations]' \ 21 | 'test[Run a test]' \ 22 | 'route\:\:call[Call a route in the CLI]' \ 23 | 'key\:\:generate[Generate a key]' 24 | ret=0 25 | ;; 26 | args) 27 | case $line[1] in 28 | migrate) 29 | _values \ 30 | 'install[Create the Laravel migration table' \ 31 | 'make[Create a migration]' \ 32 | 'rollback[Roll back to the last migration operation]' \ 33 | 'reset[Roll back all migrations that have ever run]' 34 | ret=0 35 | ;; 36 | esac 37 | ;; 38 | esac 39 | 40 | return ret 41 | -------------------------------------------------------------------------------- /themes/fletcherm.zsh-theme: -------------------------------------------------------------------------------- 1 | # Copied from old version of tonotdo's theme. LSCOLORS modified. 2 | PROMPT='%{$fg_no_bold[cyan]%}%n%{$fg_no_bold[magenta]%}•%{$fg_no_bold[green]%}%3~$(git_prompt_info)%{$reset_color%}» ' 3 | RPROMPT='[%*]' 4 | 5 | # git theming 6 | ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}(%{$fg_no_bold[red]%}" 7 | ZSH_THEME_GIT_PROMPT_SUFFIX="" 8 | ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg_bold[blue]%})" 9 | ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[yellow]%}⚡%{$fg_bold[blue]%})" 10 | 11 | export LSCOLORS="exfxcxdxbxegedabagacad" 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:' 13 | -------------------------------------------------------------------------------- /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 | function _upgrade_zsh() { 12 | /usr/bin/env ZSH=$ZSH /bin/sh $ZSH/tools/upgrade.sh 13 | # update the zsh file 14 | _update_zsh_update 15 | } 16 | 17 | epoch_target=$UPDATE_ZSH_DAYS 18 | if [[ -z "$epoch_target" ]]; then 19 | # Default to old behavior 20 | epoch_target=13 21 | fi 22 | 23 | if [ -f ~/.zsh-update ] 24 | then 25 | . ~/.zsh-update 26 | 27 | if [[ -z "$LAST_EPOCH" ]]; then 28 | _update_zsh_update && return 0; 29 | fi 30 | 31 | epoch_diff=$(($(_current_epoch) - $LAST_EPOCH)) 32 | if [ $epoch_diff -gt $epoch_target ] 33 | then 34 | if [ "$DISABLE_UPDATE_PROMPT" = "true" ] 35 | then 36 | _upgrade_zsh 37 | else 38 | echo "[Oh My Zsh] Would you like to check for updates?" 39 | echo "Type Y to update oh-my-zsh: \c" 40 | read line 41 | if [ "$line" = Y ] || [ "$line" = y ]; then 42 | _upgrade_zsh 43 | else 44 | _update_zsh_update 45 | fi 46 | fi 47 | fi 48 | else 49 | # create the zsh file 50 | _update_zsh_update 51 | fi 52 | 53 | -------------------------------------------------------------------------------- /plugins/zeus/README.md: -------------------------------------------------------------------------------- 1 | ## zeus 2 | **Maintainer:** [b4mboo](https://github.com/b4mboo) 3 | 4 | * `zi` aliases `zeus init` 5 | * `zinit` aliases `zeus init` 6 | 7 | * `zs` aliases `zeus start` 8 | * `ztart` aliases `zeus start` 9 | 10 | * `zc` aliases `zeus console` 11 | * `zonsole` aliases `zeus console` 12 | 13 | * `zsr` aliases `zeus server` 14 | * `zerver` aliases `zeus server` 15 | 16 | * `zr` aliases `zeus rake` 17 | * `zake` aliases `zeus rake` 18 | 19 | * `zg` aliases `zeus generate` 20 | * `zenerate` aliases `zeus generate` 21 | 22 | * `zrn` aliases `zeus runner` 23 | * `zunner` aliases `zeus runner` 24 | 25 | * `zcu` aliases `zeus cucumber` 26 | * `zucumber` aliases `zeus cucumber` 27 | 28 | * `zspec` aliases `zeus rspec` 29 | 30 | * `zt` aliases `zeus test` 31 | * `zest` aliases `zeus test` 32 | 33 | * `zu` aliases `zeus test test/unit/*` 34 | * `zunits` aliases `zeus test test/unit/*` 35 | 36 | * `zf` aliases `zeus test test/functional/*` 37 | * `zunctional` aliases `zeus test test/functional/*` 38 | 39 | * `za` aliases `zeus test test/unit/*; zeus test test/functional/; zeus cucumber` 40 | * `zall` aliases `zeus test test/unit/*; zeus test test/functional/; zeus cucumber` 41 | 42 | * `zsw` aliases `rm .zeus.sock` 43 | * `zweep` aliases `rm .zeus.sock` 44 | -------------------------------------------------------------------------------- /plugins/dirpersist/dirpersist.plugin.zsh: -------------------------------------------------------------------------------- 1 | #!/bin/zsh 2 | # 3 | # Make the dirstack more persistant 4 | # 5 | # Add dirpersist to $plugins in ~/.zshrc to load 6 | # 7 | 8 | # $zdirstore is the file used to persist the stack 9 | zdirstore=~/.zdirstore 10 | 11 | dirpersistinstall () { 12 | if grep 'dirpersiststore' ~/.zlogout > /dev/null; then 13 | else 14 | if read -q \?"Would you like to set up your .zlogout file for use with dirspersist? (y/n) "; then 15 | echo "# Store dirs stack\n# See $ZSH/plugins/dirspersist.plugin.zsh\ndirpersiststore" >> ~/.zlogout 16 | else 17 | echo "If you don't want this message to appear, remove dirspersist from \$plugins" 18 | fi 19 | fi 20 | } 21 | 22 | dirpersiststore () { 23 | dirs -p | perl -e 'foreach (reverse ) {chomp;s/([& ])/\\$1/g ;print "if [ -d $_ ]; then pushd -q $_; fi\n"}' > $zdirstore 24 | } 25 | 26 | dirpersistrestore () { 27 | if [ -f $zdirstore ]; then 28 | source $zdirstore 29 | fi 30 | } 31 | 32 | DIRSTACKSIZE=10 33 | setopt autopushd pushdminus pushdsilent pushdtohome pushdignoredups 34 | 35 | dirpersistinstall 36 | dirpersistrestore 37 | 38 | # Make popd changes permanent without having to wait for logout 39 | alias popd="popd;dirpersiststore" 40 | -------------------------------------------------------------------------------- /plugins/forklift/forklift.plugin.zsh: -------------------------------------------------------------------------------- 1 | # Open folder in ForkLift.app from console 2 | # Author: Adam Strzelecki nanoant.com, modified by Bodo Tasche bitboxer.de 3 | # 4 | # Usage: 5 | # fl [] 6 | # 7 | # Opens specified directory or current working directory in ForkLift.app 8 | # 9 | # Notes: 10 | # It assumes Shift+Cmd+G launches go to folder panel and Cmd+N opens new 11 | # app window. 12 | # 13 | # https://gist.github.com/3313481 14 | function fl { 15 | if [ ! -z "$1" ]; then 16 | DIR=$1 17 | if [ ! -d "$DIR" ]; then 18 | DIR=$(dirname $DIR) 19 | fi 20 | if [ "$DIR" != "." ]; then 21 | PWD=`cd "$DIR";pwd` 22 | fi 23 | fi 24 | osascript 2>&1 1>/dev/null </dev/null 2>/dev/null && echo '±' && return 3 | hg root >/dev/null 2>/dev/null && echo 'Hg' && return 4 | echo '○' 5 | } 6 | 7 | function virtualenv_info { 8 | [ $VIRTUAL_ENV ] && echo '('`basename $VIRTUAL_ENV`') ' 9 | } 10 | 11 | function collapse_pwd { 12 | echo $(pwd | sed -e "s,^$HOME,~,") 13 | } 14 | 15 | if which rvm-prompt &> /dev/null; then 16 | PROMPT='%{$fg[magenta]%}%n%{$reset_color%} at %{$fg[yellow]%}%m%{$reset_color%} in %{$fg_bold[green]%}${PWD/#$HOME/~}%{$reset_color%}$(git_prompt_info) using %{$reset_color%}%{$fg[red]%}$(~/.rvm/bin/rvm-prompt)%{$reset_color%} 17 | $(virtualenv_info)$(prompt_char) ' 18 | else 19 | if which rbenv &> /dev/null; then 20 | PROMPT='%{$fg[magenta]%}%n%{$reset_color%} at %{$fg[yellow]%}%m%{$reset_color%} in %{$fg_bold[green]%}${PWD/#$HOME/~}%{$reset_color%}$(git_prompt_info) using %{$reset_color%}%{$fg[red]%}$(rbenv version | sed -e "s/ (set.*$//")%{$reset_color%} 21 | $(virtualenv_info)$(prompt_char) ' 22 | fi 23 | fi 24 | 25 | 26 | ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[magenta]%}" 27 | ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" 28 | ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%}!" 29 | ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[green]%}?" 30 | ZSH_THEME_GIT_PROMPT_CLEAN="" 31 | -------------------------------------------------------------------------------- /themes/clean.zsh-theme: -------------------------------------------------------------------------------- 1 | if [ $UID -eq 0 ]; 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 | -------------------------------------------------------------------------------- /themes/josh.zsh-theme: -------------------------------------------------------------------------------- 1 | grey='\e[0;90m' 2 | 3 | ZSH_THEME_GIT_PROMPT_PREFIX="%{$grey%}(" 4 | ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" 5 | ZSH_THEME_GIT_PROMPT_DIRTY="%{$grey%}) %{$fg[yellow]%}✗%{$reset_color%}" 6 | ZSH_THEME_GIT_PROMPT_CLEAN="%{$grey%})" 7 | 8 | function josh_prompt { 9 | (( spare_width = ${COLUMNS} )) 10 | prompt=" " 11 | 12 | branch=$(current_branch) 13 | ruby_version=$(rvm_prompt_info || rbenv_prompt_info) 14 | path_size=${#PWD} 15 | branch_size=${#branch} 16 | ruby_size=${#ruby_version} 17 | user_machine_size=${#${(%):-%n@%m-}} 18 | 19 | if [[ ${#branch} -eq 0 ]] 20 | then (( ruby_size = ruby_size + 1 )) 21 | else 22 | (( branch_size = branch_size + 4 )) 23 | if [[ -n $(git status -s 2> /dev/null) ]]; then 24 | (( branch_size = branch_size + 2 )) 25 | fi 26 | fi 27 | 28 | (( spare_width = ${spare_width} - (${user_machine_size} + ${path_size} + ${branch_size} + ${ruby_size}) )) 29 | 30 | while [ ${#prompt} -lt $spare_width ]; do 31 | prompt=" $prompt" 32 | done 33 | 34 | prompt="%{%F{green}%}$PWD$prompt%{%F{red}%}$(rvm_prompt_info || rbenv_prompt_info)%{$reset_color%} $(git_prompt_info)" 35 | 36 | echo $prompt 37 | } 38 | 39 | setopt prompt_subst 40 | 41 | PROMPT=' 42 | %n@%m $(josh_prompt) 43 | %(?,%{%F{green}%},%{%F{red}%})⚡%{$reset_color%} ' 44 | -------------------------------------------------------------------------------- /themes/philips.zsh-theme: -------------------------------------------------------------------------------- 1 | if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="green"; 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[red]%}%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="*" 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:*.patch=00;34:*.o=00;32:*.so=01;35:*.ko=01;31:*.la=00;33' 15 | -------------------------------------------------------------------------------- /themes/mgdm.zsh-theme: -------------------------------------------------------------------------------- 1 | if [ "$(whoami)" = "root" ] 2 | then CARETCOLOR="red" 3 | else CARETCOLOR="white" 4 | fi 5 | 6 | local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" 7 | 8 | PROMPT='%{${fg[blue]}%}${USER}%{$reset_color%}@%{${fg[blue]}%}%m%{$reset_color%}:%{${fg[blue]}%}%1d%{${fg_bold[$CARETCOLOR]}%}%#%{${reset_color}%} ' 9 | 10 | RPS1=' ${return_code} $(stv_prompt) $(git_prompt_info) %D{%Y-%m-%d %H:%M:%S}' 11 | 12 | ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[blue]%}git:‹%{$fg_bold[cyan]%}" 13 | ZSH_THEME_GIT_PROMPT_SUFFIX="%{$fg[blue]%}›%{$reset_color%}" 14 | ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%} %{$fg[red]%}✗%{$reset_color%}" 15 | ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%} %{$fg[green]%}✔%{$reset_color%}" 16 | 17 | ZSH_THEME_SVN_PROMPT_PREFIX="%{$fg[blue]%}svn:‹%{$fg_bold[cyan]%}" 18 | ZSH_THEME_SVN_PROMPT_SUFFIX="%{$fg[blue]%}›%{$reset_color%}" 19 | ZSH_THEME_SVN_PROMPT_DIRTY="%{$fg[blue]%} %{$fg[red]%}✗%{$reset_color%}" 20 | ZSH_THEME_SVN_PROMPT_CLEAN="%{$fg[blue]%} %{$fg[green]%}✔%{$reset_color%}" 21 | 22 | ZSH_THEME_STV_APP_PREFIX="%{$fg[yellow]%}" 23 | ZSH_THEME_STV_APP_SUFFIX="%{$reset_color%}" 24 | 25 | MODE_INDICATOR="%{$fg_bold[magenta]%}<%{$reset_color%}%{$fg[magenta]%}<<%{$reset_color%}" 26 | 27 | # TODO use 265 colors 28 | #MODE_INDICATOR="$FX[bold]$FG[020]<$FX[no_bold]%{$fg[blue]%}<<%{$reset_color%}" 29 | # TODO use two lines if git 30 | -------------------------------------------------------------------------------- /templates/zshrc.zsh-template: -------------------------------------------------------------------------------- 1 | # Path to your oh-my-zsh configuration. 2 | ZSH=$HOME/.oh-my-zsh 3 | 4 | # Set name of the theme to load. 5 | # Look in ~/.oh-my-zsh/themes/ 6 | # Optionally, if you set this to "random", it'll load a random theme each 7 | # time that oh-my-zsh is loaded. 8 | ZSH_THEME="robbyrussell" 9 | 10 | # Example aliases 11 | # alias zshconfig="mate ~/.zshrc" 12 | # alias ohmyzsh="mate ~/.oh-my-zsh" 13 | 14 | # Set to this to use case-sensitive completion 15 | # CASE_SENSITIVE="true" 16 | 17 | # Comment this out to disable bi-weekly auto-update checks 18 | # DISABLE_AUTO_UPDATE="true" 19 | 20 | # Uncomment to change how many often would you like to wait before auto-updates occur? (in days) 21 | # export UPDATE_ZSH_DAYS=13 22 | 23 | # Uncomment following line if you want to disable colors in ls 24 | # DISABLE_LS_COLORS="true" 25 | 26 | # Uncomment following line if you want to disable autosetting terminal title. 27 | # DISABLE_AUTO_TITLE="true" 28 | 29 | # Uncomment following line if you want red dots to be displayed while waiting for completion 30 | # COMPLETION_WAITING_DOTS="true" 31 | 32 | # Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*) 33 | # Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/ 34 | # Example format: plugins=(rails git textmate ruby lighthouse) 35 | plugins=(git) 36 | 37 | source $ZSH/oh-my-zsh.sh 38 | 39 | # Customize to your needs... 40 | -------------------------------------------------------------------------------- /plugins/rvm/rvm.plugin.zsh: -------------------------------------------------------------------------------- 1 | fpath=($rvm_path/scripts/zsh/Completion $fpath) 2 | 3 | alias rubies='rvm list rubies' 4 | alias gemsets='rvm gemset list' 5 | 6 | local ruby18='ruby-1.8.7-p334' 7 | local ruby19='ruby-1.9.3-p194' 8 | 9 | function rb18 { 10 | if [ -z "$1" ]; then 11 | rvm use "$ruby18" 12 | else 13 | rvm use "$ruby18@$1" 14 | fi 15 | } 16 | 17 | _rb18() {compadd `ls -1 $rvm_path/gems | grep "^$ruby18@" | sed -e "s/^$ruby18@//" | awk '{print $1}'`} 18 | compdef _rb18 rb18 19 | 20 | function rb19 { 21 | if [ -z "$1" ]; then 22 | rvm use "$ruby19" 23 | else 24 | rvm use "$ruby19@$1" 25 | fi 26 | } 27 | 28 | _rb19() {compadd `ls -1 $rvm_path/gems | grep "^$ruby19@" | sed -e "s/^$ruby19@//" | awk '{print $1}'`} 29 | compdef _rb19 rb19 30 | 31 | function rvm-update { 32 | rvm get head 33 | rvm reload # TODO: Reload rvm completion? 34 | } 35 | 36 | # TODO: Make this usable w/o rvm. 37 | function gems { 38 | local current_ruby=`rvm-prompt i v p` 39 | local current_gemset=`rvm-prompt g` 40 | 41 | gem list $@ | sed \ 42 | -Ee "s/\([0-9, \.]+( .+)?\)/$fg[blue]&$reset_color/g" \ 43 | -Ee "s|$(echo $rvm_path)|$fg[magenta]\$rvm_path$reset_color|g" \ 44 | -Ee "s/$current_ruby@global/$fg[yellow]&$reset_color/g" \ 45 | -Ee "s/$current_ruby$current_gemset$/$fg[green]&$reset_color/g" 46 | } 47 | 48 | function _rvm_completion { 49 | source $rvm_path"/scripts/zsh/Completion/_rvm" 50 | } 51 | compdef _rvm_completion rvm 52 | -------------------------------------------------------------------------------- /themes/candy-kingdom.zsh-theme: -------------------------------------------------------------------------------- 1 | # neuralsanwich.zsh-theme 2 | # 3 | # Author: Sean Jones 4 | # URL: http://www.neuralsandwich.com 5 | # Repo: 6 | # Direct link: 7 | # Create: 8 | # Modified: 9 | 10 | if [ "x$OH_MY_ZSH_HG" = "x" ]; then 11 | OH_MY_ZSH_HG="hg" 12 | fi 13 | 14 | function hg_prompt_info { 15 | $OH_MY_ZSH_HG prompt --angle-brackets "\ 16 | < on %{$fg[magenta]%}%{$reset_color%}>\ 17 | < at %{$fg[yellow]%}%{$reset_color%}>\ 18 | %{$fg[green]%}%{$reset_color%}< 19 | patches: >" 2>/dev/null 20 | } 21 | 22 | function box_name { 23 | [ -f ~/.box-name ] && cat ~/.box-name || hostname -s 24 | } 25 | 26 | PROMPT=' 27 | %{$fg[magenta]%}%n%{$reset_color%}@%{$fg[yellow]%}$(box_name)%{$reset_color%}:%{$fg_bold[green]%}${PWD/#$HOME/~}%{$reset_color%}$(hg_prompt_info)$(git_prompt_info) 28 | %(?,,%{${fg_bold[white]}%}[%?]%{$reset_color%} )$ ' 29 | 30 | ZSH_THEME_GIT_PROMPT_PREFIX=" (%{$fg[magenta]%}branch: " 31 | ZSH_THEME_GIT_PROMPT_CLEAN="" 32 | ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[red]%}?" 33 | ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[orange]%}!" 34 | ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%})" 35 | 36 | local return_status="%{$fg[red]%}%(?..✘)%{$reset_color%}" 37 | RPROMPT='${return_status}$(battery_time_remaining) $(battery_pct_prompt)%{$reset_color%}' 38 | -------------------------------------------------------------------------------- /plugins/github/_github: -------------------------------------------------------------------------------- 1 | #compdef github 2 | #autoload 3 | 4 | # in order to make this work, you will need to have the github gem installed 5 | # http://github.com/defunkt/github-gem 6 | 7 | # github zsh completion, based on homebrew completion 8 | 9 | local -a _1st_arguments 10 | _1st_arguments=( 11 | 'browse:Open this repo in a web browser' 12 | 'clone:Clone a repo' 13 | 'config:Automatically set configuration info, or pass args to specify' 14 | 'create-from-local:Create a new GitHub repository from the current local repository' 15 | 'create:Create a new empty GitHub repository' 16 | 'fetch:Fetch from a remote to a local branch' 17 | 'fetch_all:Fetch all refs from a user' 18 | 'fork:Forks a GitHub repository' 19 | 'home:Open this repos master branch in a web browser' 20 | 'ignore:Ignore a SHA from github network commits' 21 | 'info:Info about this project' 22 | 'issues:Project issues tools' 23 | 'network:Project network tools - sub-commands : web [user], list, fetch, commits' 24 | 'open:Open the given user/project in a web browser' 25 | 'pull-request:Generate the text for a pull request' 26 | 'pull:Pull from a remote' 27 | 'search:Search GitHub for the given repository name' 28 | 'track:Track another users repository' 29 | ) 30 | 31 | local expl 32 | local -a pkgs installed_pkgs 33 | 34 | _arguments \ 35 | '*:: :->subcmds' && return 0 36 | 37 | if (( CURRENT == 1 )); then 38 | _describe -t commands "github subcommand" _1st_arguments 39 | return 40 | fi 41 | -------------------------------------------------------------------------------- /themes/junkfood.zsh-theme: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------ 2 | # Tyler Cipriani 3 | # oh-my-zsh theme 4 | # Totally ripped off Dallas theme 5 | # ------------------------------------------------------------------------ 6 | 7 | # Grab the current date (%W) and time (%t): 8 | JUNKFOOD_TIME_="%{$fg_bold[red]%}#%{$fg_bold[white]%}( %{$fg_bold[yellow]%}%W%{$reset_color%}@%{$fg_bold[white]%}%t )( %{$reset_color%}" 9 | 10 | # Grab the current machine name 11 | JUNKFOOD_MACHINE_="%{$fg_bold[blue]%}%m%{$fg[white]%} ):%{$reset_color%}" 12 | 13 | # Grab the current username 14 | JUNKFOOD_CURRENT_USER_="%{$fg_bold[green]%}%n%{$reset_color%}" 15 | 16 | # Grab the current filepath, use shortcuts: ~/Desktop 17 | # Append the current git branch, if in a git repository: ~aw@master 18 | JUNKFOOD_LOCA_="%{$fg[cyan]%}%~\$(git_prompt_info)%{$reset_color%}" 19 | 20 | # For the git prompt, use a white @ and blue text for the branch name 21 | ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[white]%}@%{$fg_bold[white]%}" 22 | 23 | # Close it all off by resetting the color and styles. 24 | ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" 25 | 26 | # Do nothing if the branch is clean (no changes). 27 | ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg_bold[green]%}✔" 28 | 29 | # Add 3 cyan ✗s if this branch is diiirrrty! Dirty branch! 30 | ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[red]%}✗✗✗" 31 | 32 | # Put it all together! 33 | PROMPT="$JUNKFOOD_TIME_$JUNKFOOD_CURRENT_USER_@$JUNKFOOD_MACHINE_$JUNKFOOD_LOCA_ 34 | " 35 | -------------------------------------------------------------------------------- /plugins/terminalapp/terminalapp.plugin.zsh: -------------------------------------------------------------------------------- 1 | # Set Apple Terminal.app resume directory 2 | # based on this answer: http://superuser.com/a/315029 3 | # 2012-10-26: (javageek) Changed code using the updated answer 4 | 5 | # Tell the terminal about the working directory whenever it changes. 6 | if [[ "$TERM_PROGRAM" == "Apple_Terminal" ]] && [[ -z "$INSIDE_EMACS" ]]; then 7 | update_terminal_cwd() { 8 | # Identify the directory using a "file:" scheme URL, including 9 | # the host name to disambiguate local vs. remote paths. 10 | 11 | # Percent-encode the pathname. 12 | local URL_PATH='' 13 | { 14 | # Use LANG=C to process text byte-by-byte. 15 | local i ch hexch LANG=C 16 | for ((i = 1; i <= ${#PWD}; ++i)); do 17 | ch="$PWD[i]" 18 | if [[ "$ch" =~ [/._~A-Za-z0-9-] ]]; then 19 | URL_PATH+="$ch" 20 | else 21 | hexch=$(printf "%02X" "'$ch") 22 | URL_PATH+="%$hexch" 23 | fi 24 | done 25 | } 26 | 27 | local PWD_URL="file://$HOST$URL_PATH" 28 | #echo "$PWD_URL" # testing 29 | printf '\e]7;%s\a' "$PWD_URL" 30 | } 31 | 32 | # Register the function so it is called whenever the working 33 | # directory changes. 34 | autoload add-zsh-hook 35 | add-zsh-hook chpwd update_terminal_cwd 36 | 37 | # Tell the terminal about the initial directory. 38 | update_terminal_cwd 39 | fi 40 | -------------------------------------------------------------------------------- /plugins/grails/grails.plugin.zsh: -------------------------------------------------------------------------------- 1 | _enumerateGrailsScripts() { 2 | # Default directoryies 3 | directories=($GRAILS_HOME/scripts ~/.grails/scripts ./scripts) 4 | 5 | # Check all of the plugins directories, if they exist 6 | if [ -d plugins ] 7 | then 8 | directories+=(plugins/*/scripts) 9 | fi 10 | 11 | # Enumerate all of the Groovy files 12 | files=() 13 | for dir in $directories; 14 | do 15 | if [ -d $dir ] 16 | then 17 | files+=($dir/[^_]*.groovy) 18 | fi 19 | done 20 | 21 | # Don't try to basename () 22 | if [ ${#files} -eq 0 ]; 23 | then 24 | return 25 | fi 26 | 27 | # - Strip the path 28 | # - Remove all scripts with a leading '_' 29 | # - PackagePlugin_.groovy -> PackagePlugin 30 | # - PackagePlugin -> Package-Plugin 31 | # - Package-Plugin -> package-plugin 32 | basename $files \ 33 | | sed -E -e 's/^_?([^_]+)_?.groovy/\1/'\ 34 | -e 's/([a-z])([A-Z])/\1-\2/g' \ 35 | | tr "[:upper:]" "[:lower:]" \ 36 | | sort \ 37 | | uniq 38 | } 39 | 40 | _grails() { 41 | if (( CURRENT == 2 )); then 42 | scripts=( $(_enumerateGrailsScripts) ) 43 | 44 | if [ ${#scripts} -ne 0 ]; 45 | then 46 | _multi_parts / scripts 47 | return 48 | fi 49 | fi 50 | 51 | _files 52 | } 53 | 54 | compdef _grails grails 55 | -------------------------------------------------------------------------------- /themes/fino-time.zsh-theme: -------------------------------------------------------------------------------- 1 | # Fino-time theme by Aexander Berezovsky (http://berezovsky.me) based on Fino by Max Masnick (http://max.masnick.me) 2 | 3 | # Use with a dark background and 256-color terminal! 4 | # Meant for people with RVM and git. Tested only on OS X 10.7. 5 | 6 | # You can set your computer name in the ~/.box-name file if you want. 7 | 8 | # Borrowing shamelessly from these oh-my-zsh themes: 9 | # bira 10 | # robbyrussell 11 | # 12 | # Also borrowing from http://stevelosh.com/blog/2010/02/my-extravagant-zsh-prompt/ 13 | 14 | function virtualenv_info { 15 | [ $VIRTUAL_ENV ] && echo '('`basename $VIRTUAL_ENV`') ' 16 | } 17 | 18 | function prompt_char { 19 | git branch >/dev/null 2>/dev/null && echo '⠠⠵' && return 20 | echo '○' 21 | } 22 | 23 | function box_name { 24 | [ -f ~/.box-name ] && cat ~/.box-name || hostname -s 25 | } 26 | 27 | 28 | local rvm_ruby='‹$(rvm-prompt i v g)›%{$reset_color%}' 29 | local current_dir='${PWD/#$HOME/~}' 30 | local git_info='$(git_prompt_info)' 31 | 32 | 33 | PROMPT="╭─%{$FG[040]%}%n%{$reset_color%} %{$FG[239]%}at%{$reset_color%} %{$FG[033]%}$(box_name)%{$reset_color%} %{$FG[239]%}in%{$reset_color%} %{$terminfo[bold]$FG[226]%}${current_dir}%{$reset_color%}${git_info} %{$FG[239]%}using%{$FG[243]%} ${rvm_ruby} %D - %* 34 | ╰─$(virtualenv_info)$(prompt_char) " 35 | 36 | ZSH_THEME_GIT_PROMPT_PREFIX=" %{$FG[239]%}on%{$reset_color%} %{$fg[255]%}" 37 | ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" 38 | ZSH_THEME_GIT_PROMPT_DIRTY="%{$FG[202]%}✘✘✘" 39 | ZSH_THEME_GIT_PROMPT_CLEAN="%{$FG[040]%}✔" 40 | -------------------------------------------------------------------------------- /lib/termsupport.zsh: -------------------------------------------------------------------------------- 1 | #usage: title short_tab_title looooooooooooooooooooooggggggg_windows_title 2 | #http://www.faqs.org/docs/Linux-mini/Xterm-Title.html#ss3.1 3 | #Fully support screen, iterm, and probably most modern xterm and rxvt 4 | #Limited support for Apple Terminal (Terminal can't set window or tab separately) 5 | function title { 6 | if [[ "$DISABLE_AUTO_TITLE" == "true" ]] || [[ "$EMACS" == *term* ]]; then 7 | return 8 | fi 9 | if [[ "$TERM" == screen* ]]; then 10 | print -Pn "\ek$1:q\e\\" #set screen hardstatus, usually truncated at 20 chars 11 | elif [[ "$TERM" == xterm* ]] || [[ $TERM == rxvt* ]] || [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then 12 | print -Pn "\e]2;$2:q\a" #set window name 13 | print -Pn "\e]1;$1:q\a" #set icon (=tab) name (will override window name on broken terminal) 14 | fi 15 | } 16 | 17 | ZSH_THEME_TERM_TAB_TITLE_IDLE="%15<..<%~%<<" #15 char left truncated PWD 18 | ZSH_THEME_TERM_TITLE_IDLE="%n@%m: %~" 19 | 20 | #Appears when you have the prompt 21 | function omz_termsupport_precmd { 22 | title $ZSH_THEME_TERM_TAB_TITLE_IDLE $ZSH_THEME_TERM_TITLE_IDLE 23 | } 24 | 25 | #Appears at the beginning of (and during) of command execution 26 | function omz_termsupport_preexec { 27 | emulate -L zsh 28 | setopt extended_glob 29 | local CMD=${1[(wr)^(*=*|sudo|ssh|rake|-*)]} #cmd name only, or if this is sudo or ssh, the next cmd 30 | title "$CMD" "%100>...>${2:gs/%/%%}%<<" 31 | } 32 | 33 | autoload -U add-zsh-hook 34 | add-zsh-hook precmd omz_termsupport_precmd 35 | add-zsh-hook preexec omz_termsupport_preexec 36 | -------------------------------------------------------------------------------- /themes/michelebologna.zsh-theme: -------------------------------------------------------------------------------- 1 | # reference colors 2 | GREEN="%{$fg_bold[green]%}" 3 | RED="%{$fg_bold[red]%}" 4 | CYAN="%{$fg_bold[cyan]%}" 5 | YELLOW="%{$fg_bold[yellow]%}" 6 | BLUE="%{$fg_bold[blue]%}" 7 | MAGENTA="%{$fg_bold[magenta]%}" 8 | WHITE="%{$fg_bold[white]%}" 9 | 10 | COLOR_ARRAY=($GREEN $RED $CYAN $YELLOW $BLUE $MAGENTA $WHITE) 11 | 12 | # color reset 13 | RESET_COLOR="%{$reset_color%}" 14 | 15 | # which color should be applied? 16 | USERNAME_NORMAL_COLOR=$WHITE 17 | USERNAME_ROOT_COLOR=$RED 18 | HOSTNAME_NORMAL_COLOR=$BLUE 19 | # uncomment next line if you want auto-generated hostname color 20 | #for i in `hostname`; HOSTNAME_NORMAL_COLOR=$COLOR_ARRAY[$[((#i))%7+1]] 21 | HOSTNAME_ROOT_COLOR=$RED 22 | HOSTNAME_COLOR=%(!.$HOSTNAME_ROOT_COLOR.$HOSTNAME_NORMAL_COLOR) 23 | CURRENT_DIR_COLOR=$CYAN 24 | 25 | # zsh commands 26 | USERNAME_COMMAND="%n" 27 | HOSTNAME_COMMAND="%m" 28 | CURRENT_DIR="%~" 29 | 30 | # output: colors + commands 31 | USERNAME_OUTPUT="%(!..$USERNAME_NORMAL_COLOR$USERNAME_COMMAND$RESET_COLOR@)" 32 | HOSTNAME_OUTPUT="$HOSTNAME_COLOR$HOSTNAME_COMMAND$RESET_COLOR" 33 | CURRENT_DIR_OUTPUT="$CURRENT_DIR_COLOR$CURRENT_DIR" 34 | LAST_COMMAND_OUTPUT="%(?.%(!.$RED.$GREEN).$YELLOW)" 35 | 36 | # git theming 37 | ZSH_THEME_GIT_PROMPT_PREFIX="(" 38 | ZSH_THEME_GIT_PROMPT_SUFFIX="" 39 | ZSH_THEME_GIT_PROMPT_DIRTY=")$RED*" 40 | ZSH_THEME_GIT_PROMPT_CLEAN=")" 41 | 42 | # wrap all together 43 | PROMPT='$USERNAME_OUTPUT$HOSTNAME_OUTPUT:$CURRENT_DIR_OUTPUT $LAST_COMMAND_OUTPUT%#$RESET_COLOR ' 44 | RPROMPT='%1(j.fg: [%j].) $GREEN$(git_prompt_info)$RESET_COLOR [%@]' 45 | -------------------------------------------------------------------------------- /plugins/nanoc/_nanoc: -------------------------------------------------------------------------------- 1 | #compdef nanoc 2 | #autoload 3 | 4 | # nanoc zsh completion - based on the homebrew zsh completion 5 | # requires the 'nanoc' gem to be installed 6 | 7 | local -a _1st_arguments 8 | _1st_arguments=( 9 | 'autocompile:start the autocompiler' 10 | 'compile:compile items of this site' 11 | 'create-item:create an item' 12 | 'create-layout:create a layout' 13 | 'create-site:create a site' 14 | 'deploy:deploy the compiled site' 15 | 'help:show help' 16 | 'prune:remove files not managed by nanoc from the output directory' 17 | 'show-data:show data in this site' 18 | 'show-plugins:show all available plugins' 19 | 'show-rules:describe the rules for each item' 20 | 'update:update the data stored by the data source to a newer version' 21 | 'validate-css:validate the site’s CSS' 22 | 'validate-html:validate the site’s HTML' 23 | 'validate-links:validate links in site' 24 | 'view:start the web server that serves static files' 25 | 'watch:start the watcher' 26 | ) 27 | 28 | local expl 29 | local -a pkgs installed_pkgs 30 | 31 | _arguments \ 32 | '(--color)--color[enable color]' \ 33 | '(--debug)--debug[enable debugging]' \ 34 | '(--help)--help[show the help message and quit]' \ 35 | '(--no-color)--no-color[disable color]' \ 36 | '(--verbose)--verbose[make nanoc output more detailed]' \ 37 | '(--version)--version[show version information and quit]' \ 38 | '(--warn)--warn[enable warnings]' \ 39 | '*:: :->subcmds' && return 0 40 | 41 | if (( CURRENT == 1 )); then 42 | _describe -t commands "nanoc subcommand" _1st_arguments 43 | return 44 | fi 45 | -------------------------------------------------------------------------------- /themes/adben.zsh-theme: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | local USER_HOST='%{$terminfo[bold]$fg[yellow]%}%n@%m%{$reset_color%}' 3 | local RETURN_CODE="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" 4 | local GIT_BRANCH='%{$terminfo[bold]$fg[red]%}$(git_prompt_info)%{$reset_color%}' 5 | local CURRENT_DIR='%{$terminfo[bold]$fg[green]%} %~%{$reset_color%}' 6 | local RUBY_RVM='%{$fg[gray]%}‹$(rvm-prompt i v g)›%{$reset_color%}' 7 | local COMMAND_TIP='%{$terminfo[bold]$fg[blue]%}$(wget -qO - http://www.commandlinefu.com/commands/random/plaintext | sed 1d | sed '/^$/d' | sed 's/^/║/g')%{$reset_color%}' 8 | ######### PROMPT ######### 9 | PROMPT="%{$terminfo[bold]$fg[blue]%}╔═ %{$reset_color%}${USER_HOST} ${CURRENT_DIR} ${RUBY_RVM} ${GIT_BRANCH} 10 | ${COMMAND_TIP} 11 | %{$terminfo[bold]$fg[blue]%}╚═ %{$reset_color%}%B%{$terminfo[bold]$fg[white]%}$%b%{$reset_color%} " 12 | RPS1='${RETURN_CODE}' 13 | RPROMPT='%{$fg[green]%}[%*]%{$reset_color%}' 14 | ######### PROMPT ######### 15 | ########## GIT ########### 16 | ZSH_THEME_GIT_PROMPT_PREFIX="‹" 17 | ZSH_THEME_GIT_PROMPT_SUFFIX="%{$GIT_PROMPT_INFO%}›" 18 | ZSH_THEME_GIT_PROMPT_DIRTY=" %{$GIT_DIRTY_COLOR%}✘" 19 | ZSH_THEME_GIT_PROMPT_CLEAN=" %{$GIT_CLEAN_COLOR%}✔" 20 | ZSH_THEME_GIT_PROMPT_ADDED="%{$FG[082]%}✚%{$reset_color%}" 21 | ZSH_THEME_GIT_PROMPT_MODIFIED="%{$FG[166]%}✹%{$reset_color%}" 22 | ZSH_THEME_GIT_PROMPT_DELETED="%{$FG[160]%}✖%{$reset_color%}" 23 | ZSH_THEME_GIT_PROMPT_RENAMED="%{$FG[220]%}➜%{$reset_color%}" 24 | ZSH_THEME_GIT_PROMPT_UNMERGED="%{$FG[082]%}═%{$reset_color%}" 25 | ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$FG[190]%}✭%{$reset_color%}" 26 | ########## GIT ########### 27 | -------------------------------------------------------------------------------- /plugins/cloudapp/cloudapp.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # 3 | # cloudapp 4 | # Zach Holman / @holman 5 | # 6 | # Uploads a file from the command line to CloudApp, drops it into your 7 | # clipboard (on a Mac, at least). 8 | # 9 | # Example: 10 | # 11 | # cloudapp drunk-blake.png 12 | # 13 | # This requires Aaron Russell's cloudapp_api gem: 14 | # 15 | # gem install cloudapp_api 16 | # 17 | # Requires you set your CloudApp credentials in ~/.cloudapp as a simple file of: 18 | # 19 | # email 20 | # password 21 | 22 | require 'rubygems' 23 | begin 24 | require 'cloudapp_api' 25 | rescue LoadError 26 | puts "You need to install cloudapp_api: gem install cloudapp_api" 27 | exit!(1) 28 | end 29 | 30 | config_file = "#{ENV['HOME']}/.cloudapp" 31 | unless File.exist?(config_file) 32 | puts "You need to type your email and password (one per line) into "+ 33 | "`~/.cloudapp`" 34 | exit!(1) 35 | end 36 | 37 | email,password = File.read(config_file).split("\n") 38 | 39 | class HTTParty::Response 40 | # Apparently HTTPOK.ok? IS NOT OKAY WTFFFFFFFFFFUUUUUUUUUUUUUU 41 | # LETS MONKEY PATCH IT I FEEL OKAY ABOUT IT 42 | def ok? ; true end 43 | end 44 | 45 | if ARGV[0].nil? 46 | puts "You need to specify a file to upload." 47 | exit!(1) 48 | end 49 | 50 | CloudApp.authenticate(email,password) 51 | url = CloudApp::Item.create(:upload, {:file => ARGV[0]}).url 52 | 53 | # Say it for good measure. 54 | puts "Uploaded to #{url}." 55 | 56 | # Get the embed link. 57 | url = "#{url}/#{ARGV[0].split('/').last}" 58 | 59 | # Copy it to your (Mac's) clipboard. 60 | `echo '#{url}' | tr -d "\n" | pbcopy` 61 | -------------------------------------------------------------------------------- /plugins/rbfu/rbfu.plugin.zsh: -------------------------------------------------------------------------------- 1 | # Enables rbfu with --auto option, if available. 2 | # 3 | # Also provides a command to list all installed/available 4 | # rubies. To ensure compatibility with themes, creates the 5 | # rvm_prompt_info function to return the $RBFU_RUBY_VERSION 6 | # version. 7 | 8 | command -v rbfu &>/dev/null 9 | 10 | if [[ $? -eq 0 ]]; then 11 | eval "$(rbfu --init --auto)" 12 | 13 | # Internal: Print ruby version details, if it's currently 14 | # active etc. 15 | function _rbfu_rubies_print() { 16 | local rb rb_out 17 | rb=$(basename $1) 18 | rb_out="$rb" 19 | [[ -h $1 ]] && rb_out="$rb_out${fg[green]}@${reset_color}" 20 | [[ "x$rb" == "x$2" ]] && rb_out="${fg[red]}$rb_out ${fg[red]}*${reset_color}" 21 | echo $rb_out 22 | } 23 | 24 | # Public: Provide a list with all available rubies, this basically depends 25 | # on `ls -1` and .rfbu/rubies. Highlights the currently active ruby version 26 | # and aliases. 27 | function rbfu-rubies() { 28 | local rbfu_dir active_rb 29 | rbfu_dir=$RBFU_RUBIES 30 | active_rb=$RBFU_RUBY_VERSION 31 | [[ -z "$rbfu_dir" ]] && rbfu_dir="${HOME}/.rbfu/rubies" 32 | [[ -z "$active_rb" ]] && active_rb="system" 33 | _rbfu_rubies_print "${rbfu_dir}/system" $active_rb 34 | for rb in $(ls -1 $rbfu_dir); do 35 | _rbfu_rubies_print "${rbfu_dir}/${rb}" $active_rb 36 | done 37 | } 38 | 39 | # Public: Create rvm_prompt_info command for themes compatibility, unless 40 | # it has already been defined. 41 | [ ! -x rvm_prompt_info ] && function rvm_prompt_info() { echo "${RBFU_RUBY_VERSION:=system}" } 42 | fi 43 | -------------------------------------------------------------------------------- /lib/key-bindings.zsh: -------------------------------------------------------------------------------- 1 | # TODO: Explain what some of this does.. 2 | 3 | bindkey -e 4 | bindkey '\ew' kill-region 5 | bindkey -s '\el' "ls\n" 6 | bindkey '^r' history-incremental-search-backward 7 | bindkey "^[[5~" up-line-or-history 8 | bindkey "^[[6~" down-line-or-history 9 | 10 | # make search up and down work, so partially type and hit up/down to find relevant stuff 11 | bindkey '^[[A' up-line-or-search 12 | bindkey '^[[B' down-line-or-search 13 | 14 | bindkey "^[[H" beginning-of-line 15 | bindkey "^[[1~" beginning-of-line 16 | bindkey "^[OH" beginning-of-line 17 | bindkey "^[[F" end-of-line 18 | bindkey "^[[4~" end-of-line 19 | bindkey "^[OF" end-of-line 20 | bindkey ' ' magic-space # also do history expansion on space 21 | 22 | bindkey "^[[1;5C" forward-word 23 | bindkey "^[[1;5D" backward-word 24 | 25 | bindkey '^[[Z' reverse-menu-complete 26 | 27 | # Make the delete key (or Fn + Delete on the Mac) work instead of outputting a ~ 28 | bindkey '^?' backward-delete-char 29 | bindkey "^[[3~" delete-char 30 | bindkey "^[3;5~" delete-char 31 | bindkey "\e[3~" delete-char 32 | 33 | # consider emacs keybindings: 34 | 35 | #bindkey -e ## emacs key bindings 36 | # 37 | #bindkey '^[[A' up-line-or-search 38 | #bindkey '^[[B' down-line-or-search 39 | #bindkey '^[^[[C' emacs-forward-word 40 | #bindkey '^[^[[D' emacs-backward-word 41 | # 42 | #bindkey -s '^X^Z' '%-^M' 43 | #bindkey '^[e' expand-cmd-path 44 | #bindkey '^[^I' reverse-menu-complete 45 | #bindkey '^X^N' accept-and-infer-next-history 46 | #bindkey '^W' kill-region 47 | #bindkey '^I' complete-word 48 | ## Fix weird sequence that rxvt produces 49 | #bindkey -s '^[[Z' '\t' 50 | # 51 | -------------------------------------------------------------------------------- /themes/rkj-repos.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 | 5 | function hg_prompt_info { 6 | hg prompt --angle-brackets "\ 7 | %{$reset_color%}>\ 8 | %{$reset_color%}>\ 9 | %{$fg[red]%}%{$reset_color%}< 10 | patches: >" 2>/dev/null 11 | } 12 | 13 | ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[cyan]%}+" 14 | ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[yellow]%}✱" 15 | ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%}✗" 16 | ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[blue]%}➦" 17 | ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[magenta]%}✂" 18 | ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[grey]%}✈" 19 | 20 | function mygit() { 21 | ref=$(git symbolic-ref HEAD 2> /dev/null) || return 22 | echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$( git_prompt_status )%{$reset_color%}$ZSH_THEME_GIT_PROMPT_SUFFIX" 23 | } 24 | 25 | # alternate prompt with git & hg 26 | 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{"%Y-%m-%d %I:%M:%S"}%b$'%{\e[0;34m%}%B]%b%{\e[0m%} 27 | %{\e[0;34m%}%B└─%B[%{\e[1;35m%}$%{\e[0;34m%}%B] <$(mygit)$(hg_prompt_info)>%{\e[0m%}%b ' 28 | PS2=$' \e[0;34m%}%B>%{\e[0m%}%b ' 29 | 30 | -------------------------------------------------------------------------------- /themes/mh.zsh-theme: -------------------------------------------------------------------------------- 1 | # mh theme 2 | # preview: http://cl.ly/1y2x0W0E3t2C0F29043z 3 | 4 | # features: 5 | # path is autoshortened to ~30 characters 6 | # displays git status (if applicable in current folder) 7 | # turns username green if superuser, otherwise it is white 8 | 9 | # if superuser make the username green 10 | if [ $UID -eq 0 ]; then NCOLOR="green"; else NCOLOR="white"; fi 11 | 12 | # prompt 13 | PROMPT='[%{$fg[$NCOLOR]%}%B%n%b%{$reset_color%}:%{$fg[red]%}%30<...<%~%<<%{$reset_color%}]%(!.#.$) ' 14 | RPROMPT='$(git_prompt_info)' 15 | 16 | # git theming 17 | ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[gray]%}(%{$fg_no_bold[yellow]%}%B" 18 | ZSH_THEME_GIT_PROMPT_SUFFIX="%b%{$fg_bold[gray]%})%{$reset_color%} " 19 | ZSH_THEME_GIT_PROMPT_CLEAN="" 20 | ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[red]%}✱" 21 | 22 | # LS colors, made with http://geoff.greer.fm/lscolors/ 23 | export LSCOLORS="Gxfxcxdxbxegedabagacad" 24 | 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:' 25 | -------------------------------------------------------------------------------- /themes/fino.zsh-theme: -------------------------------------------------------------------------------- 1 | # Fino theme by Max Masnick (http://max.masnick.me) 2 | 3 | # Use with a dark background and 256-color terminal! 4 | # Meant for people with RVM and git. Tested only on OS X 10.7. 5 | 6 | # You can set your computer name in the ~/.box-name file if you want. 7 | 8 | # Borrowing shamelessly from these oh-my-zsh themes: 9 | # bira 10 | # robbyrussell 11 | # 12 | # Also borrowing from http://stevelosh.com/blog/2010/02/my-extravagant-zsh-prompt/ 13 | 14 | function virtualenv_info { 15 | [ $VIRTUAL_ENV ] && echo '('`basename $VIRTUAL_ENV`') ' 16 | } 17 | 18 | function prompt_char { 19 | git branch >/dev/null 2>/dev/null && echo '±' && return 20 | echo '○' 21 | } 22 | 23 | function box_name { 24 | [ -f ~/.box-name ] && cat ~/.box-name || hostname -s 25 | } 26 | 27 | 28 | local rvm_ruby='' 29 | if which rvm-prompt &> /dev/null; then 30 | rvm_ruby='‹$(rvm-prompt i v g)›%{$reset_color%}' 31 | else 32 | if which rbenv &> /dev/null; then 33 | rvm_ruby='‹$(rbenv version | sed -e "s/ (set.*$//")›%{$reset_color%}' 34 | fi 35 | fi 36 | local current_dir='${PWD/#$HOME/~}' 37 | local git_info='$(git_prompt_info)' 38 | 39 | 40 | PROMPT="╭─%{$FG[040]%}%n%{$reset_color%} %{$FG[239]%}at%{$reset_color%} %{$FG[033]%}$(box_name)%{$reset_color%} %{$FG[239]%}in%{$reset_color%} %{$terminfo[bold]$FG[226]%}${current_dir}%{$reset_color%}${git_info} %{$FG[239]%}using%{$FG[243]%} ${rvm_ruby} 41 | ╰─$(virtualenv_info)$(prompt_char) " 42 | 43 | ZSH_THEME_GIT_PROMPT_PREFIX=" %{$FG[239]%}on%{$reset_color%} %{$fg[255]%}" 44 | ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" 45 | ZSH_THEME_GIT_PROMPT_DIRTY="%{$FG[202]%}✘✘✘" 46 | ZSH_THEME_GIT_PROMPT_CLEAN="%{$FG[040]%}✔" -------------------------------------------------------------------------------- /tools/install.sh: -------------------------------------------------------------------------------- 1 | if [ -d ~/.oh-my-zsh ] 2 | then 3 | echo "\033[0;33mYou already have Oh My Zsh installed.\033[0m You'll need to remove ~/.oh-my-zsh if you want to install" 4 | exit 5 | fi 6 | 7 | echo "\033[0;34mCloning Oh My Zsh...\033[0m" 8 | hash git >/dev/null && /usr/bin/env git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh || { 9 | echo "git not installed" 10 | exit 11 | } 12 | 13 | echo "\033[0;34mLooking for an existing zsh config...\033[0m" 14 | if [ -f ~/.zshrc ] || [ -h ~/.zshrc ] 15 | then 16 | echo "\033[0;33mFound ~/.zshrc.\033[0m \033[0;32mBacking up to ~/.zshrc.pre-oh-my-zsh\033[0m"; 17 | mv ~/.zshrc ~/.zshrc.pre-oh-my-zsh; 18 | fi 19 | 20 | echo "\033[0;34mUsing the Oh My Zsh template file and adding it to ~/.zshrc\033[0m" 21 | cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc 22 | 23 | echo "\033[0;34mCopying your current PATH and adding it to the end of ~/.zshrc for you.\033[0m" 24 | echo "export PATH=$PATH" >> ~/.zshrc 25 | 26 | echo "\033[0;34mTime to change your default shell to zsh!\033[0m" 27 | chsh -s `which zsh` 28 | 29 | echo "\033[0;32m"' __ __ '"\033[0m" 30 | echo "\033[0;32m"' ____ / /_ ____ ___ __ __ ____ _____/ /_ '"\033[0m" 31 | echo "\033[0;32m"' / __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \ '"\033[0m" 32 | echo "\033[0;32m"'/ /_/ / / / / / / / / / / /_/ / / /_(__ ) / / / '"\033[0m" 33 | echo "\033[0;32m"'\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ '"\033[0m" 34 | echo "\033[0;32m"' /____/ '"\033[0m" 35 | 36 | echo "\n\n \033[0;32m....is now installed.\033[0m" 37 | /usr/bin/env zsh 38 | source ~/.zshrc 39 | -------------------------------------------------------------------------------- /themes/juanghurtado.zsh-theme: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------ 2 | # Juan G. Hurtado oh-my-zsh theme 3 | # (Needs Git plugin for current_branch method) 4 | # ------------------------------------------------------------------------ 5 | 6 | # Color shortcuts 7 | RED=$fg[red] 8 | YELLOW=$fg[yellow] 9 | GREEN=$fg[green] 10 | WHITE=$fg[white] 11 | BLUE=$fg[blue] 12 | RED_BOLD=$fg_bold[red] 13 | YELLOW_BOLD=$fg_bold[yellow] 14 | GREEN_BOLD=$fg_bold[green] 15 | WHITE_BOLD=$fg_bold[white] 16 | BLUE_BOLD=$fg_bold[blue] 17 | RESET_COLOR=$reset_color 18 | 19 | # Format for git_prompt_info() 20 | ZSH_THEME_GIT_PROMPT_PREFIX="" 21 | ZSH_THEME_GIT_PROMPT_SUFFIX="" 22 | 23 | # Format for parse_git_dirty() 24 | ZSH_THEME_GIT_PROMPT_DIRTY=" %{$RED%}(*)" 25 | ZSH_THEME_GIT_PROMPT_CLEAN="" 26 | 27 | # Format for git_prompt_status() 28 | ZSH_THEME_GIT_PROMPT_UNMERGED=" %{$RED%}unmerged" 29 | ZSH_THEME_GIT_PROMPT_DELETED=" %{$RED%}deleted" 30 | ZSH_THEME_GIT_PROMPT_RENAMED=" %{$YELLOW%}renamed" 31 | ZSH_THEME_GIT_PROMPT_MODIFIED=" %{$YELLOW%}modified" 32 | ZSH_THEME_GIT_PROMPT_ADDED=" %{$GREEN%}added" 33 | ZSH_THEME_GIT_PROMPT_UNTRACKED=" %{$WHITE%}untracked" 34 | 35 | # Format for git_prompt_ahead() 36 | ZSH_THEME_GIT_PROMPT_AHEAD=" %{$RED%}(!)" 37 | 38 | # Format for git_prompt_long_sha() and git_prompt_short_sha() 39 | ZSH_THEME_GIT_PROMPT_SHA_BEFORE=" %{$WHITE%}[%{$YELLOW%}" 40 | ZSH_THEME_GIT_PROMPT_SHA_AFTER="%{$WHITE%}]" 41 | 42 | # Prompt format 43 | PROMPT=' 44 | %{$GREEN_BOLD%}%n@%m%{$WHITE%}:%{$YELLOW%}%~%u$(parse_git_dirty)$(git_prompt_ahead)%{$RESET_COLOR%} 45 | %{$BLUE%}>%{$RESET_COLOR%} ' 46 | RPROMPT='%{$GREEN_BOLD%}$(current_branch)$(git_prompt_short_sha)$(git_prompt_status)%{$RESET_COLOR%}' -------------------------------------------------------------------------------- /plugins/zeus/zeus.plugin.zsh: -------------------------------------------------------------------------------- 1 | # Some aliases for zeus. (See: https://github.com/burke/zeus) 2 | # Zeus preloads your Rails environment and forks that process whenever 3 | # needed. This effectively speeds up Rails' boot process to under 1 sec. 4 | 5 | # Always use bundler. 6 | # Rails depends on bundler, so we can be pretty sure, that there are no 7 | # problems with this command. For all the other aliases I provided an 8 | # alternative, in case people have conflicts with other plugins (e.g. suse). 9 | alias zeus='bundle exec zeus' 10 | 11 | # Init 12 | alias zi='zeus init' 13 | alias zinit='zeus init' 14 | 15 | # Start 16 | alias zs='zeus start' 17 | alias ztart='zeus start' 18 | 19 | # Console 20 | alias zc='zeus console' 21 | alias zonsole='zeus console' 22 | 23 | # Server 24 | alias zsr='zeus server' 25 | alias zerver='zeus server' 26 | 27 | # Rake 28 | alias zr='zeus rake' 29 | alias zake='zeus rake' 30 | 31 | # Generate 32 | alias zg='zeus generate' 33 | alias zenerate='zeus generate' 34 | 35 | # Runner 36 | alias zrn='zeus runner' 37 | alias zunner='zeus runner' 38 | 39 | # Cucumber 40 | alias zcu='zeus cucumber' 41 | alias zucumber='zeus cucumber' 42 | 43 | # Rspec 44 | alias zspec='zeus rspec' 45 | 46 | # Test 47 | alias zt='zeus test' 48 | alias zest='zeus test' 49 | 50 | alias zu='zeus test test/unit/*' 51 | alias zunits='zeus test test/unit/*' 52 | 53 | alias zf='zeus test test/functional/*' 54 | alias zunctional='zeus test test/functional/*' 55 | 56 | alias za='zeus test test/unit/*; zeus test test/functional/; zeus cucumber' 57 | alias zall='zeus test test/unit/*; zeus test test/functional/; zeus cucumber' 58 | 59 | # Clean up crashed zeus instances. 60 | alias zsw='rm .zeus.sock' 61 | alias zweep='rm .zeus.sock' 62 | -------------------------------------------------------------------------------- /plugins/gitfast/_git: -------------------------------------------------------------------------------- 1 | #compdef git gitk 2 | 3 | # zsh completion wrapper for git 4 | # 5 | # You need git's bash completion script installed somewhere, by default on the 6 | # same directory as this script. 7 | # 8 | # If your script is on ~/.git-completion.sh instead, you can configure it on 9 | # your ~/.zshrc: 10 | # 11 | # zstyle ':completion:*:*:git:*' script ~/.git-completion.sh 12 | # 13 | # The recommended way to install this script is to copy to 14 | # '~/.zsh/completion/_git', and then add the following to your ~/.zshrc file: 15 | # 16 | # fpath=(~/.zsh/completion $fpath) 17 | 18 | complete () 19 | { 20 | # do nothing 21 | return 0 22 | } 23 | 24 | zstyle -s ":completion:*:*:git:*" script script 25 | test -z "$script" && script="$(dirname ${funcsourcetrace[1]%:*})"/git-completion.bash 26 | ZSH_VERSION='' . "$script" 27 | 28 | __gitcomp () 29 | { 30 | emulate -L zsh 31 | 32 | local cur_="${3-$cur}" 33 | 34 | case "$cur_" in 35 | --*=) 36 | ;; 37 | *) 38 | local c IFS=$' \t\n' 39 | local -a array 40 | for c in ${=1}; do 41 | c="$c${4-}" 42 | case $c in 43 | --*=*|*.) ;; 44 | *) c="$c " ;; 45 | esac 46 | array+=("$c") 47 | done 48 | compset -P '*[=:]' 49 | compadd -Q -S '' -p "${2-}" -a -- array && _ret=0 50 | ;; 51 | esac 52 | } 53 | 54 | __gitcomp_nl () 55 | { 56 | emulate -L zsh 57 | 58 | local IFS=$'\n' 59 | compset -P '*[=:]' 60 | compadd -Q -S "${4- }" -p "${2-}" -- ${=1} && _ret=0 61 | } 62 | 63 | _git () 64 | { 65 | local _ret=1 66 | () { 67 | emulate -L ksh 68 | local cur cword prev 69 | cur=${words[CURRENT-1]} 70 | prev=${words[CURRENT-2]} 71 | let cword=CURRENT-1 72 | __${service}_main 73 | } 74 | let _ret && _default -S '' && _ret=0 75 | return _ret 76 | } 77 | 78 | _git 79 | -------------------------------------------------------------------------------- /themes/dallas.zsh-theme: -------------------------------------------------------------------------------- 1 | # Personalized! 2 | 3 | # Grab the current date (%D) and time (%T) wrapped in {}: {%D %T} 4 | DALLAS_CURRENT_TIME_="%{$fg[white]%}{%{$fg[yellow]%}%D %T%{$fg[white]%}}%{$reset_color%}" 5 | # Grab the current version of ruby in use (via RVM): [ruby-1.8.7] 6 | if which rvm-prompt &> /dev/null; then 7 | DALLAS_CURRENT_RUBY_="%{$fg[white]%}[%{$fg[magenta]%}\$(~/.rvm/bin/rvm-prompt i v)%{$fg[white]%}]%{$reset_color%}" 8 | else 9 | if which rbenv &> /dev/null; then 10 | DALLAS_CURRENT_RUBY_="%{$fg[white]%}[%{$fg[magenta]%}\$(rbenv version | sed -e 's/ (set.*$//')%{$fg[white]%}]%{$reset_color%}" 11 | fi 12 | fi 13 | # Grab the current machine name: muscato 14 | DALLAS_CURRENT_MACH_="%{$fg[green]%}%m%{$fg[white]%}:%{$reset_color%}" 15 | # Grab the current filepath, use shortcuts: ~/Desktop 16 | # Append the current git branch, if in a git repository: ~aw@master 17 | DALLAS_CURRENT_LOCA_="%{$fg[cyan]%}%~\$(git_prompt_info)%{$reset_color%}" 18 | # Grab the current username: dallas 19 | DALLAS_CURRENT_USER_="%{$fg[red]%}%n%{$reset_color%}" 20 | # Use a % for normal users and a # for privelaged (root) users. 21 | DALLAS_PROMPT_CHAR_="%{$fg[white]%}%(!.#.%%)%{$reset_color%}" 22 | # For the git prompt, use a white @ and blue text for the branch name 23 | ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[white]%}@%{$fg[blue]%}" 24 | # Close it all off by resetting the color and styles. 25 | ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" 26 | # Do nothing if the branch is clean (no changes). 27 | ZSH_THEME_GIT_PROMPT_CLEAN="" 28 | # Add 3 cyan ✗s if this branch is diiirrrty! Dirty branch! 29 | ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[cyan]%}✗✗✗" 30 | 31 | # Put it all together! 32 | PROMPT="$DALLAS_CURRENT_TIME_$DALLAS_CURRENT_RUBY_$DALLAS_CURRENT_MACH_$DALLAS_CURRENT_LOCA_ $DALLAS_CURRENT_USER_$DALLAS_PROMPT_CHAR_ " 33 | -------------------------------------------------------------------------------- /plugins/perl/perl.plugin.zsh: -------------------------------------------------------------------------------- 1 | # https://github.com/dbbolton 2 | # 3 | # Below are some useful Perl-related aliases/functions that I use with zsh. 4 | 5 | 6 | # Aliases ################################################################### 7 | 8 | # perlbrew ######## 9 | alias pbi='perlbrew install' 10 | alias pbl='perlbrew list' 11 | alias pbo='perlbrew off' 12 | alias pbs='perlbrew switch' 13 | alias pbu='perlbrew use' 14 | 15 | # Perl ############ 16 | 17 | # perldoc` 18 | alias pd='perldoc' 19 | 20 | # use perl like awk/sed 21 | alias ple='perl -wlne' 22 | 23 | # show the latest stable release of Perl 24 | alias latest-perl='curl -s http://www.perl.org/get.html | perl -wlne '\''if (/perl\-([\d\.]+)\.tar\.gz/) { print $1; exit;}'\' 25 | 26 | 27 | 28 | # Functions ################################################################# 29 | 30 | # newpl - creates a basic Perl script file and opens it with $EDITOR 31 | newpl () { 32 | # set $EDITOR to 'vim' if it is undefined 33 | [[ -z $EDITOR ]] && EDITOR=vim 34 | 35 | # if the file exists, just open it 36 | [[ -e $1 ]] && print "$1 exists; not modifying.\n" && $EDITOR $1 37 | 38 | # if it doesn't, make it, and open it 39 | [[ ! -e $1 ]] && print '#!/usr/bin/perl'"\n"'use strict;'"\n"'use warnings;'\ 40 | "\n\n" > $1 && $EDITOR $1 41 | } 42 | 43 | 44 | # pgs - Perl Global Substitution 45 | # find pattern = 1st arg 46 | # replace pattern = 2nd arg 47 | # filename = 3rd arg 48 | pgs() { # [find] [replace] [filename] 49 | perl -i.orig -pe 's/'"$1"'/'"$2"'/g' "$3" 50 | } 51 | 52 | 53 | # Perl grep, because 'grep -P' is terrible. Lets you work with pipes or files. 54 | prep() { # [pattern] [filename unless STDOUT] 55 | perl -nle 'print if /'"$1"'/;' $2 56 | } 57 | 58 | # say - append a newline to 'print' 59 | say() { 60 | print "$1\n" 61 | } 62 | 63 | -------------------------------------------------------------------------------- /plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh: -------------------------------------------------------------------------------- 1 | wrapsource=`which virtualenvwrapper_lazy.sh` 2 | 3 | if [[ -f "$wrapsource" ]]; then 4 | source $wrapsource 5 | 6 | if [[ ! $DISABLE_VENV_CD -eq 1 ]]; then 7 | # Automatically activate Git projects' virtual environments based on the 8 | # directory name of the project. Virtual environment name can be overridden 9 | # by placing a .venv file in the project root with a virtualenv name in it 10 | function workon_cwd { 11 | # Check that this is a Git repo 12 | PROJECT_ROOT=`git rev-parse --show-toplevel 2> /dev/null` 13 | if (( $? == 0 )); then 14 | # Check for virtualenv name override 15 | ENV_NAME=`basename "$PROJECT_ROOT"` 16 | if [[ -f "$PROJECT_ROOT/.venv" ]]; then 17 | ENV_NAME=`cat "$PROJECT_ROOT/.venv"` 18 | fi 19 | # Activate the environment only if it is not already active 20 | if [[ "$VIRTUAL_ENV" != "$WORKON_HOME/$ENV_NAME" ]]; then 21 | if [[ -e "$WORKON_HOME/$ENV_NAME/bin/activate" ]]; then 22 | workon "$ENV_NAME" && export CD_VIRTUAL_ENV="$ENV_NAME" 23 | fi 24 | fi 25 | elif [ $CD_VIRTUAL_ENV ]; then 26 | # We've just left the repo, deactivate the environment 27 | # Note: this only happens if the virtualenv was activated automatically 28 | deactivate && unset CD_VIRTUAL_ENV 29 | fi 30 | unset PROJECT_ROOT 31 | } 32 | 33 | # New cd function that does the virtualenv magic 34 | function cd { 35 | builtin cd "$@" && workon_cwd 36 | } 37 | fi 38 | else 39 | print "zsh virtualenvwrapper plugin: Cannot find virtualenvwrapper_lazy.sh. Please install with \`pip install virtualenvwrapper\`." 40 | fi 41 | -------------------------------------------------------------------------------- /plugins/rbenv/rbenv.plugin.zsh: -------------------------------------------------------------------------------- 1 | _homebrew-installed() { 2 | type brew &> /dev/null 3 | } 4 | 5 | _rbenv-from-homebrew-installed() { 6 | brew --prefix rbenv &> /dev/null 7 | } 8 | 9 | FOUND_RBENV=0 10 | rbenvdirs=("$HOME/.rbenv" "/usr/local/rbenv" "/opt/rbenv") 11 | if _homebrew-installed && _rbenv-from-homebrew-installed ; then 12 | rbenvdirs=($(brew --prefix rbenv) "${rbenvdirs[@]}") 13 | fi 14 | 15 | for rbenvdir in "${rbenvdirs[@]}" ; do 16 | if [ -d $rbenvdir/bin -a $FOUND_RBENV -eq 0 ] ; then 17 | FOUND_RBENV=1 18 | export RBENV_ROOT=$rbenvdir 19 | export PATH=${rbenvdir}/bin:$PATH 20 | eval "$(rbenv init - zsh)" 21 | 22 | alias rubies="rbenv versions" 23 | alias gemsets="rbenv gemset list" 24 | 25 | function current_ruby() { 26 | echo "$(rbenv version-name)" 27 | } 28 | 29 | function current_gemset() { 30 | echo "$(rbenv gemset active 2&>/dev/null | sed -e ":a" -e '$ s/\n/+/gp;N;b a' | head -n1)" 31 | } 32 | 33 | function gems { 34 | local rbenv_path=$(rbenv prefix) 35 | gem list $@ | sed -E \ 36 | -e "s/\([0-9a-z, \.]+( .+)?\)/$fg[blue]&$reset_color/g" \ 37 | -e "s|$(echo $rbenv_path)|$fg[magenta]\$rbenv_path$reset_color|g" \ 38 | -e "s/$current_ruby@global/$fg[yellow]&$reset_color/g" \ 39 | -e "s/$current_ruby$current_gemset$/$fg[green]&$reset_color/g" 40 | } 41 | 42 | function rbenv_prompt_info() { 43 | if [[ -n $(current_gemset) ]] ; then 44 | echo "$(current_ruby)@$(current_gemset)" 45 | else 46 | echo "$(current_ruby)" 47 | fi 48 | } 49 | fi 50 | done 51 | unset rbenvdir 52 | 53 | if [ $FOUND_RBENV -eq 0 ] ; then 54 | alias rubies='ruby -v' 55 | function gemsets() { echo 'not supported' } 56 | function rbenv_prompt_info() { echo "system: $(ruby -v | cut -f-2 -d ' ')" } 57 | fi 58 | -------------------------------------------------------------------------------- /themes/nicoulaj.zsh-theme: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | # ------------------------------------------------------------------------------ 3 | # Prompt for the Zsh shell: 4 | # * One line. 5 | # * VCS info on the right prompt. 6 | # * Only shows the path on the left prompt by default. 7 | # * Crops the path to a defined length and only shows the path relative to 8 | # the current VCS repository root. 9 | # * Wears a different color wether the last command succeeded/failed. 10 | # * Shows user@hostname if connected through SSH. 11 | # * Shows if logged in as root or not. 12 | # ------------------------------------------------------------------------------ 13 | 14 | # Customizable parameters. 15 | PROMPT_PATH_MAX_LENGTH=30 16 | PROMPT_DEFAULT_END=❯ 17 | PROMPT_ROOT_END=❯❯❯ 18 | PROMPT_SUCCESS_COLOR=$FG[071] 19 | PROMPT_FAILURE_COLOR=$FG[124] 20 | PROMPT_VCS_INFO_COLOR=$FG[242] 21 | 22 | # Set required options. 23 | setopt promptsubst 24 | 25 | # Load required modules. 26 | autoload -U add-zsh-hook 27 | autoload -Uz vcs_info 28 | 29 | # Add hook for calling vcs_info before each command. 30 | add-zsh-hook precmd vcs_info 31 | 32 | # Set vcs_info parameters. 33 | zstyle ':vcs_info:*' enable hg bzr git 34 | zstyle ':vcs_info:*:*' check-for-changes true # Can be slow on big repos. 35 | zstyle ':vcs_info:*:*' unstagedstr '!' 36 | zstyle ':vcs_info:*:*' stagedstr '+' 37 | zstyle ':vcs_info:*:*' actionformats "%S" "%r/%s/%b %u%c (%a)" 38 | zstyle ':vcs_info:*:*' formats "%S" "%r/%s/%b %u%c" 39 | zstyle ':vcs_info:*:*' nvcsformats "%~" "" 40 | 41 | # Define prompts. 42 | PROMPT="%(0?.%{$PROMPT_SUCCESS_COLOR%}.%{$PROMPT_FAILURE_COLOR%})${SSH_TTY:+[%n@%m]}%{$FX[bold]%}%$PROMPT_PATH_MAX_LENGTH<..<"'${vcs_info_msg_0_%%.}'"%<<%(!.$PROMPT_ROOT_END.$PROMPT_DEFAULT_END)%{$FX[no-bold]%}%{$FX[reset]%} " 43 | RPROMPT="%{$PROMPT_VCS_INFO_COLOR%}"'$vcs_info_msg_1_'"%{$FX[reset]%}" 44 | -------------------------------------------------------------------------------- /plugins/macports/_port: -------------------------------------------------------------------------------- 1 | #compdef port 2 | 3 | local subcmds 4 | 5 | # we cache the list of ports 6 | # we shall use some cache policy to avoid problems with new ports 7 | if (( ! $+portlist )); then 8 | portlist=($(port echo all; echo "all current active inactive installed uninstalled outdated")) 9 | fi 10 | 11 | subcmds=( 12 | 'activate' 13 | 'archive' 14 | 'build' 15 | 'cat' 16 | 'clean' 17 | 'configure' 18 | 'contents' 19 | 'deactivate' 20 | 'dependents' 21 | 'deps' 22 | 'destroot' 23 | 'dir' 24 | 'distcheck' 25 | 'distclean' 26 | 'dmg' 27 | 'echo' 28 | 'edit' 29 | 'extract' 30 | 'fetch' 31 | 'file' 32 | 'help' 33 | 'info' 34 | 'install' 35 | 'installed' 36 | 'list' 37 | 'livecheck' 38 | 'location' 39 | 'mpkg' 40 | 'outdated' 41 | 'patch' 42 | 'pkg' 43 | 'provides' 44 | 'rpmpackage' 45 | 'search' 46 | 'selfupdate' 47 | 'sync' 48 | 'test' 49 | 'unarchive' 50 | 'uninstall' 51 | 'upgrade' 52 | 'variants' 53 | 'version' 54 | ) 55 | 56 | _arguments -C \ 57 | '-v[verbose mode (generate verbose messages)]' \ 58 | '-d[debug mode (generate debugging messages)]' \ 59 | '-q[quiet mode (suppress messages)]' \ 60 | '-D[specify portdir]' \ 61 | '-k[keep mode (do not autoclean after install)]' \ 62 | '-n[dont follow dependencies in upgrade (only for upgrading)]' \ 63 | '-a[upgrade all installed ports (only for upgrading)]' \ 64 | '-u[uninstall non-active ports when upgrading and uninstalling]' \ 65 | '-f[force mode (ignore state file)]' \ 66 | '-s[source-only mode]' \ 67 | '-b[binary-only mode]' \ 68 | '-o[honor state files older than Portfile]' \ 69 | '*::command:->command' \ 70 | && return 0 71 | 72 | case $state in 73 | command) 74 | if ((CURRENT == 1)); then 75 | state=subcommands 76 | else 77 | state=portname 78 | fi 79 | ;; 80 | esac 81 | 82 | case $state in 83 | subcommands) 84 | _describe -t commands 'port commands' subcmds 85 | ;; 86 | portname) 87 | _describe -t commands 'available ports' portlist 88 | ;; 89 | esac 90 | -------------------------------------------------------------------------------- /plugins/pow/pow.plugin.zsh: -------------------------------------------------------------------------------- 1 | # Restart a rack app running under pow 2 | # http://pow.cx/ 3 | # 4 | # Adds a kapow command that will restart an app 5 | # 6 | # $ kapow myapp 7 | # 8 | # Supports command completion. 9 | # 10 | # If you are not already using completion you might need to enable it with 11 | # 12 | # autoload -U compinit compinit 13 | # 14 | # Changes: 15 | # 16 | # Defaults to the current application, and will walk up the tree to find 17 | # a config.ru file and restart the corresponding app 18 | # 19 | # Will Detect if a app does not exist in pow and print a (slightly) helpful 20 | # error message 21 | 22 | rack_root_detect(){ 23 | setopt chaselinks 24 | local orgdir=$(pwd) 25 | local basedir=$(pwd) 26 | 27 | while [[ $basedir != '/' ]]; do 28 | test -e "$basedir/config.ru" && break 29 | builtin cd ".." 2>/dev/null 30 | basedir="$(pwd)" 31 | done 32 | 33 | builtin cd $orgdir 2>/dev/null 34 | [[ ${basedir} == "/" ]] && return 1 35 | echo `basename $basedir | sed -E "s/.(com|net|org)//"` 36 | } 37 | 38 | kapow(){ 39 | local vhost=$1 40 | [ ! -n "$vhost" ] && vhost=$(rack_root_detect) 41 | if [ ! -h ~/.pow/$vhost ] 42 | then 43 | echo "pow: This domain isn’t set up yet. Symlink your application to ${vhost} first." 44 | return 1 45 | fi 46 | 47 | [ ! -d ~/.pow/${vhost}/tmp ] && mkdir -p ~/.pow/$vhost/tmp 48 | touch ~/.pow/$vhost/tmp/restart.txt; 49 | [ $? -eq 0 ] && echo "pow: restarting $vhost.dev" 50 | } 51 | compctl -W ~/.pow -/ kapow 52 | 53 | powit(){ 54 | local basedir=$(pwd) 55 | local vhost=$1 56 | [ ! -n "$vhost" ] && vhost=$(rack_root_detect) 57 | if [ ! -h ~/.pow/$vhost ] 58 | then 59 | echo "pow: Symlinking your app with pow. ${vhost}" 60 | [ ! -d ~/.pow/${vhost} ] && ln -s $basedir ~/.pow/$vhost 61 | return 1 62 | fi 63 | } 64 | 65 | # View the standard out (puts) from any pow app 66 | alias kaput="tail -f ~/Library/Logs/Pow/apps/*" 67 | -------------------------------------------------------------------------------- /plugins/ssh-agent/ssh-agent.plugin.zsh: -------------------------------------------------------------------------------- 1 | # 2 | # INSTRUCTIONS 3 | # 4 | # To enabled agent forwarding support add the following to 5 | # your .zshrc file: 6 | # 7 | # zstyle :omz:plugins:ssh-agent agent-forwarding on 8 | # 9 | # To load multiple identies use the identities style, For 10 | # example: 11 | # 12 | # zstyle :omz:plugins:ssh-agent id_rsa id_rsa2 id_github 13 | # 14 | # 15 | # CREDITS 16 | # 17 | # Based on code from Joseph M. Reagle 18 | # http://www.cygwin.com/ml/cygwin/2001-06/msg00537.html 19 | # 20 | # Agent forwarding support based on ideas from 21 | # Florent Thoumie and Jonas Pfenniger 22 | # 23 | 24 | local _plugin__ssh_env=$HOME/.ssh/environment-$HOST 25 | local _plugin__forwarding 26 | 27 | function _plugin__start_agent() 28 | { 29 | local -a identities 30 | 31 | # start ssh-agent and setup environment 32 | /usr/bin/env ssh-agent | sed 's/^echo/#echo/' > ${_plugin__ssh_env} 33 | chmod 600 ${_plugin__ssh_env} 34 | . ${_plugin__ssh_env} > /dev/null 35 | 36 | # load identies 37 | zstyle -a :omz:plugins:ssh-agent identities identities 38 | echo starting... 39 | /usr/bin/ssh-add $HOME/.ssh/${^identities} 40 | } 41 | 42 | # test if agent-forwarding is enabled 43 | zstyle -b :omz:plugins:ssh-agent agent-forwarding _plugin__forwarding 44 | if [[ ${_plugin__forwarding} == "yes" && -n "$SSH_AUTH_SOCK" ]]; then 45 | # Add a nifty symlink for screen/tmux if agent forwarding 46 | [[ -L $SSH_AUTH_SOCK ]] || ln -sf "$SSH_AUTH_SOCK" /tmp/ssh-agent-$USER-screen 47 | 48 | elif [ -f "${_plugin__ssh_env}" ]; then 49 | # Source SSH settings, if applicable 50 | . ${_plugin__ssh_env} > /dev/null 51 | ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || { 52 | _plugin__start_agent; 53 | } 54 | else 55 | _plugin__start_agent; 56 | fi 57 | 58 | # tidy up after ourselves 59 | unfunction _plugin__start_agent 60 | unset _plugin__forwarding 61 | unset _plugin__ssh_env 62 | 63 | -------------------------------------------------------------------------------- /plugins/supervisor/_supervisord: -------------------------------------------------------------------------------- 1 | #compdef supervisord 2 | 3 | typeset -A opt_args 4 | local context state line 5 | 6 | _arguments \ 7 | {--configuration,-c}"[configuration file]:FILENAME:_files" \ 8 | {--nodaemon,-n}"[run in the foreground (same as 'nodaemon true' in config file)]" \ 9 | {--help,-h}"[print this usage message and exit]:" \ 10 | {--user,-u}"[run supervisord as this user]:USER:_users" \ 11 | {--umask,-m}"[use this umask for daemon subprocess (default is 022)]" \ 12 | {--directory,-d}"[directory to chdir to when daemonized]" \ 13 | {--logfile,-l}"[use FILENAME as logfile path]:FILENAME:_files" \ 14 | {--logfile_maxbytes,-y}"[use BYTES to limit the max size of logfile]" \ 15 | {--logfile_backups,-z}"[number of backups to keep when max bytes reached]" \ 16 | {--loglevel,-e}"[use LEVEL as log level (debug,info,warn,error,critical)]:level:->levels" \ 17 | {--pidfile,-j}"[write a pid file for the daemon process to FILENAME]:FILENAME:_files" \ 18 | {--identifier,-i}"[identifier used for this instance of supervisord]" \ 19 | {--childlogdir,-q}"[the log directory for child process logs]:child log directory:_files -/" \ 20 | {--nocleanup,-k}"[prevent the process from performing cleanup (removal of old automatic child log files) at startup.]" \ 21 | {--minfds,-a}"[the minimum number of file descriptors for start success]" \ 22 | {--strip_ansi,-t}"[strip ansi escape codes from process output]" \ 23 | "--minprocs[the minimum number of processes available for start success]" \ 24 | "--profile_options[run supervisord under profiler and output results based on OPTIONS, which is a comma-sep'd list of 'cumulative', 'calls', and/or 'callers', e.g. 'cumulative,callers')]" \ 25 | "*::args:_gnu_generic" 26 | 27 | case $state in 28 | levels) 29 | levels=("debug" "info" "warn" "error" "critical") 30 | _describe -t levels 'supervisord levels' levels && return 0 31 | ;; 32 | esac 33 | -------------------------------------------------------------------------------- /themes/kphoen.zsh-theme: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------------ 2 | # FILE: kphoen.zsh-theme 3 | # DESCRIPTION: oh-my-zsh theme file. 4 | # AUTHOR: Kévin Gomez (geek63@gmail.com) 5 | # VERSION: 1.0.0 6 | # SCREENSHOT: 7 | # ------------------------------------------------------------------------------ 8 | 9 | 10 | if [[ "$TERM" != "dumb" ]] && [[ "$DISABLE_LS_COLORS" != "true" ]]; then 11 | PROMPT='[%{$fg[red]%}%n%{$reset_color%}@%{$fg[magenta]%}%m%{$reset_color%}:%{$fg[blue]%}%~%{$reset_color%}$(git_prompt_info)] 12 | %# ' 13 | 14 | ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[green]%}" 15 | ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" 16 | ZSH_THEME_GIT_PROMPT_DIRTY="" 17 | ZSH_THEME_GIT_PROMPT_CLEAN="" 18 | 19 | # display exitcode on the right when >0 20 | return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" 21 | 22 | RPROMPT='${return_code}$(git_prompt_status)%{$reset_color%}' 23 | 24 | ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[green]%} ✚" 25 | ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[blue]%} ✹" 26 | ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%} ✖" 27 | ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[magenta]%} ➜" 28 | ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[yellow]%} ═" 29 | ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[cyan]%} ✭" 30 | else 31 | PROMPT='[%n@%m:%~$(git_prompt_info)] 32 | %# ' 33 | 34 | ZSH_THEME_GIT_PROMPT_PREFIX=" on" 35 | ZSH_THEME_GIT_PROMPT_SUFFIX="" 36 | ZSH_THEME_GIT_PROMPT_DIRTY="" 37 | ZSH_THEME_GIT_PROMPT_CLEAN="" 38 | 39 | # display exitcode on the right when >0 40 | return_code="%(?..%? ↵)" 41 | 42 | RPROMPT='${return_code}$(git_prompt_status)' 43 | 44 | ZSH_THEME_GIT_PROMPT_ADDED=" ✚" 45 | ZSH_THEME_GIT_PROMPT_MODIFIED=" ✹" 46 | ZSH_THEME_GIT_PROMPT_DELETED=" ✖" 47 | ZSH_THEME_GIT_PROMPT_RENAMED=" ➜" 48 | ZSH_THEME_GIT_PROMPT_UNMERGED=" ═" 49 | ZSH_THEME_GIT_PROMPT_UNTRACKED=" ✭" 50 | fi 51 | -------------------------------------------------------------------------------- /themes/sorin.zsh-theme: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------------ 2 | # FILE: sorin.zsh-theme 3 | # DESCRIPTION: oh-my-zsh theme file. 4 | # AUTHOR: Sorin Ionescu (sorin.ionescu@gmail.com) 5 | # VERSION: 1.0.2 6 | # SCREENSHOT: http://i.imgur.com/aipDQ.png 7 | # ------------------------------------------------------------------------------ 8 | 9 | 10 | if [[ "$TERM" != "dumb" ]] && [[ "$DISABLE_LS_COLORS" != "true" ]]; then 11 | MODE_INDICATOR="%{$fg_bold[red]%}❮%{$reset_color%}%{$fg[red]%}❮❮%{$reset_color%}" 12 | local return_status="%{$fg[red]%}%(?..⏎)%{$reset_color%}" 13 | 14 | PROMPT='%{$fg[cyan]%}%c$(git_prompt_info) %(!.%{$fg_bold[red]%}#.%{$fg_bold[green]%}❯)%{$reset_color%} ' 15 | 16 | ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[blue]%}git%{$reset_color%}:%{$fg[red]%}" 17 | ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" 18 | ZSH_THEME_GIT_PROMPT_DIRTY="" 19 | ZSH_THEME_GIT_PROMPT_CLEAN="" 20 | 21 | RPROMPT='${return_status}$(git_prompt_status)%{$reset_color%}' 22 | 23 | ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[green]%} ✚" 24 | ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[blue]%} ✹" 25 | ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%} ✖" 26 | ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[magenta]%} ➜" 27 | ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[yellow]%} ═" 28 | ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[cyan]%} ✭" 29 | else 30 | MODE_INDICATOR="❮❮❮" 31 | local return_status="%(?::⏎)" 32 | 33 | PROMPT='%c$(git_prompt_info) %(!.#.❯) ' 34 | 35 | ZSH_THEME_GIT_PROMPT_PREFIX=" git:" 36 | ZSH_THEME_GIT_PROMPT_SUFFIX="" 37 | ZSH_THEME_GIT_PROMPT_DIRTY="" 38 | ZSH_THEME_GIT_PROMPT_CLEAN="" 39 | 40 | RPROMPT='${return_status}$(git_prompt_status)' 41 | 42 | ZSH_THEME_GIT_PROMPT_ADDED=" ✚" 43 | ZSH_THEME_GIT_PROMPT_MODIFIED=" ✹" 44 | ZSH_THEME_GIT_PROMPT_DELETED=" ✖" 45 | ZSH_THEME_GIT_PROMPT_RENAMED=" ➜" 46 | ZSH_THEME_GIT_PROMPT_UNMERGED=" ═" 47 | ZSH_THEME_GIT_PROMPT_UNTRACKED=" ✭" 48 | fi 49 | -------------------------------------------------------------------------------- /plugins/svn/svn.plugin.zsh: -------------------------------------------------------------------------------- 1 | 2 | function svn_prompt_info { 3 | if [ $(in_svn) ]; then 4 | if [ "x$SVN_SHOW_BRANCH" = "xtrue" ]; then 5 | unset SVN_SHOW_BRANCH 6 | _DISPLAY=$(svn_get_branch_name) 7 | else 8 | _DISPLAY=$(svn_get_repo_name) 9 | fi 10 | echo "$ZSH_PROMPT_BASE_COLOR$ZSH_THEME_SVN_PROMPT_PREFIX\ 11 | $ZSH_THEME_REPO_NAME_COLOR$_DISPLAY$ZSH_PROMPT_BASE_COLOR$ZSH_THEME_SVN_PROMPT_SUFFIX$ZSH_PROMPT_BASE_COLOR$(svn_dirty)$ZSH_PROMPT_BASE_COLOR" 12 | unset _DISPLAY 13 | fi 14 | } 15 | 16 | 17 | function in_svn() { 18 | if [[ -d .svn ]]; then 19 | echo 1 20 | fi 21 | } 22 | 23 | function svn_get_repo_name { 24 | if [ $(in_svn) ]; then 25 | svn info | sed -n 's/Repository\ Root:\ .*\///p' | read SVN_ROOT 26 | 27 | svn info | sed -n "s/URL:\ .*$SVN_ROOT\///p" 28 | fi 29 | } 30 | 31 | function svn_get_branch_name { 32 | _DISPLAY=$(svn info 2> /dev/null | awk -F/ '/^URL:/ { for (i=0; i<=NF; i++) { if ($i == "branches" || $i == "tags" ) { print $(i+1); break }; if ($i == "trunk") { print $i; break } } }') 33 | if [ "x$_DISPLAY" = "x" ]; then 34 | svn_get_repo_name 35 | else 36 | echo $_DISPLAY 37 | fi 38 | unset _DISPLAY 39 | } 40 | 41 | function svn_get_rev_nr { 42 | if [ $(in_svn) ]; then 43 | svn info 2> /dev/null | sed -n s/Revision:\ //p 44 | fi 45 | } 46 | 47 | function svn_dirty_choose { 48 | if [ $(in_svn) ]; then 49 | svn status 2> /dev/null | grep -Eq '^\s*[ACDIM!?L]' 50 | if [ $pipestatus[-1] -eq 0 ]; then 51 | # Grep exits with 0 when "One or more lines were selected", return "dirty". 52 | echo $1 53 | else 54 | # Otherwise, no lines were found, or an error occurred. Return clean. 55 | echo $2 56 | fi 57 | fi 58 | } 59 | 60 | function svn_dirty { 61 | svn_dirty_choose $ZSH_THEME_SVN_PROMPT_DIRTY $ZSH_THEME_SVN_PROMPT_CLEAN 62 | } 63 | -------------------------------------------------------------------------------- /themes/gnzh.zsh-theme: -------------------------------------------------------------------------------- 1 | # ZSH Theme - Preview: http://dl.dropbox.com/u/4109351/pics/gnzh-zsh-theme.png 2 | # Based on bira theme 3 | 4 | # load some modules 5 | autoload -U colors zsh/terminfo # Used in the colour alias below 6 | colors 7 | setopt prompt_subst 8 | 9 | # make some aliases for the colours: (coud use normal escap.seq's too) 10 | for color in RED GREEN YELLOW BLUE MAGENTA CYAN WHITE; do 11 | eval PR_$color='%{$fg[${(L)color}]%}' 12 | done 13 | eval PR_NO_COLOR="%{$terminfo[sgr0]%}" 14 | eval PR_BOLD="%{$terminfo[bold]%}" 15 | 16 | # Check the UID 17 | if [[ $UID -ge 1000 ]]; then # normal user 18 | eval PR_USER='${PR_GREEN}%n${PR_NO_COLOR}' 19 | eval PR_USER_OP='${PR_GREEN}%#${PR_NO_COLOR}' 20 | local PR_PROMPT='$PR_NO_COLOR➤ $PR_NO_COLOR' 21 | elif [[ $UID -eq 0 ]]; then # root 22 | eval PR_USER='${PR_RED}%n${PR_NO_COLOR}' 23 | eval PR_USER_OP='${PR_RED}%#${PR_NO_COLOR}' 24 | local PR_PROMPT='$PR_RED➤ $PR_NO_COLOR' 25 | fi 26 | 27 | # Check if we are on SSH or not 28 | if [[ -n "$SSH_CLIENT" || -n "$SSH2_CLIENT" ]]; then 29 | eval PR_HOST='${PR_YELLOW}%M${PR_NO_COLOR}' #SSH 30 | else 31 | eval PR_HOST='${PR_GREEN}%M${PR_NO_COLOR}' # no SSH 32 | fi 33 | 34 | local return_code="%(?..%{$PR_RED%}%? ↵%{$PR_NO_COLOR%})" 35 | 36 | local user_host='${PR_USER}${PR_CYAN}@${PR_HOST}' 37 | local current_dir='%{$PR_BOLD$PR_BLUE%}%~%{$PR_NO_COLOR%}' 38 | local rvm_ruby='' 39 | if which rvm-prompt &> /dev/null; then 40 | rvm_ruby='%{$PR_RED%}‹$(rvm-prompt i v g s)›%{$PR_NO_COLOR%}' 41 | else 42 | if which rbenv &> /dev/null; then 43 | rvm_ruby='%{$PR_RED%}‹$(rbenv version | sed -e "s/ (set.*$//")›%{$PR_NO_COLOR%}' 44 | fi 45 | fi 46 | local git_branch='$(git_prompt_info)%{$PR_NO_COLOR%}' 47 | 48 | #PROMPT="${user_host} ${current_dir} ${rvm_ruby} ${git_branch}$PR_PROMPT " 49 | PROMPT="╭─${user_host} ${current_dir} ${rvm_ruby} ${git_branch} 50 | ╰─$PR_PROMPT " 51 | RPS1="${return_code}" 52 | 53 | ZSH_THEME_GIT_PROMPT_PREFIX="%{$PR_YELLOW%}‹" 54 | ZSH_THEME_GIT_PROMPT_SUFFIX="› %{$PR_NO_COLOR%}" 55 | -------------------------------------------------------------------------------- /themes/crunch.zsh-theme: -------------------------------------------------------------------------------- 1 | # CRUNCH - created from Steve Eley's cat waxing. 2 | # Initially hacked from the Dallas theme. Thanks, Dallas Reedy. 3 | # 4 | # This theme assumes you do most of your oh-my-zsh'ed "colorful" work at a single machine, 5 | # and eschews the standard space-consuming user and hostname info. Instead, only the 6 | # things that vary in my own workflow are shown: 7 | # 8 | # * The time (not the date) 9 | # * The RVM version and gemset (omitting the 'ruby' name if it's MRI) 10 | # * The current directory 11 | # * The Git branch and its 'dirty' state 12 | # 13 | # Colors are at the top so you can mess with those separately if you like. 14 | # For the most part I stuck with Dallas's. 15 | 16 | CRUNCH_BRACKET_COLOR="%{$fg[white]%}" 17 | CRUNCH_TIME_COLOR="%{$fg[yellow]%}" 18 | CRUNCH_RVM_COLOR="%{$fg[magenta]%}" 19 | CRUNCH_DIR_COLOR="%{$fg[cyan]%}" 20 | CRUNCH_GIT_BRANCH_COLOR="%{$fg[green]%}" 21 | CRUNCH_GIT_CLEAN_COLOR="%{$fg[green]%}" 22 | CRUNCH_GIT_DIRTY_COLOR="%{$fg[red]%}" 23 | 24 | # These Git variables are used by the oh-my-zsh git_prompt_info helper: 25 | ZSH_THEME_GIT_PROMPT_PREFIX="$CRUNCH_BRACKET_COLOR:$CRUNCH_GIT_BRANCH_COLOR" 26 | ZSH_THEME_GIT_PROMPT_SUFFIX="" 27 | ZSH_THEME_GIT_PROMPT_CLEAN=" $CRUNCH_GIT_CLEAN_COLOR✓" 28 | ZSH_THEME_GIT_PROMPT_DIRTY=" $CRUNCH_GIT_DIRTY_COLOR✗" 29 | 30 | # Our elements: 31 | CRUNCH_TIME_="$CRUNCH_BRACKET_COLOR{$CRUNCH_TIME_COLOR%T$CRUNCH_BRACKET_COLOR}%{$reset_color%}" 32 | if which rvm-prompt &> /dev/null; then 33 | CRUNCH_RVM_="$CRUNCH_BRACKET_COLOR"["$CRUNCH_RVM_COLOR\${\$(~/.rvm/bin/rvm-prompt i v g)#ruby-}$CRUNCH_BRACKET_COLOR"]"%{$reset_color%}" 34 | else 35 | if which rbenv &> /dev/null; then 36 | CRUNCH_RVM_="$CRUNCH_BRACKET_COLOR"["$CRUNCH_RVM_COLOR\${\$(rbenv version | sed -e 's/ (set.*$//' -e 's/^ruby-//')}$CRUNCH_BRACKET_COLOR"]"%{$reset_color%}" 37 | fi 38 | fi 39 | CRUNCH_DIR_="$CRUNCH_DIR_COLOR%~\$(git_prompt_info) " 40 | CRUNCH_PROMPT="$CRUNCH_BRACKET_COLOR➭ " 41 | 42 | # Put it all together! 43 | PROMPT="$CRUNCH_TIME_$CRUNCH_RVM_$CRUNCH_DIR_$CRUNCH_PROMPT%{$reset_color%}" 44 | -------------------------------------------------------------------------------- /plugins/lein/lein.plugin.zsh: -------------------------------------------------------------------------------- 1 | function _lein_commands() { 2 | local ret=1 state 3 | _arguments ':subcommand:->subcommand' && ret=0 4 | 5 | case $state in 6 | subcommand) 7 | subcommands=( 8 | "classpath:print the classpath of the current project" 9 | "clean:remove compiled files and dependencies from project" 10 | "compile:ahead-of-time compile the project" 11 | "deploy:build jar and deploy to remote repository" 12 | "deps:download and install all dependencies" 13 | "help:display a list of tasks or help for a given task" 14 | "install:install the project and its dependencies in your local repository" 15 | "int:enter an interactive task shell" 16 | "interactive:enter an interactive task shell" 17 | "jack-in:jack in to a clojure slime session from emacs." 18 | "jar:create a jar file containing the compiled .class files" 19 | "javac:compile java source files" 20 | "new:create a new project skeleton" 21 | "plugin:manage user-level plugins" 22 | "pom:write a pom.xml file to disk for maven interop" 23 | "repl:start a repl session either with the current project or standalone" 24 | "retest:run only the test namespaces which failed last time around" 25 | "run:run the project's -main function" 26 | "search:search remote maven repositories for matching jars" 27 | "swank:launch swank server for Emacs to connect" 28 | "test:run the project's tests" 29 | "test!:run a project's tests after cleaning and fetching dependencies" 30 | "trampoline:run a task without nesting the project's JVM inside Leiningen's." 31 | "uberjar:Create a jar including the contents of each of deps" 32 | "upgrade:upgrade leiningen to the latest stable release" 33 | "version:print leiningen's version" 34 | ) 35 | _describe -t subcommands 'leiningen subcommands' subcommands && ret=0 36 | esac 37 | 38 | return ret 39 | } 40 | 41 | compdef _lein_commands lein 42 | -------------------------------------------------------------------------------- /plugins/github/github.plugin.zsh: -------------------------------------------------------------------------------- 1 | # Setup hub function for git, if it is available; http://github.com/defunkt/hub 2 | if [ "$commands[(I)hub]" ] && [ "$commands[(I)ruby]" ]; then 3 | # eval `hub alias -s zsh` 4 | function git(){ 5 | if ! (( $+_has_working_hub )); then 6 | hub --version &> /dev/null 7 | _has_working_hub=$(($? == 0)) 8 | fi 9 | if (( $_has_working_hub )) ; then 10 | hub "$@" 11 | else 12 | command git "$@" 13 | fi 14 | } 15 | fi 16 | 17 | # Functions ################################################################# 18 | 19 | # https://github.com/dbb 20 | 21 | 22 | # empty_gh [NAME_OF_REPO] 23 | # 24 | # Use this when creating a new repo from scratch. 25 | empty_gh() { # [NAME_OF_REPO] 26 | repo = $1 27 | ghuser=$( git config github.user ) 28 | 29 | mkdir "$repo" 30 | cd "$repo" 31 | git init 32 | touch README 33 | git add README 34 | git commit -m 'Initial commit.' 35 | git remote add origin git@github.com:${ghuser}/${repo}.git 36 | git push -u origin master 37 | } 38 | 39 | # new_gh [DIRECTORY] 40 | # 41 | # Use this when you have a directory that is not yet set up for git. 42 | # This function will add all non-hidden files to git. 43 | new_gh() { # [DIRECTORY] 44 | cd "$1" 45 | ghuser=$( git config github.user ) 46 | 47 | git init 48 | # add all non-dot files 49 | print '.*'"\n"'*~' >> .gitignore 50 | git add ^.* 51 | git commit -m 'Initial commit.' 52 | git remote add origin git@github.com:${ghuser}/${repo}.git 53 | git push -u origin master 54 | } 55 | 56 | # exist_gh [DIRECTORY] 57 | # 58 | # Use this when you have a git repo that's ready to go and you want to add it 59 | # to your GitHub. 60 | exist_gh() { # [DIRECTORY] 61 | cd "$1" 62 | name=$( git config user.name ) 63 | ghuser=$( git config github.user ) 64 | repo=$1 65 | 66 | git remote add origin git@github.com:${ghuser}/${repo}.git 67 | git push -u origin master 68 | } 69 | 70 | # End Functions ############################################################# 71 | 72 | -------------------------------------------------------------------------------- /themes/mortalscumbag.zsh-theme: -------------------------------------------------------------------------------- 1 | function my_git_prompt() { 2 | tester=$(git rev-parse --git-dir 2> /dev/null) || return 3 | 4 | INDEX=$(git status --porcelain 2> /dev/null) 5 | STATUS="" 6 | 7 | # is branch ahead? 8 | if $(echo "$(git log origin/$(current_branch)..HEAD 2> /dev/null)" | grep '^commit' &> /dev/null); then 9 | STATUS="$STATUS$ZSH_THEME_GIT_PROMPT_AHEAD" 10 | fi 11 | 12 | # is anything staged? 13 | if $(echo "$INDEX" | grep -E -e '^(D[ M]|[MARC][ MD]) ' &> /dev/null); then 14 | STATUS="$STATUS$ZSH_THEME_GIT_PROMPT_STAGED" 15 | fi 16 | 17 | # is anything unstaged? 18 | if $(echo "$INDEX" | grep -E -e '^[ MARC][MD] ' &> /dev/null); then 19 | STATUS="$STATUS$ZSH_THEME_GIT_PROMPT_UNSTAGED" 20 | fi 21 | 22 | # is anything untracked? 23 | if $(echo "$INDEX" | grep '^?? ' &> /dev/null); then 24 | STATUS="$STATUS$ZSH_THEME_GIT_PROMPT_UNTRACKED" 25 | fi 26 | 27 | # is anything unmerged? 28 | if $(echo "$INDEX" | grep -E -e '^(A[AU]|D[DU]|U[ADU]) ' &> /dev/null); then 29 | STATUS="$STATUS$ZSH_THEME_GIT_PROMPT_UNMERGED" 30 | fi 31 | 32 | if [[ -n $STATUS ]]; then 33 | STATUS=" $STATUS" 34 | fi 35 | 36 | echo "$ZSH_THEME_GIT_PROMPT_PREFIX$(my_current_branch)$STATUS$ZSH_THEME_GIT_PROMPT_SUFFIX" 37 | } 38 | 39 | function my_current_branch() { 40 | echo $(current_branch || echo "(no branch)") 41 | } 42 | 43 | function ssh_connection() { 44 | if [[ -n $SSH_CONNECTION ]]; then 45 | echo "%{$fg_bold[red]%}(ssh) " 46 | fi 47 | } 48 | 49 | local ret_status="%(?:%{$fg_bold[green]%}:%{$fg_bold[red]%})%?%{$reset_color%}" 50 | PROMPT=$'\n$(ssh_connection)%{$fg_bold[green]%}%n@%m%{$reset_color%}$(my_git_prompt) : %~\n[${ret_status}] %# ' 51 | 52 | ZSH_THEME_PROMPT_RETURNCODE_PREFIX="%{$fg_bold[red]%}" 53 | ZSH_THEME_GIT_PROMPT_PREFIX=" $fg[white]‹ %{$fg_bold[yellow]%}" 54 | ZSH_THEME_GIT_PROMPT_AHEAD="%{$fg_bold[magenta]%}↑" 55 | ZSH_THEME_GIT_PROMPT_STAGED="%{$fg_bold[green]%}●" 56 | ZSH_THEME_GIT_PROMPT_UNSTAGED="%{$fg_bold[red]%}●" 57 | ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg_bold[white]%}●" 58 | ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg_bold[red]%}✕" 59 | ZSH_THEME_GIT_PROMPT_SUFFIX=" $fg_bold[white]›%{$reset_color%}" 60 | -------------------------------------------------------------------------------- /plugins/urltools/urltools.plugin.zsh: -------------------------------------------------------------------------------- 1 | # URL Tools 2 | # Adds handy command line aliases useful for dealing with URLs 3 | # 4 | # Taken from: 5 | # http://ruslanspivak.com/2010/06/02/urlencode-and-urldecode-from-a-command-line/ 6 | 7 | if [[ $(whence $URLTOOLS_METHOD) = "" ]]; then 8 | URLTOOLS_METHOD="" 9 | fi 10 | 11 | if [[ $(whence node) != "" && ( "x$URLTOOLS_METHOD" = "x" || "x$URLTOOLS_METHOD" = "xnode" ) ]]; then 12 | alias urlencode='node -e "console.log(encodeURIComponent(process.argv[1]))"' 13 | alias urldecode='node -e "console.log(decodeURIComponent(process.argv[1]))"' 14 | elif [[ $(whence python) != "" && ( "x$URLTOOLS_METHOD" = "x" || "x$URLTOOLS_METHOD" = "xpython" ) ]]; then 15 | alias urlencode='python -c "import sys, urllib as ul; print ul.quote_plus(sys.argv[1])"' 16 | alias urldecode='python -c "import sys, urllib as ul; print ul.unquote_plus(sys.argv[1])"' 17 | elif [[ $(whence ruby) != "" && ( "x$URLTOOLS_METHOD" = "x" || "x$URLTOOLS_METHOD" = "xruby" ) ]]; then 18 | alias urlencode='ruby -r cgi -e "puts CGI.escape(ARGV[0])"' 19 | alias urldecode='ruby -r cgi -e "puts CGI.unescape(ARGV[0])"' 20 | elif [[ $(whence php) != "" && ( "x$URLTOOLS_METHOD" = "x" || "x$URLTOOLS_METHOD" = "xphp" ) ]]; then 21 | alias urlencode='php -r "echo rawurlencode(\$argv[1]); echo \"\n\";"' 22 | alias urldecode='php -r "echo rawurldecode(\$argv[1]); echo \"\\n\";"' 23 | elif [[ $(whence perl) != "" && ( "x$URLTOOLS_METHOD" = "x" || "x$URLTOOLS_METHOD" = "xperl" ) ]]; then 24 | if perl -MURI::Encode -e 1&> /dev/null; then 25 | alias urlencode='perl -MURI::Encode -ep "uri_encode($ARGV[0]);"' 26 | alias urldecode='perl -MURI::Encode -ep "uri_decode($ARGV[0]);"' 27 | elif perl -MURI::Escape -e 1 &> /dev/null; then 28 | alias urlencode='perl -MURI::Escape -ep "uri_escape($ARGV[0]);"' 29 | alias urldecode='perl -MURI::Escape -ep "uri_unescape($ARGV[0]);"' 30 | else 31 | alias urlencode="perl -e '\$new=\$ARGV[0]; \$new =~ s/([^A-Za-z0-9])/sprintf(\"%%%02X\", ord(\$1))/seg; print \"\$new\n\";'" 32 | alias urldecode="perl -e '\$new=\$ARGV[0]; \$new =~ s/\%([A-Fa-f0-9]{2})/pack(\"C\", hex(\$1))/seg; print \"\$new\n\";'" 33 | fi 34 | fi 35 | 36 | unset URLTOOLS_METHOD -------------------------------------------------------------------------------- /themes/dieter.zsh-theme: -------------------------------------------------------------------------------- 1 | # the idea of this theme is to contain a lot of info in a small string, by 2 | # compressing some parts and colorcoding, which bring useful visual cues, 3 | # while limiting the amount of colors and such to keep it easy on the eyes. 4 | # When a command exited >0, the timestamp will be in red and the exit code 5 | # will be on the right edge. 6 | # The exit code visual cues will only display once. 7 | # (i.e. they will be reset, even if you hit enter a few times on empty command prompts) 8 | 9 | typeset -A host_repr 10 | 11 | # translate hostnames into shortened, colorcoded strings 12 | host_repr=('dieter-ws-a7n8x-arch' "%{$fg_bold[green]%}ws" 'dieter-p4sci-arch' "%{$fg_bold[blue]%}p4") 13 | 14 | # local time, color coded by last return code 15 | time_enabled="%(?.%{$fg[green]%}.%{$fg[red]%})%*%{$reset_color%}" 16 | time_disabled="%{$fg[green]%}%*%{$reset_color%}" 17 | time=$time_enabled 18 | 19 | # user part, color coded by privileges 20 | local user="%(!.%{$fg[blue]%}.%{$fg[blue]%})%n%{$reset_color%}" 21 | 22 | # Hostname part. compressed and colorcoded per host_repr array 23 | # if not found, regular hostname in default color 24 | local host="@${host_repr[$(hostname)]:-$(hostname)}%{$reset_color%}" 25 | 26 | # Compacted $PWD 27 | local pwd="%{$fg[blue]%}%c%{$reset_color%}" 28 | 29 | PROMPT='${time} ${user}${host} ${pwd} $(git_prompt_info)' 30 | 31 | # i would prefer 1 icon that shows the "most drastic" deviation from HEAD, 32 | # but lets see how this works out 33 | ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}" 34 | ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} " 35 | ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%} %{$fg[yellow]%}?%{$fg[green]%}%{$reset_color%}" 36 | ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%}" 37 | 38 | # elaborate exitcode on the right when >0 39 | return_code_enabled="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" 40 | return_code_disabled= 41 | return_code=$return_code_enabled 42 | 43 | RPS1='${return_code}' 44 | 45 | function accept-line-or-clear-warning () { 46 | if [[ -z $BUFFER ]]; then 47 | time=$time_disabled 48 | return_code=$return_code_disabled 49 | else 50 | time=$time_enabled 51 | return_code=$return_code_enabled 52 | fi 53 | zle accept-line 54 | } 55 | zle -N accept-line-or-clear-warning 56 | bindkey '^M' accept-line-or-clear-warning 57 | -------------------------------------------------------------------------------- /plugins/screen/screen.plugin.zsh: -------------------------------------------------------------------------------- 1 | # if using GNU screen, let the zsh tell screen what the title and hardstatus 2 | # of the tab window should be. 3 | if [[ "$TERM" == screen* ]]; then 4 | if [[ $_GET_PATH == '' ]]; then 5 | _GET_PATH='echo $PWD | sed "s/^\/Users\//~/;s/^\/home\//~/;s/^~$USER/~/"' 6 | fi 7 | if [[ $_GET_HOST == '' ]]; then 8 | _GET_HOST='echo $HOST | sed "s/\..*//"' 9 | fi 10 | 11 | # use the current user as the prefix of the current tab title 12 | TAB_TITLE_PREFIX='"`'$_GET_HOST'`:`'$_GET_PATH' | sed "s:..*/::"`$PROMPT_CHAR"' 13 | # when at the shell prompt, show a truncated version of the current path (with 14 | # standard ~ replacement) as the rest of the title. 15 | TAB_TITLE_PROMPT='$SHELL:t' 16 | # when running a command, show the title of the command as the rest of the 17 | # title (truncate to drop the path to the command) 18 | TAB_TITLE_EXEC='$cmd[1]:t' 19 | 20 | # use the current path (with standard ~ replacement) in square brackets as the 21 | # prefix of the tab window hardstatus. 22 | TAB_HARDSTATUS_PREFIX='"[`'$_GET_PATH'`] "' 23 | # when at the shell prompt, use the shell name (truncated to remove the path to 24 | # the shell) as the rest of the title 25 | TAB_HARDSTATUS_PROMPT='$SHELL:t' 26 | # when running a command, show the command name and arguments as the rest of 27 | # the title 28 | TAB_HARDSTATUS_EXEC='$cmd' 29 | 30 | # tell GNU screen what the tab window title ($1) and the hardstatus($2) should be 31 | function screen_set() 32 | { 33 | # set the tab window title (%t) for screen 34 | print -nR $'\033k'$1$'\033'\\\ 35 | 36 | # set hardstatus of tab window (%h) for screen 37 | print -nR $'\033]0;'$2$'\a' 38 | } 39 | # called by zsh before executing a command 40 | function preexec() 41 | { 42 | local -a cmd; cmd=(${(z)1}) # the command string 43 | eval "tab_title=$TAB_TITLE_PREFIX:$TAB_TITLE_EXEC" 44 | eval "tab_hardstatus=$TAB_HARDSTATUS_PREFIX:$TAB_HARDSTATUS_EXEC" 45 | screen_set $tab_title $tab_hardstatus 46 | } 47 | # called by zsh before showing the prompt 48 | function precmd() 49 | { 50 | eval "tab_title=$TAB_TITLE_PREFIX:$TAB_TITLE_PROMPT" 51 | eval "tab_hardstatus=$TAB_HARDSTATUS_PREFIX:$TAB_HARDSTATUS_PROMPT" 52 | screen_set $tab_title $tab_hardstatus 53 | } 54 | fi -------------------------------------------------------------------------------- /oh-my-zsh.sh: -------------------------------------------------------------------------------- 1 | # Check for updates on initial load... 2 | if [ "$DISABLE_AUTO_UPDATE" != "true" ] 3 | then 4 | /usr/bin/env ZSH=$ZSH zsh $ZSH/tools/check_for_upgrade.sh 5 | fi 6 | 7 | # Initializes Oh My Zsh 8 | 9 | # add a function path 10 | fpath=($ZSH/functions $ZSH/completions $fpath) 11 | 12 | # Load all of the config files in ~/oh-my-zsh that end in .zsh 13 | # TIP: Add files you don't want in git to .gitignore 14 | for config_file ($ZSH/lib/*.zsh); do 15 | source $config_file 16 | done 17 | 18 | # Set ZSH_CUSTOM to the path where your custom config files 19 | # and plugins exists, or else we will use the default custom/ 20 | if [[ -z "$ZSH_CUSTOM" ]]; then 21 | ZSH_CUSTOM="$ZSH/custom" 22 | fi 23 | 24 | 25 | is_plugin() { 26 | local base_dir=$1 27 | local name=$2 28 | test -f $base_dir/plugins/$name/$name.plugin.zsh \ 29 | || test -f $base_dir/plugins/$name/_$name 30 | } 31 | # Add all defined plugins to fpath. This must be done 32 | # before running compinit. 33 | for plugin ($plugins); do 34 | if is_plugin $ZSH_CUSTOM $plugin; then 35 | fpath=($ZSH_CUSTOM/plugins/$plugin $fpath) 36 | elif is_plugin $ZSH $plugin; then 37 | fpath=($ZSH/plugins/$plugin $fpath) 38 | fi 39 | done 40 | 41 | # Load and run compinit 42 | autoload -U compinit 43 | compinit -i 44 | 45 | 46 | # Load all of the plugins that were defined in ~/.zshrc 47 | for plugin ($plugins); do 48 | if [ -f $ZSH_CUSTOM/plugins/$plugin/$plugin.plugin.zsh ]; then 49 | source $ZSH_CUSTOM/plugins/$plugin/$plugin.plugin.zsh 50 | elif [ -f $ZSH/plugins/$plugin/$plugin.plugin.zsh ]; then 51 | source $ZSH/plugins/$plugin/$plugin.plugin.zsh 52 | fi 53 | done 54 | 55 | # Load all of your custom configurations from custom/ 56 | for config_file ($ZSH_CUSTOM/*.zsh(N)); do 57 | source $config_file 58 | done 59 | unset config_file 60 | 61 | # Load the theme 62 | if [ "$ZSH_THEME" = "random" ] 63 | then 64 | themes=($ZSH/themes/*zsh-theme) 65 | N=${#themes[@]} 66 | ((N=(RANDOM%N)+1)) 67 | RANDOM_THEME=${themes[$N]} 68 | source "$RANDOM_THEME" 69 | echo "[oh-my-zsh] Random theme '$RANDOM_THEME' loaded..." 70 | else 71 | if [ ! "$ZSH_THEME" = "" ] 72 | then 73 | if [ -f "$ZSH_CUSTOM/$ZSH_THEME.zsh-theme" ] 74 | then 75 | source "$ZSH_CUSTOM/$ZSH_THEME.zsh-theme" 76 | else 77 | source "$ZSH/themes/$ZSH_THEME.zsh-theme" 78 | fi 79 | fi 80 | fi 81 | -------------------------------------------------------------------------------- /plugins/extract/extract.plugin.zsh: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------------ 2 | # FILE: extract.plugin.zsh 3 | # DESCRIPTION: oh-my-zsh plugin file. 4 | # AUTHOR: Sorin Ionescu (sorin.ionescu@gmail.com) 5 | # VERSION: 1.0.1 6 | # ------------------------------------------------------------------------------ 7 | 8 | 9 | function extract() { 10 | local remove_archive 11 | local success 12 | local file_name 13 | local extract_dir 14 | 15 | if (( $# == 0 )); then 16 | echo "Usage: extract [-option] [file ...]" 17 | echo 18 | echo Options: 19 | echo " -r, --remove Remove archive." 20 | echo 21 | echo "Report bugs to ." 22 | fi 23 | 24 | remove_archive=1 25 | if [[ "$1" == "-r" ]] || [[ "$1" == "--remove" ]]; then 26 | remove_archive=0 27 | shift 28 | fi 29 | 30 | while (( $# > 0 )); do 31 | if [[ ! -f "$1" ]]; then 32 | echo "extract: '$1' is not a valid file" 1>&2 33 | shift 34 | continue 35 | fi 36 | 37 | success=0 38 | file_name="$( basename "$1" )" 39 | extract_dir="$( echo "$file_name" | sed "s/\.${1##*.}//g" )" 40 | case "$1" in 41 | (*.tar.gz|*.tgz) tar xvzf "$1" ;; 42 | (*.tar.bz2|*.tbz|*.tbz2) tar xvjf "$1" ;; 43 | (*.tar.xz|*.txz) tar --xz --help &> /dev/null \ 44 | && tar --xz -xvf "$1" \ 45 | || xzcat "$1" | tar xvf - ;; 46 | (*.tar.zma|*.tlz) tar --lzma --help &> /dev/null \ 47 | && tar --lzma -xvf "$1" \ 48 | || lzcat "$1" | tar xvf - ;; 49 | (*.tar) tar xvf "$1" ;; 50 | (*.gz) gunzip "$1" ;; 51 | (*.bz2) bunzip2 "$1" ;; 52 | (*.xz) unxz "$1" ;; 53 | (*.lzma) unlzma "$1" ;; 54 | (*.Z) uncompress "$1" ;; 55 | (*.zip) unzip "$1" -d $extract_dir ;; 56 | (*.rar) unrar e -ad "$1" ;; 57 | (*.7z) 7za x "$1" ;; 58 | (*.deb) 59 | mkdir -p "$extract_dir/control" 60 | mkdir -p "$extract_dir/data" 61 | cd "$extract_dir"; ar vx "../${1}" > /dev/null 62 | cd control; tar xzvf ../control.tar.gz 63 | cd ../data; tar xzvf ../data.tar.gz 64 | cd ..; rm *.tar.gz debian-binary 65 | cd .. 66 | ;; 67 | (*) 68 | echo "extract: '$1' cannot be extracted" 1>&2 69 | success=1 70 | ;; 71 | esac 72 | 73 | (( success = $success > 0 ? $success : $? )) 74 | (( $success == 0 )) && (( $remove_archive == 0 )) && rm "$1" 75 | shift 76 | done 77 | } 78 | 79 | alias x=extract 80 | 81 | -------------------------------------------------------------------------------- /plugins/sprunge/sprunge.plugin.zsh: -------------------------------------------------------------------------------- 1 | # Contributed and SLIGHTLY modded by Matt Parnell/ilikenwf 2 | # Created by the blogger at the URL below...I don't know where to find his/her name 3 | # Original found at http://www.shellperson.net/sprunge-pastebin-script/ 4 | 5 | usage() { 6 | description | fmt -s >&2 7 | } 8 | 9 | description() { 10 | cat << HERE 11 | 12 | DESCRIPTION 13 | Upload data and fetch URL from the pastebin http://sprunge.us 14 | 15 | USAGE 16 | $0 filename.txt 17 | $0 text string 18 | $0 < filename.txt 19 | piped_data | $0 20 | 21 | NOTES 22 | -------------------------------------------------------------------------- 23 | * INPUT METHODS * 24 | $0 can accept piped data, STDIN redirection [&2 45 | if [ "$*" ]; then 46 | echo Arguments present... >&2 47 | if [ -f "$*" ]; then 48 | echo Uploading the contents of "$*"... >&2 49 | cat "$*" 50 | else 51 | echo Uploading the text: \""$*"\"... >&2 52 | echo "$*" 53 | fi | curl -F 'sprunge=<-' http://sprunge.us 54 | else 55 | echo No arguments found, printing USAGE and exiting. >&2 56 | usage 57 | fi 58 | else 59 | echo Using input from a pipe or STDIN redirection... >&2 60 | curl -F 'sprunge=<-' http://sprunge.us 61 | fi 62 | } 63 | -------------------------------------------------------------------------------- /plugins/gem/_gem: -------------------------------------------------------------------------------- 1 | #compdef gem 2 | #autoload 3 | 4 | # gem zsh completion, based on homebrew completion 5 | 6 | _gem_installed() { 7 | installed_gems=(`gem list --local --no-versions`) 8 | } 9 | 10 | local -a _1st_arguments 11 | _1st_arguments=( 12 | 'cert:Manage RubyGems certificates and signing settings' 13 | 'check:Check installed gems' 14 | 'cleanup:Clean up old versions of installed gems in the local repository' 15 | 'contents:Display the contents of the installed gems' 16 | 'dependency:Show the dependencies of an installed gem' 17 | 'environment:Display information about the RubyGems environment' 18 | 'fetch:Download a gem and place it in the current directory' 19 | 'generate_index:Generates the index files for a gem server directory' 20 | 'help:Provide help on the `gem` command' 21 | 'install:Install a gem into the local repository' 22 | 'list:Display gems whose name starts with STRING' 23 | 'lock:Generate a lockdown list of gems' 24 | 'mirror:Mirror a gem repository' 25 | 'outdated:Display all gems that need updates' 26 | 'owner:Manage gem owners on RubyGems.org.' 27 | 'pristine:Restores installed gems to pristine condition from files located in the gem cache' 28 | 'push:Push a gem up to RubyGems.org' 29 | 'query:Query gem information in local or remote repositories' 30 | 'rdoc:Generates RDoc for pre-installed gems' 31 | 'search:Display all gems whose name contains STRING' 32 | 'server:Documentation and gem repository HTTP server' 33 | 'sources:Manage the sources and cache file RubyGems uses to search for gems' 34 | 'specification:Display gem specification (in yaml)' 35 | 'stale:List gems along with access times' 36 | 'uninstall:Uninstall gems from the local repository' 37 | 'unpack:Unpack an installed gem to the current directory' 38 | 'update:Update the named gems (or all installed gems) in the local repository' 39 | 'which:Find the location of a library file you can require' 40 | ) 41 | 42 | local expl 43 | local -a gems installed_gems 44 | 45 | _arguments \ 46 | '(-v --version)'{-v,--version}'[show version]' \ 47 | '(-h --help)'{-h,--help}'[show help]' \ 48 | '*:: :->subcmds' && return 0 49 | 50 | if (( CURRENT == 1 )); then 51 | _describe -t commands "gem subcommand" _1st_arguments 52 | return 53 | fi 54 | 55 | case "$words[1]" in 56 | list) 57 | if [[ "$state" == forms ]]; then 58 | _gem_installed 59 | _requested installed_gems expl 'installed gems' compadd -a installed_gems 60 | fi ;; 61 | uninstall|update) 62 | _gem_installed 63 | _wanted installed_gems expl 'installed gems' compadd -a installed_gems ;; 64 | esac 65 | --------------------------------------------------------------------------------