Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge branch 'master' of git://github.com/robbyrussell/oh-my-zsh into…

… taskwarrior-plugin
  • Loading branch information...
commit 8411a39a869cd80474e3898f2fa4f204599b943a 2 parents 1e86678 + 142c03d
petec lepht authored

Showing 31 changed files with 598 additions and 29 deletions. Show diff stats Hide diff stats

  1. +1 0  .gitignore
  2. +4 2 README.textile
  3. +2 0  custom/example/example.plugin.zsh
  4. +1 1  lib/functions.zsh
  5. +5 3 oh-my-zsh.sh
  6. +26 0 plugins/ant/ant.plugin.zsh
  7. +3 0  plugins/autojump/autojump.plugin.zsh
  8. +17 7 plugins/brew/_brew
  9. +13 0 plugins/brew/brew.plugin.zsh
  10. +1 1  plugins/cap/cap.plugin.zsh
  11. +0 2  plugins/compleat/compleat.plugin.zsh
  12. +0 1  plugins/github/github.plugin.zsh
  13. +26 0 plugins/gpg-agent/gpg-agent.plugin.zsh
  14. +8 0 plugins/node/node.plugin.zsh
  15. +2 0  plugins/npm/npm.plugin.zsh
  16. +6 0 plugins/osx/osx.plugin.zsh
  17. +0 1  plugins/phing/phing.plugin.zsh
  18. +10 0 plugins/pow/pow.plugin.zsh
  19. +3 1 plugins/ruby/ruby.plugin.zsh
  20. +147 0 plugins/rvm/_rvm
  21. +52 0 plugins/rvm/rvm.plugin.zsh
  22. +5 7 plugins/textmate/textmate.plugin.zsh
  23. +4 0 plugins/thor/_thor
  24. +14 3 themes/fishy.zsh-theme
  25. +6 0 themes/fwalch.zsh-theme
  26. +15 0 themes/minimal.zsh-theme
  27. +11 0 themes/obraun.zsh-theme
  28. +15 0 themes/re5et.zsh-theme
  29. +6 0 themes/simple.zsh-theme
  30. +100 0 themes/steeef.zsh-theme
  31. +95 0 themes/trapd00r.zsh-theme
1  .gitignore
@@ -2,6 +2,7 @@ locals.zsh
2 2 log/.zsh_history
3 3 projects.zsh
4 4 custom/*
  5 +!custom/example
5 6 !custom/example.zsh
6 7 cache
7 8 *.swp
6 README.textile
Source Rendered
@@ -48,7 +48,9 @@ the "refcard":http://www.bash2zsh.com/zsh_refcard/refcard.pdf is pretty tasty fo
48 48 h3. Customization
49 49
50 50 If you want to override any of the default behavior, just add a new file (ending in @.zsh@) into the @custom/@ directory.
51   -If you have many functions which go good together you can put them as a *.plugin.zsh file in the @plugin/@ directory and then enable this plugin.
  51 +If you have many functions which go good together you can put them as a *.plugin.zsh file in the @custom/plugins/@ directory and then enable this plugin.
  52 +If you would like to override the functionality of a plugin distributed with oh-my-zsh, create a plugin of the same name in the @custom/plugins/@ directory and it will be loaded instead of the one in @plugins/@.
  53 +
52 54
53 55 h3. Uninstalling
54 56
@@ -68,4 +70,4 @@ This project wouldn't exist without all of our awesome users and contributors.
68 70
69 71 * "View our growing list of contributors":https://github.com/robbyrussell/oh-my-zsh/contributors
70 72
71   -Thank you so much!
  73 +Thank you so much!
2  custom/example/example.plugin.zsh
... ... @@ -0,0 +1,2 @@
  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.
2  lib/functions.zsh
@@ -29,7 +29,7 @@ function extract() {
29 29 *.tar.xz) tar xvJf $1;;
30 30 *.tar.lzma) tar --lzma -xvf $1;;
31 31 *.bz2) bunzip $1;;
32   - *.rar) unrar $1;;
  32 + *.rar) unrar x $1;;
33 33 *.gz) gunzip $1;;
34 34 *.tar) tar xvf $1;;
35 35 *.tbz2) tar xvjf $1;;
8 oh-my-zsh.sh
... ... @@ -1,7 +1,7 @@
1 1 # Initializes Oh My Zsh
2 2
3 3 # add a function path
4   -fpath=($ZSH/functions $fpath)
  4 +fpath=($ZSH/functions $ZSH/completions $fpath)
5 5
6 6 # Load all of the config files in ~/oh-my-zsh that end in .zsh
7 7 # TIP: Add files you don't want in git to .gitignore
@@ -17,7 +17,9 @@ compinit -i
17 17
18 18 # Load all of the plugins that were defined in ~/.zshrc
19 19 for plugin ($plugins); do
20   - if [ -f $ZSH/plugins/$plugin/$plugin.plugin.zsh ]; then
  20 + if [ -f $ZSH/custom/plugins/$plugin/$plugin.plugin.zsh ]; then
  21 + source $ZSH/custom/plugins/$plugin/$plugin.plugin.zsh
  22 + elif [ -f $ZSH/plugins/$plugin/$plugin.plugin.zsh ]; then
21 23 source $ZSH/plugins/$plugin/$plugin.plugin.zsh
22 24 fi
23 25 done
@@ -31,7 +33,7 @@ if [ "$ZSH_THEME" = "random" ]
31 33 then
32 34 themes=($ZSH/themes/*zsh-theme)
33 35 N=${#themes[@]}
34   - ((N=RANDOM%N))
  36 + ((N=(RANDOM%N)+1))
35 37 RANDOM_THEME=${themes[$N]}
36 38 source "$RANDOM_THEME"
37 39 echo "[oh-my-zsh] Random theme '$RANDOM_THEME' loaded..."
26 plugins/ant/ant.plugin.zsh
... ... @@ -0,0 +1,26 @@
  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 -f%m .ant_targets)
  12 + changed=$($stat_cmd -f%m 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 '/<target/s/<target.*name="\([^"]*\).*$/\1/p' build.xml > .ant_targets
  21 + fi
  22 + compadd `cat .ant_targets`
  23 + fi
  24 +}
  25 +
  26 +compdef _ant ant
3  plugins/autojump/autojump.plugin.zsh
... ... @@ -0,0 +1,3 @@
  1 +if [ -f `brew --prefix`/etc/autojump ]; then
  2 + . `brew --prefix`/etc/autojump
  3 +fi
24 plugins/brew/_brew
@@ -25,10 +25,12 @@ _1st_arguments=(
25 25 'link:link a formula'
26 26 'list:list files in a formula or not-installed formulae'
27 27 'log:git commit log for a formula'
  28 + 'missing:check all installed formuale for missing dependencies.'
28 29 'outdated:list formulas for which a newer version is available'
29 30 'prune:remove dead links'
30 31 'remove:remove a formula'
31 32 'search:search for a formula (/regex/ or string)'
  33 + 'server:start a local web app that lets you browse formulae (requires Sinatra)'
32 34 'unlink:unlink a formula'
33 35 'update:freshen up links'
34 36 'upgrade:upgrade outdated formulae'
@@ -36,10 +38,14 @@ _1st_arguments=(
36 38 )
37 39
38 40 local expl
39   -local -a formula installed_formulae
  41 +local -a formulae installed_formulae
40 42
41 43 _arguments \
42   - '(-v --verbose)'{-v,--verbose}'[verbose]' \
  44 + '(-v)-v[verbose]' \
  45 + '(--cellar)--cellar[brew cellar]' \
  46 + '(--config)--config[brew configuration]' \
  47 + '(--env)--env[brew environment]' \
  48 + '(--repository)--repository[brew repository]' \
43 49 '(--version)--version[version information]' \
44 50 '(--prefix)--prefix[where brew lives on this system]' \
45 51 '(--cache)--cache[brew cache]' \
@@ -51,20 +57,24 @@ if (( CURRENT == 1 )); then
51 57 fi
52 58
53 59 case "$words[1]" in
54   - list)
  60 + search|-S)
  61 + _arguments \
  62 + '(--macports)--macports[search the macports repository]' \
  63 + '(--fink)--fink[search the fink repository]' ;;
  64 + list|ls)
55 65 _arguments \
56 66 '(--unbrewed)--unbrewed[files in brew --prefix not controlled by brew]' \
  67 + '(--versions)--versions[list all installed versions of a formula]' \
57 68 '1: :->forms' && return 0
58 69
59 70 if [[ "$state" == forms ]]; then
60 71 _brew_installed_formulae
61   - _requested installed_formulae expl 'installed formulae' compadd -a installed_formulae
  72 + _wanted installed_formulae expl 'installed formulae' compadd -a installed_formulae
62 73 fi ;;
63   - install|home|log|info|uses|cat|deps)
  74 + install|home|homepage|log|info|abv|uses|cat|deps|edit|options)
64 75 _brew_all_formulae
65 76 _wanted formulae expl 'all formulae' compadd -a formulae ;;
66   - remove|edit|xo)
  77 + remove|rm|uninstall|unlink|cleanup|link|ln)
67 78 _brew_installed_formulae
68 79 _wanted installed_formulae expl 'installed formulae' compadd -a installed_formulae ;;
69 80 esac
70   -
13 plugins/brew/brew.plugin.zsh
... ... @@ -0,0 +1,13 @@
  1 +# Move /usr/local/bin (path where brews are linked) to the front of the path
  2 +# This will allow us to override system binaries like ruby with our brews
  3 +# TODO: Do this in a more compatible way.
  4 +# What if someone doesn't have /usr/bin in their path?
  5 +export PATH=`echo $PATH | sed -e 's|/usr/local/bin||' -e 's|::|:|g'` # Remove /usr/local/bin
  6 +export PATH=`echo $PATH | sed -e 's|/usr/bin|/usr/local/bin:&|'` # Add it in front of /usr/bin
  7 +export PATH=`echo $PATH | sed -e 's|/usr/bin|/usr/local/sbin:&|'` # Add /usr/local/sbin
  8 +
  9 +alias brews='brew list -1'
  10 +
  11 +function brew-link-completion {
  12 + ln -s "$(brew --prefix)/Library/Contributions/brew_zsh_completion.zsh" "$ZSH/plugins/brew/_brew.official"
  13 +}
2  plugins/cap/cap.plugin.zsh
@@ -18,4 +18,4 @@ function _cap () {
18 18 fi
19 19 }
20 20
21   -compctl -K _cap cap
  21 +compctl -K _cap cap
2  plugins/compleat/compleat.plugin.zsh
@@ -5,7 +5,6 @@
5 5 # VERSION: 1.0.0
6 6 # ------------------------------------------------------------------------------
7 7
8   -
9 8 if (( ${+commands[compleat]} )); then
10 9 local prefix="${commands[compleat]:h:h}"
11 10 local setup="${prefix}/share/compleat-1.0/compleat_setup"
@@ -19,4 +18,3 @@ if (( ${+commands[compleat]} )); then
19 18 source "$setup"
20 19 fi
21 20 fi
22   -
1  plugins/github/github.plugin.zsh
@@ -4,4 +4,3 @@ if [ "$commands[(I)hub]" ]; then
4 4 # eval `hub alias -s zsh`
5 5 function git(){hub "$@"}
6 6 fi
7   -
26 plugins/gpg-agent/gpg-agent.plugin.zsh
... ... @@ -0,0 +1,26 @@
  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
8 plugins/node/node.plugin.zsh
... ... @@ -0,0 +1,8 @@
  1 +# This works if you installed node via homebrew.
  2 +export NODE_PATH="/usr/local/lib/node"
  3 +
  4 +# Open the node api for your current version to the optional section.
  5 +# TODO: Make the section part easier to use.
  6 +function node-api {
  7 + open "http://nodejs.org/docs/$(node --version)/api/all.html#$1"
  8 +}
2  plugins/npm/npm.plugin.zsh
... ... @@ -0,0 +1,2 @@
  1 +# TODO: Don't do this in such a weird way.
  2 +export PATH=`echo $PATH | sed -e 's|/usr/bin|/usr/local/share/npm/bin:&|'`
6 plugins/osx/osx.plugin.zsh
... ... @@ -1,3 +1,9 @@
  1 +alias showfiles='defaults write com.apple.finder AppleShowAllFiles TRUE; killall Finder'
  2 +alias hidefiles='defaults write com.apple.finder AppleShowAllFiles FALSE; killall Finder'
  3 +
  4 +# Recursively delete .DS_Store files
  5 +alias rm-dsstore="find . -name '*.DS_Store' -type f -delete"
  6 +
1 7 function savepath() {
2 8 pwd > ~/.current_path~
3 9 }
1  plugins/phing/phing.plugin.zsh
@@ -10,7 +10,6 @@ _phing_does_target_list_need_generating () {
10 10 _phing () {
11 11 if [ -f build.xml ]; then
12 12 if _phing_does_target_list_need_generating; then
13   - echo "\nGenerating .phing_targets..." > /dev/stderr
14 13 phing -l |grep -v ":" |grep -v "^$"|grep -v "\-" > .phing_targets
15 14 fi
16 15 compadd `cat .phing_targets`
10 plugins/pow/pow.plugin.zsh
... ... @@ -0,0 +1,10 @@
  1 +# Thanks to Christopher Sexton
  2 +# https://gist.github.com/965032
  3 +function kapow {
  4 + touch ~/.pow/$1/tmp/restart.txt
  5 + if [ $? -eq 0 ]; then
  6 + echo "$fg[yellow]Pow restarting $1...$reset_color"
  7 + fi
  8 +}
  9 +
  10 +compctl -W ~/.pow -/ kapow
4 plugins/ruby/ruby.plugin.zsh
... ... @@ -1,4 +1,6 @@
  1 +# TODO: Make this compatible with rvm.
  2 +# Run sudo gem on the system ruby, not the active ruby.
1 3 alias sgem='sudo gem'
2 4
3 5 # Find ruby file
4   -alias rfind='find . -name *.rb | xargs grep -n'
  6 +alias rfind='find . -name *.rb | xargs grep -n'
147 plugins/rvm/_rvm
... ... @@ -0,0 +1,147 @@
  1 +#compdef rvm
  2 +
  3 +local curcontext="$curcontext" state line cmds ret=1
  4 +
  5 +_arguments -C \
  6 + '(- 1 *)'{-v,--version}'[display version information]' \
  7 + '(-l|--level)'{-l,--level}'+[patch level to use with rvm use / install]:number' \
  8 + '(--prefix)--prefix[path for all rvm files (~/.rvm/), with trailing slash!]:path:_files' \
  9 + '(--bin)--bin[path for binaries to be placed (~/.rvm/bin/)]:path:_files' \
  10 + '(--source)--source[src directory to use (~/.rvm/src/)]:path:_files' \
  11 + '(--archives)--archives[directory for downladed files (~/.rvm/archives/)]:path:_files' \
  12 + '-S[Specify a script file to attempt to load and run (rubydo)]:file:_files' \
  13 + '-e[Execute code from the command line]:code' \
  14 + '(-G)-G[root gem path to use]:path:_files' \
  15 + '(--gems)--gems[Used to set the gems_flag, use with remove to remove gems]' \
  16 + '(--archive)--archive[Used to set the archive_flag, use with remove to remove archive]' \
  17 + '(--patch)--patch[With MRI Rubies you may specify one or more full paths to patches]' \
  18 + '(-C|--configure)'{-C,--configure}'=[custom configure options]' \
  19 + '(--nice)--nice[process niceness (for slow computers, default 0)]:number' \
  20 + '(--ree)--ree-options[Options passed directly to ree ./installer on the command line]:options' \
  21 + '(--head)--head[with update, updates rvm to git head version]' \
  22 + '(--rubygems)--rubygems[with update, updates rubygems for selected ruby]' \
  23 + '(--default)--default[with ruby select, sets a default ruby for new shells]' \
  24 + '(--debug)--debug[Toggle debug mode on for very verbose output]' \
  25 + '(--trace)--trace[Toggle trace mode on to see EVERYTHING rvm is doing]' \
  26 + '(--force)--force[Force install, removes old install & source before install]' \
  27 + '(--summary)--summary[Used with rubydo to print out a summary of the commands run]' \
  28 + '(--latest)--latest[with gemset --dump skips version strings for latest gem]' \
  29 + '(--gems)--gems[with uninstall/remove removes gems with the interpreter]' \
  30 + '(--docs)--docs[with install, attempt to generate ri after installation]' \
  31 + '(--reconfigure)--reconfigure[Force ./configure on install even if Makefile already exists]' \
  32 + '1: :->cmds' \
  33 + '*: :->args' && ret=0
  34 +
  35 +case $state in
  36 + cmds)
  37 + cmds=(
  38 + "version:show the rvm version installed in rvm_path"
  39 + "use:setup current shell to use a specific ruby version"
  40 + "reload:reload rvm source itself (useful after changing rvm source)"
  41 + "implode:(seppuku) removes the rvm installation completely. This means everything in $rvm_path (~/.rvm)."
  42 + "update:upgrades rvm to the latest version."
  43 + "reset:remove current and stored default & system settings."
  44 + "info :show the *current* environment information for current ruby"
  45 + "current:print the *current* ruby version and the name of any gemset being used."
  46 + "debug:show info plus additional information for common issues"
  47 + "install:install one or many ruby versions"
  48 + "uninstall:uninstall one or many ruby versions, leaves their sources"
  49 + "remove:uninstall one or many ruby versions and remove their sources"
  50 + "migrate:Lets you migrate all gemsets from one ruby to another."
  51 + "upgrade:Lets you upgrade from one version of a ruby to another, including migrating your gemsets semi-automatically."
  52 + "wrapper:generates a set of wrapper executables for a given ruby with the specified ruby and gemset combination. Used under the hood for passenger support and the like."
  53 + "cleanup:Lets you remove stale source folders / archives and other miscellaneous data associated with rvm."
  54 + "repair:Lets you repair parts of your environment e.g. wrappers, env files and and similar files (e.g. general maintenance)."
  55 + "snapshot:Lets your backup / restore an rvm installation in a lightweight manner."
  56 + "disk-usage:Tells you how much disk space rvm install is using."
  57 + "tools:Provides general information about the ruby environment, primarily useful when scripting rvm."
  58 + "docs:Tools to make installing ri and rdoc documentation easier."
  59 + "rvmrc:Tools related to managing rvmrc trust and loading."
  60 + "exec:runs an arbitrary command as a set operation."
  61 + "ruby:runs a named ruby file against specified and/or all rubies"
  62 + "gem:runs a gem command using selected ruby's 'gem'"
  63 + "rake:runs a rake task against specified and/or all rubies"
  64 + "tests:runs 'rake test' across selected ruby versions"
  65 + "specs:runs 'rake spec' across selected ruby versions"
  66 + "monitor:Monitor cwd for testing, run rake {spec,test} on changes."
  67 + "gemset:gemsets: http://rvm.beginrescueend.com/gemsets/"
  68 + "rubygems:Switches the installed version of rubygems for the current ruby."
  69 + "gemdir:display the path to the current gem directory (GEM_HOME)."
  70 + "srcdir:display the path to rvm source directory (may be yanked)"
  71 + "fetch:Performs an archive / src fetch only of the selected ruby."
  72 + "list:show currently installed rubies, interactive output."
  73 + "package:Install a dependency package {readline,iconv,zlib,openssl}"
  74 + "notes:Display notes, with operating system specifics."
  75 + "export:Temporarily set an environment variable in the current shell."
  76 + "unexport:Undo changes made to the environment by 'rvm export'."
  77 + )
  78 + _describe -t commands 'rvm command' cmds && ret=0
  79 + ;;
  80 + args)
  81 + case $line[1] in
  82 + (use|uninstall|remove|list)
  83 + _values -S , 'rubies' $(rvm list strings | sed -e 's/ruby-\([^) ]*\)-\([^) ]*\)/ruby-\1-\2 \1-\2 \1/g') default system && ret=0
  84 + ;;
  85 + (install|fetch)
  86 + _values -S , 'rubies' $(rvm list known_strings) && ret=0
  87 + ;;
  88 + gemset)
  89 + if (( CURRENT == 3 )); then
  90 + _values 'gemset_commands' \
  91 + 'import' \
  92 + 'export' \
  93 + 'create' \
  94 + 'copy' \
  95 + 'rename' \
  96 + 'empty' \
  97 + 'delete' \
  98 + 'name' \
  99 + 'dir' \
  100 + 'list' \
  101 + 'list_all' \
  102 + 'gemdir' \
  103 + 'install' \
  104 + 'pristine' \
  105 + 'clear' \
  106 + 'use' \
  107 + 'update' \
  108 + 'unpack' \
  109 + 'globalcache'
  110 + else
  111 + _values -S , 'gemsets' $(rvm gemset list | grep -v gemset 2>/dev/null)
  112 + fi
  113 + ret=0
  114 + ;;
  115 + package)
  116 + if (( CURRENT == 3 )); then
  117 + _values 'package_commands' \
  118 + 'install' \
  119 + 'uninstall'
  120 + else
  121 + _values 'packages' \
  122 + 'readline' \
  123 + 'iconv' \
  124 + 'curl' \
  125 + 'openssl' \
  126 + 'zlib' \
  127 + 'autoconf' \
  128 + 'ncurses' \
  129 + 'pkgconfig' \
  130 + 'gettext' \
  131 + 'glib' \
  132 + 'mono' \
  133 + 'llvm' \
  134 + 'libxml2' \
  135 + 'libxslt' \
  136 + 'libyaml'
  137 + fi
  138 + ret=0
  139 + ;;
  140 + *)
  141 + (( ret )) && _message 'no more arguments'
  142 + ;;
  143 + esac
  144 + ;;
  145 +esac
  146 +
  147 +return ret
52 plugins/rvm/rvm.plugin.zsh
... ... @@ -0,0 +1,52 @@
  1 +fpath=($ZSH/plugins/rvm $fpath)
  2 +autoload -U compinit
  3 +compinit -i
  4 +
  5 +alias rubies='rvm list rubies'
  6 +alias gemsets='rvm gemset list'
  7 +
  8 +local ruby18='ruby-1.8.7-p334'
  9 +local ruby19='ruby-1.9.2-p180'
  10 +
  11 +function rb18 {
  12 + if [ -z "$1" ]; then
  13 + rvm use "$ruby18"
  14 + else
  15 + rvm use "$ruby18@$1"
  16 + fi
  17 +}
  18 +
  19 +_rb18() {compadd `ls -1 $rvm_path/gems | grep "^$ruby18@" | sed -e "s/^$ruby18@//" | awk '{print $1}'`}
  20 +compdef _rb18 rb18
  21 +
  22 +function rb19 {
  23 + if [ -z "$1" ]; then
  24 + rvm use "$ruby19"
  25 + else
  26 + rvm use "$ruby19@$1"
  27 + fi
  28 +}
  29 +
  30 +_rb19() {compadd `ls -1 $rvm_path/gems | grep "^$ruby19@" | sed -e "s/^$ruby19@//" | awk '{print $1}'`}
  31 +compdef _rb19 rb19
  32 +
  33 +function rvm-update {
  34 + rvm get head
  35 + rvm reload # TODO: Reload rvm completion?
  36 +}
  37 +
  38 +function rvm-link-completion {
  39 + ln -s "$rvm_path/scripts/zsh/Completion/_rvm" "$ZSH/plugins/rvm/_rvm.official"
  40 +}
  41 +
  42 +# TODO: Make this usable w/o rvm.
  43 +function gems {
  44 + local current_ruby=`rvm-prompt i v p`
  45 + local current_gemset=`rvm-prompt g`
  46 +
  47 + gem list $@ | sed \
  48 + -Ee "s/\([0-9\.]+( .+)?\)/$fg[blue]&$reset_color/g" \
  49 + -Ee "s|$(echo $rvm_path)|$fg[magenta]\$rvm_path$reset_color|g" \
  50 + -Ee "s/$current_ruby@global/$fg[yellow]&$reset_color/g" \
  51 + -Ee "s/$current_ruby$current_gemset$/$fg[green]&$reset_color/g"
  52 +}
12 plugins/textmate/textmate.plugin.zsh
... ... @@ -1,11 +1,9 @@
  1 +alias et='mate .'
  2 +alias ett='mate app config 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'
1 5
2   -# TextMate
3   -alias et='mate . &'
4   -alias ett='mate app config lib db public spec test Rakefile Capfile Todo &'
5   -alias etp='mate app config lib db public spec test vendor/plugins vendor/gems Rakefile Capfile Todo &'
6   -alias etts='mate app config lib db public script spec test vendor/plugins vendor/gems Rakefile Capfile Todo &'
7   -
8   -# Editor Ruby file in TextMate
  6 +# Edit Ruby app in TextMate
9 7 alias mr='mate CHANGELOG app config db lib public script spec test'
10 8
11 9 function tm() {
4 plugins/thor/_thor
... ... @@ -0,0 +1,4 @@
  1 +#compdef thor
  2 +#autoload
  3 +
  4 +compadd `thor list | grep thor | cut -d " " -f 2`
17 themes/fishy.zsh-theme
@@ -3,7 +3,18 @@
3 3 local user_color='green'; [ $UID -eq 0 ] && user_color='red'
4 4 PROMPT='%n@%m %{$fg[$user_color]%}%~%{$reset_color%}%(!.#.>) '
5 5 PROMPT2='%{$fg[red]%}\ %{$reset_color%}'
6   -RPS1='%(?..%{$fg[red]%}%? ↵%{$reset_color%})$(git_prompt_info)'
7 6
8   -ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[cyan]%}"
9   -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
  7 +local return_status="%{$fg_bold[red]%}%(?..%?)%{$reset_color%}"
  8 +RPROMPT='${return_status}$(git_prompt_info)$(git_prompt_status)%{$reset_color%}'
  9 +
  10 +ZSH_THEME_GIT_PROMPT_PREFIX=" "
  11 +ZSH_THEME_GIT_PROMPT_SUFFIX=""
  12 +ZSH_THEME_GIT_PROMPT_DIRTY=""
  13 +ZSH_THEME_GIT_PROMPT_CLEAN=""
  14 +
  15 +ZSH_THEME_GIT_PROMPT_ADDED="%{$fg_bold[green]%}+"
  16 +ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg_bold[blue]%}!"
  17 +ZSH_THEME_GIT_PROMPT_DELETED="%{$fg_bold[red]%}-"
  18 +ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg_bold[magenta]%}>"
  19 +ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg_bold[yellow]%}#"
  20 +ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg_bold[cyan]%}?"
6 themes/fwalch.zsh-theme
... ... @@ -0,0 +1,6 @@
  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]%})"
15 themes/minimal.zsh-theme
... ... @@ -0,0 +1,15 @@
  1 +ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[white]%}["
  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 "- $ZSH_THEME_GIT_PROMPT_PREFIX$(current_branch)$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_SUFFIX"
  11 + fi
  12 +}
  13 +
  14 +
  15 +PROMPT='%2~ $(git_custom_status) »%b '
11 themes/obraun.zsh-theme
... ... @@ -0,0 +1,11 @@
  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 +
15 themes/re5et.zsh-theme
... ... @@ -0,0 +1,15 @@
  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]%} ♥"
6 themes/simple.zsh-theme
... ... @@ -0,0 +1,6 @@
  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=" ✔"
100 themes/steeef.zsh-theme
... ... @@ -0,0 +1,100 @@
  1 +# prompt style and colors based on Steve Losh's Prose theme:
  2 +# http://github.com/sjl/oh-my-zsh/blob/master/themes/prose.zsh-theme
  3 +#
  4 +# vcs_info modifications from Bart Trojanowski's zsh prompt:
  5 +# http://www.jukie.net/bart/blog/pimping-out-zsh-prompt
  6 +#
  7 +# git untracked files modification from Brian Carper:
  8 +# http://briancarper.net/blog/570/git-info-in-your-zsh-prompt
  9 +
  10 +function virtualenv_info {
  11 + [ $VIRTUAL_ENV ] && echo '('`basename $VIRTUAL_ENV`') '
  12 +}
  13 +PR_GIT_UPDATE=1
  14 +
  15 +setopt prompt_subst
  16 +autoload colors
  17 +colors
  18 +
  19 +autoload -U add-zsh-hook
  20 +autoload -Uz vcs_info
  21 +
  22 +#use extended color pallete if available
  23 +if [[ $TERM = *256color* || $TERM = *rxvt* ]]; then
  24 + turquoise="%F{81}"
  25 + orange="%F{166}"
  26 + purple="%F{135}"
  27 + hotpink="%F{161}"
  28 + limegreen="%F{118}"
  29 +else
  30 + turquoise="$fg[cyan]"
  31 + orange="$fg[yellow]"
  32 + purple="$fg[magenta]"
  33 + hotpink="$fg[red]"
  34 + limegreen="$fg[green]"
  35 +fi
  36 +
  37 +# enable VCS systems you use
  38 +zstyle ':vcs_info:*' enable git svn
  39 +
  40 +# check-for-changes can be really slow.
  41 +# you should disable it, if you work with large repositories
  42 +zstyle ':vcs_info:*:prompt:*' check-for-changes true
  43 +
  44 +# set formats
  45 +# %b - branchname
  46 +# %u - unstagedstr (see below)
  47 +# %c - stagedstr (see below)
  48 +# %a - action (e.g. rebase-i)
  49 +# %R - repository path
  50 +# %S - path in the repository
  51 +PR_RST="%{${reset_color}%}"
  52 +FMT_BRANCH="(%{$turquoise%}%b%u%c${PR_RST})"
  53 +FMT_ACTION="(%{$limegreen%}%a${PR_RST})"
  54 +FMT_UNSTAGED="%{$orange%}●"
  55 +FMT_STAGED="%{$limegreen%}●"
  56 +
  57 +zstyle ':vcs_info:*:prompt:*' unstagedstr "${FMT_UNSTAGED}"
  58 +zstyle ':vcs_info:*:prompt:*' stagedstr "${FMT_STAGED}"
  59 +zstyle ':vcs_info:*:prompt:*' actionformats "${FMT_BRANCH}${FMT_ACTION}"
  60 +zstyle ':vcs_info:*:prompt:*' formats "${FMT_BRANCH}"
  61 +zstyle ':vcs_info:*:prompt:*' nvcsformats ""
  62 +
  63 +
  64 +function steeef_preexec {
  65 + case "$(history $HISTCMD)" in
  66 + *git*)
  67 + PR_GIT_UPDATE=1
  68 + ;;
  69 + *svn*)
  70 + PR_GIT_UPDATE=1
  71 + ;;
  72 + esac
  73 +}
  74 +add-zsh-hook preexec steeef_preexec
  75 +
  76 +function steeef_chpwd {
  77 + PR_GIT_UPDATE=1
  78 +}
  79 +add-zsh-hook chpwd steeef_chpwd
  80 +
  81 +function steeef_precmd {
  82 + if [[ -n "$PR_GIT_UPDATE" ]] ; then
  83 + # check for untracked files or updated submodules, since vcs_info doesn't
  84 + if [[ ! -z $(git ls-files --other --exclude-standard 2> /dev/null) ]]; then
  85 + PR_GIT_UPDATE=1
  86 + FMT_BRANCH="(%{$turquoise%}%b%u%c%{$hotpink%}●${PR_RST})"
  87 + else
  88 + FMT_BRANCH="(%{$turquoise%}%b%u%c${PR_RST})"
  89 + fi
  90 + zstyle ':vcs_info:*:prompt:*' formats "${FMT_BRANCH}"
  91 +
  92 + vcs_info 'prompt'
  93 + PR_GIT_UPDATE=
  94 + fi
  95 +}
  96 +add-zsh-hook precmd steeef_precmd
  97 +
  98 +PROMPT=$'
  99 +%{$purple%}%n%{$reset_color%} at %{$orange%}%m%{$reset_color%} in %{$limegreen%}%~%{$reset_color%} $vcs_info_msg_0_
  100 +$(virtualenv_info)$ '
95 themes/trapd00r.zsh-theme
... ... @@ -0,0 +1,95 @@
  1 +# Name: trapd00r zsh theme
  2 +# Author: Magnus Woldrich <m@japh.se>
  3 +#
  4 +# This theme needs a terminal supporting 256 colors as well as unicode. It also
  5 +# needs the script that splits up the current path and makes it fancy as located
  6 +# here: https://github.com/trapd00r/utils/blob/master/zsh_path
  7 +#
  8 +# By default it spans over two lines like so:
  9 +#
  10 +# scp1@shiva:pts/9-> /home » scp1 (0)
  11 +# >
  12 +#
  13 +# that's user@host:pts/-> splitted path (return status)
  14 +#
  15 +# If the current directory is a git repository, we span 3 lines;
  16 +#
  17 +# git❨ master ❩ DIRTY
  18 +# scp1@shiva:pts/4-> /home » scp1 » dev » utils (0)
  19 +# >
  20 +
  21 +autoload -U add-zsh-hook
  22 +autoload -Uz vcs_info
  23 +
  24 +local c0=$( printf "\e[m")
  25 +local c1=$( printf "\e[38;5;245m")
  26 +local c2=$( printf "\e[38;5;250m")
  27 +local c3=$( printf "\e[38;5;242m")
  28 +local c4=$( printf "\e[38;5;197m")
  29 +local c5=$( printf "\e[38;5;225m")
  30 +local c6=$( printf "\e[38;5;240m")
  31 +local c7=$( printf "\e[38;5;242m")
  32 +local c8=$( printf "\e[38;5;244m")
  33 +local c9=$( printf "\e[38;5;162m")
  34 +local c10=$(printf "\e[1m")
  35 +local c11=$(printf "\e[38;5;208m\e[1m")
  36 +local c12=$(printf "\e[38;5;142m\e[1m")
  37 +local c13=$(printf "\e[38;5;196m\e[1m")
  38 +
  39 +
  40 +# We dont want to use the extended colorset in the TTY / VC.
  41 +if [ "$TERM" = "linux" ]; then
  42 + c1=$( printf "\e[34;1m")
  43 + c2=$( printf "\e[35m")
  44 + c3=$( printf "\e[31m")
  45 + c4=$( printf "\e[31;1m")
  46 + c5=$( printf "\e[32m")
  47 + c6=$( printf "\e[32;1m")
  48 + c7=$( printf "\e[33m")
  49 + c8=$( printf "\e[33;1m")
  50 + c9=$( printf "\e[34m")
  51 +
  52 + c11=$(printf "\e[35;1m")
  53 + c12=$(printf "\e[36m")
  54 + c13=$(printf "\e[31;1m")
  55 +fi
  56 +
  57 +zstyle ':vcs_info:*' actionformats \
  58 + '%{$c8%}(%f%s)%{$c7%}-%F{5}[%F{2}%b%F{3}|%F{1}%a%F{5}]%f '
  59 +
  60 +zstyle ':vcs_info:*' formats \
  61 + "%{$c8%}%s%%{$c7%}❨ %{$c9%}%{$c11%}%b%{$c7%} ❩%{$reset_color%}%f "
  62 +
  63 +zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r'
  64 +zstyle ':vcs_info:*' enable git
  65 +
  66 +add-zsh-hook precmd prompt_jnrowe_precmd
  67 +
  68 +prompt_jnrowe_precmd () {
  69 + vcs_info
  70 + if [ "${vcs_info_msg_0_}" = "" ]; then
  71 + dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$(zsh_path)%} %{$c0%}(%{$c5%}%?%{$c0%})"
  72 + PROMPT='%{$fg_bold[green]%}%p%{$reset_color%}${vcs_info_msg_0_}${dir_status} ${ret_status}%{$reset_color%}
  73 +> '
  74 +
  75 +# modified, to be commited
  76 + elif [[ $(git diff --cached --name-status 2>/dev/null ) != "" ]]; then
  77 + dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$(zsh_path)%} %{$c0%}(%{$c5%}%?%{$c0%})"
  78 + PROMPT='${vcs_info_msg_0_}%{$30%} %{$bg_bold[red]%}%{$fg_bold[cyan]%}C%{$fg_bold[black]%}OMMIT%{$reset_color%}
  79 +%{$fg_bold[green]%}%p%{$reset_color%}${dir_status}%{$reset_color%}
  80 +> '
  81 +
  82 + elif [[ $(git diff --name-status 2>/dev/null ) != "" ]]; then
  83 + dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$(zsh_path)%} %{$c0%}(%{$c5%}%?%{$c0%})"
  84 + PROMPT='${vcs_info_msg_0_}%{$bg_bold[red]%}%{$fg_bold[blue]%}D%{$fg_bold[black]%}IRTY%{$reset_color%}
  85 +%{$fg_bold[green]%}%p%{$reset_color%}${dir_status}%{$reset_color%}
  86 +%{$c13%}>%{$c0%} '
  87 + else
  88 + dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$(zsh_path)%} %{$c0%}(%{$c5%}%?%{$c0%})"
  89 + PROMPT='${vcs_info_msg_0_}
  90 +%{$fg_bold[green]%}%p%{$reset_color%}${dir_status} ${vcs_info_msg_0_}%{$reset_color%}
  91 +> '
  92 +fi
  93 +}
  94 +
  95 +# vim: set ft=zsh sw=2 et tw=0:

0 comments on commit 8411a39

Please sign in to comment.
Something went wrong with that request. Please try again.