Browse code

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

NanoTech authored on 19/10/2010 at 21:39:27
Showing 39 changed files
... ...
@@ -5,7 +5,7 @@ function title {
5 5
     print -nR $'\033k'$1$'\033'\\\
6 6
 
7 7
     print -nR $'\033]0;'$2$'\a'
8
-  elif [[ $TERM =~ "^xterm" || $TERM == "rxvt" ]]; then
8
+  elif [[ ($TERM =~ "^xterm") ]] || [[ ($TERM == "rxvt") ]]; then
9 9
     # Use this one instead for XTerms:
10 10
     print -nR $'\033]0;'$*$'\a'
11 11
   fi
... ...
@@ -37,4 +37,3 @@ function take() {
37 37
   mkdir -p $1
38 38
   cd $1
39 39
 }
40
-
... ...
@@ -11,3 +11,30 @@ parse_git_dirty () {
11 11
     echo "$ZSH_THEME_GIT_PROMPT_CLEAN"
12 12
   fi
13 13
 }
14
+
15
+# get the status of the working tree
16
+git_prompt_status() {
17
+  INDEX=$(git status --porcelain 2> /dev/null)
18
+  STATUS=""
19
+  if $(echo "$INDEX" | grep '^?? ' &> /dev/null); then
20
+    STATUS="$ZSH_THEME_GIT_PROMPT_UNTRACKED$STATUS"
21
+  fi
22
+  if $(echo "$INDEX" | grep '^A  ' &> /dev/null); then
23
+    STATUS="$ZSH_THEME_GIT_PROMPT_ADDED$STATUS"
24
+  elif $(echo "$INDEX" | grep '^M  ' &> /dev/null); then
25
+    STATUS="$ZSH_THEME_GIT_PROMPT_ADDED$STATUS"
26
+  fi
27
+  if $(echo "$INDEX" | grep '^ M ' &> /dev/null); then
28
+    STATUS="$ZSH_THEME_GIT_PROMPT_MODIFIED$STATUS"
29
+  fi
30
+  if $(echo "$INDEX" | grep '^R  ' &> /dev/null); then
31
+    STATUS="$ZSH_THEME_GIT_PROMPT_RENAMED$STATUS"
32
+  fi
33
+  if $(echo "$INDEX" | grep '^ D ' &> /dev/null); then
34
+    STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS"
35
+  fi
36
+  if $(echo "$INDEX" | grep '^UU ' &> /dev/null); then
37
+    STATUS="$ZSH_THEME_GIT_PROMPT_UNMERGED$STATUS"
38
+  fi
39
+  echo $STATUS
40
+}
... ...
@@ -12,7 +12,7 @@ for config_file ($ZSH/custom/*.zsh) source $config_file
12 12
 
13 13
 # Load all of the plugins that were defined in ~/.zshrc
14 14
 plugin=${plugin:=()}
15
-for plugin ($plugins) source $ZSH/plugins/$plugin.plugin.zsh
15
+for plugin ($plugins) source $ZSH/plugins/$plugin/$plugin.plugin.zsh
16 16
 
17 17
 # Check for updates on initial load...
18 18
 if [ "$DISABLE_AUTO_UPDATE" = "true" ]
19 19
deleted file mode 100644
... ...
@@ -1,67 +0,0 @@
1
-#compdef brew
2
-
3
-# imported from the latest homebrew contributions
4
-
5
-_brew_all_formulae() {
6
-  formulae=(`brew search`)
7
-}
8
-
9
-_brew_installed_formulae() {
10
-  installed_formulae=(`brew list`)
11
-}
12
-
13
-local -a _1st_arguments
14
-_1st_arguments=(
15
-  'cat:display formula file for a formula'
16
-  'cleanup:uninstall unused and old versions of packages'
17
-  'create:create a new formula'
18
-  'deps:list dependencies and dependants of a formula'
19
-  'doctor:audits your installation for common issues'
20
-  'edit:edit a formula'
21
-  'home:visit the homepage of a formula or the brew project'
22
-  'info:information about a formula'
23
-  'install:install a formula'
24
-  'link:link a formula'
25
-  'list:list files in a formula or not-installed formulae'
26
-  'log:git commit log for a formula'
27
-  'outdated:list formulas for which a newer version is available'
28
-  'prune:remove dead links'
29
-  'remove:remove a formula'
30
-  'search:search for a formula (/regex/ or string)'
31
-  'unlink:unlink a formula'
32
-  'update:freshen up links'
33
-  'uses:show formulas which depend on a formula'
34
-)
35
-
36
-local expl
37
-local -a formula installed_formulae
38
-
39
-_arguments \
40
-  '(-v --verbose)'{-v,--verbose}'[verbose]' \
41
-  '(--version)--version[version information]' \
42
-  '(--prefix)--prefix[where brew lives on this system]' \
43
-  '(--cache)--cache[brew cache]' \
44
-  '*:: :->subcmds' && return 0
45
-
46
-if (( CURRENT == 1 )); then
47
-  _describe -t commands "brew subcommand" _1st_arguments
48
-  return
49
-fi
50
-
51
-case "$words[1]" in
52
-  list)
53
-    _arguments \
54
-      '(--unbrewed)--unbrewed[files in brew --prefix not controlled by brew]' \
55
-      '1: :->forms' &&  return 0
56
-
57
-      if [[ "$state" == forms ]]; then
58
-        _brew_installed_formulae
59
-        _requested installed_formulae expl 'installed formulae' compadd -a installed_formulae
60
-      fi ;;
61
-  install|home|log|info|uses|cat|deps)
62
-    _brew_all_formulae
63
-    _wanted formulae expl 'all formulae' compadd -a formulae ;;
64
-  remove|edit|xo)
65
-    _brew_installed_formulae
66
-    _wanted installed_formulae expl 'installed formulae' compadd -a installed_formulae ;;
67
-esac
68 1
new file mode 100644
... ...
@@ -0,0 +1,69 @@
0
+#compdef brew
1
+#autoload
2
+
3
+# imported from the latest homebrew contributions
4
+
5
+_brew_all_formulae() {
6
+  formulae=(`brew search`)
7
+}
8
+
9
+_brew_installed_formulae() {
10
+  installed_formulae=(`brew list`)
11
+}
12
+
13
+local -a _1st_arguments
14
+_1st_arguments=(
15
+  'cat:display formula file for a formula'
16
+  'cleanup:uninstall unused and old versions of packages'
17
+  'create:create a new formula'
18
+  'deps:list dependencies and dependants of a formula'
19
+  'doctor:audits your installation for common issues'
20
+  'edit:edit a formula'
21
+  'home:visit the homepage of a formula or the brew project'
22
+  'info:information about a formula'
23
+  'install:install a formula'
24
+  'link:link a formula'
25
+  'list:list files in a formula or not-installed formulae'
26
+  'log:git commit log for a formula'
27
+  'outdated:list formulas for which a newer version is available'
28
+  'prune:remove dead links'
29
+  'remove:remove a formula'
30
+  'search:search for a formula (/regex/ or string)'
31
+  'unlink:unlink a formula'
32
+  'update:freshen up links'
33
+  'uses:show formulas which depend on a formula'
34
+)
35
+
36
+local expl
37
+local -a formula installed_formulae
38
+
39
+_arguments \
40
+  '(-v --verbose)'{-v,--verbose}'[verbose]' \
41
+  '(--version)--version[version information]' \
42
+  '(--prefix)--prefix[where brew lives on this system]' \
43
+  '(--cache)--cache[brew cache]' \
44
+  '*:: :->subcmds' && return 0
45
+
46
+if (( CURRENT == 1 )); then
47
+  _describe -t commands "brew subcommand" _1st_arguments
48
+  return
49
+fi
50
+
51
+case "$words[1]" in
52
+  list)
53
+    _arguments \
54
+      '(--unbrewed)--unbrewed[files in brew --prefix not controlled by brew]' \
55
+      '1: :->forms' &&  return 0
56
+
57
+      if [[ "$state" == forms ]]; then
58
+        _brew_installed_formulae
59
+        _requested installed_formulae expl 'installed formulae' compadd -a installed_formulae
60
+      fi ;;
61
+  install|home|log|info|uses|cat|deps)
62
+    _brew_all_formulae
63
+    _wanted formulae expl 'all formulae' compadd -a formulae ;;
64
+  remove|edit|xo)
65
+    _brew_installed_formulae
66
+    _wanted installed_formulae expl 'installed formulae' compadd -a installed_formulae ;;
67
+esac
68
+
0 69
new file mode 100644
... ...
@@ -0,0 +1,4 @@
0
+# add brew completion function to path
1
+fpath=($ZSH/plugins/brew $fpath)
2
+autoload -U compinit
3
+compinit -i
0 4
new file mode 100644
... ...
@@ -0,0 +1,21 @@
0
+function _cap_does_task_list_need_generating () {
1
+  if [ ! -f .cap_tasks~ ]; then return 0;
2
+  else
3
+    accurate=$(stat -f%m .cap_tasks~)
4
+    changed=$(stat -f%m config/deploy.rb)
5
+    return $(expr $accurate '>=' $changed)
6
+  fi
7
+}
8
+
9
+function _cap () {
10
+  if [ -f config/deploy.rb ]; then
11
+    if _cap_does_task_list_need_generating; then
12
+      echo "\nGenerating .cap_tasks~..." > /dev/stderr
13
+      cap show_tasks -q | cut -d " " -f 1 | sed -e '/^ *$/D' -e '1,2D'
14
+> .cap_tasks~
15
+    fi
16
+    compadd `cat .cap_tasks~`
17
+  fi
18
+}
19
+
20
+compctl -K _cap cap
0 21
\ No newline at end of file
1 22
deleted file mode 100644
... ...
@@ -1,39 +0,0 @@
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 ~/.oh-my-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 <STDIN>) {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 1
new file mode 100644
... ...
@@ -0,0 +1,39 @@
0
+#!/bin/zsh
1
+# 
2
+# Make the dirstack more persistant
3
+# 
4
+# Add dirpersist to $plugins in ~/.zshrc to load
5
+# 
6
+
7
+# $zdirstore is the file used to persist the stack
8
+zdirstore=~/.zdirstore
9
+
10
+dirpersistinstall () {
11
+    if grep 'dirpersiststore' ~/.zlogout > /dev/null; then
12
+    else
13
+        if read -q \?"Would you like to set up your .zlogout file for use with dirspersist? (y/n) "; then
14
+            echo "# Store dirs stack\n# See ~/.oh-my-zsh/plugins/dirspersist.plugin.zsh\ndirpersiststore" >> ~/.zlogout
15
+        else
16
+            echo "If you don't want this message to appear, remove dirspersist from \$plugins"
17
+        fi
18
+    fi
19
+}
20
+
21
+dirpersiststore () {
22
+    dirs -p | perl -e 'foreach (reverse <STDIN>) {chomp;s/([& ])/\\$1/g ;print "if [ -d $_ ]; then pushd -q $_; fi\n"}' > $zdirstore
23
+}
24
+
25
+dirpersistrestore () {
26
+    if [ -f $zdirstore ]; then
27
+        source $zdirstore
28
+    fi
29
+}
30
+
31
+DIRSTACKSIZE=10
32
+setopt autopushd pushdminus pushdsilent pushdtohome pushdignoredups
33
+
34
+dirpersistinstall
35
+dirpersistrestore
36
+
37
+# Make popd changes permanent without having to wait for logout
38
+alias popd="popd;dirpersiststore"
0 39
new file mode 100644
... ...
@@ -0,0 +1,64 @@
0
+#compdef gem
1
+#autoload
2
+
3
+# gem zsh completion, based on homebrew completion
4
+
5
+_gem_installed() {
6
+  installed_gems=(`gem list --local --no-versions`)
7
+}
8
+
9
+local -a _1st_arguments
10
+_1st_arguments=(
11
+  'cert:Manage RubyGems certificates and signing settings'
12
+  'check:Check installed gems'
13
+  'cleanup:Clean up old versions of installed gems in the local repository'
14
+  'contents:Display the contents of the installed gems'
15
+  'dependency:Show the dependencies of an installed gem'
16
+  'environment:Display information about the RubyGems environment'
17
+  'fetch:Download a gem and place it in the current directory'
18
+  'generate_index:Generates the index files for a gem server directory'
19
+  'help:Provide help on the `gem` command'
20
+  'install:Install a gem into the local repository'
21
+  'list:Display gems whose name starts with STRING'
22
+  'lock:Generate a lockdown list of gems'
23
+  'mirror:Mirror a gem repository'
24
+  'outdated:Display all gems that need updates'
25
+  'owner:Manage gem owners on RubyGems.org.'
26
+  'pristine:Restores installed gems to pristine condition from files located in the gem cache'
27
+  'push:Push a gem up to RubyGems.org'
28
+  'query:Query gem information in local or remote repositories'
29
+  'rdoc:Generates RDoc for pre-installed gems'
30
+  'search:Display all gems whose name contains STRING'
31
+  'server:Documentation and gem repository HTTP server'
32
+  'sources:Manage the sources and cache file RubyGems uses to search for gems'
33
+  'specification:Display gem specification (in yaml)'
34
+  'stale:List gems along with access times'
35
+  'uninstall:Uninstall gems from the local repository'
36
+  'unpack:Unpack an installed gem to the current directory'
37
+  'update:Update the named gems (or all installed gems) in the local repository'
38
+  'which:Find the location of a library file you can require'
39
+)
40
+
41
+local expl
42
+local -a gems installed_gems
43
+
44
+_arguments \
45
+  '(-v --version)'{-v,--version}'[show version]' \
46
+  '(-h --help)'{-h,--help}'[show help]' \
47
+  '*:: :->subcmds' && return 0
48
+
49
+if (( CURRENT == 1 )); then
50
+  _describe -t commands "gem subcommand" _1st_arguments
51
+  return
52
+fi
53
+
54
+case "$words[1]" in
55
+  list)
56
+      if [[ "$state" == forms ]]; then
57
+        _gem_installed
58
+        _requested installed_gems expl 'installed gems' compadd -a installed_gems
59
+      fi ;;
60
+  uninstall|update)
61
+    _gem_installed
62
+    _wanted installed_gems expl 'installed gems' compadd -a installed_gems ;;
63
+esac
0 64
new file mode 100644
... ...
@@ -0,0 +1,4 @@
0
+# add brew completion function to path
1
+fpath=($ZSH/plugins/gem $fpath)
2
+autoload -U compinit
3
+compinit -i
0 4
deleted file mode 100644
... ...
@@ -1,32 +0,0 @@
1
-# Aliases
2
-alias g='git'
3
-alias gst='git status'
4
-alias gl='git pull'
5
-alias gup='git fetch && git rebase'
6
-alias gp='git push'
7
-alias gd='git diff | mate'
8
-alias gdv='git diff -w "$@" | vim -R -'
9
-alias gc='git commit -v'
10
-alias gca='git commit -v -a'
11
-alias gb='git branch'
12
-alias gba='git branch -a'
13
-alias gcount='git shortlog -sn'
14
-alias gcp='git cherry-pick'
15
-
16
-
17
-# Git and svn mix
18
-alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk'
19
-
20
-#
21
-# Will return the current branch name
22
-# Usage example: git pull origin $(current_branch)
23
-#
24
-function current_branch() {
25
-  ref=$(git symbolic-ref HEAD 2> /dev/null) || return
26
-  echo ${ref#refs/heads/}
27
-}
28
-
29
-# these aliases take advangate of the previous function
30
-alias ggpull='git pull origin $(current_branch)'
31
-alias ggpush='git push origin $(current_branch)'
32
-alias ggpnp='git pull origin $(current_branch) && git push origin $(current_branch)'
33 1
\ No newline at end of file
34 2
new file mode 100644
... ...
@@ -0,0 +1,32 @@
0
+# Aliases
1
+alias g='git'
2
+alias gst='git status'
3
+alias gl='git pull'
4
+alias gup='git fetch && git rebase'
5
+alias gp='git push'
6
+alias gd='git diff | mate'
7
+alias gdv='git diff -w "$@" | vim -R -'
8
+alias gc='git commit -v'
9
+alias gca='git commit -v -a'
10
+alias gb='git branch'
11
+alias gba='git branch -a'
12
+alias gcount='git shortlog -sn'
13
+alias gcp='git cherry-pick'
14
+alias glg='git log --stat --max-count=5'
15
+
16
+# Git and svn mix
17
+alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk'
18
+
19
+#
20
+# Will return the current branch name
21
+# Usage example: git pull origin $(current_branch)
22
+#
23
+function current_branch() {
24
+  ref=$(git symbolic-ref HEAD 2> /dev/null) || return
25
+  echo ${ref#refs/heads/}
26
+}
27
+
28
+# these aliases take advangate of the previous function
29
+alias ggpull='git pull origin $(current_branch)'
30
+alias ggpush='git push origin $(current_branch)'
31
+alias ggpnp='git pull origin $(current_branch) && git push origin $(current_branch)'
0 32
\ No newline at end of file
1 33
new file mode 100644
... ...
@@ -0,0 +1,40 @@
0
+#compdef github
1
+#autoload
2
+
3
+# in order to make this work, you will need to have the github gem installed
4
+# http://github.com/defunkt/github-gem
5
+
6
+# github zsh completion, based on homebrew completion
7
+
8
+local -a _1st_arguments
9
+_1st_arguments=(
10
+  'browse:Open this repo in a web browser'
11
+  'clone:Clone a repo'
12
+  'config:Automatically set configuration info, or pass args to specify'
13
+  'create-from-local:Create a new GitHub repository from the current local repository'
14
+  'create:Create a new empty GitHub repository'
15
+  'fetch:Fetch from a remote to a local branch'
16
+  'fetch_all:Fetch all refs from a user'
17
+  'fork:Forks a GitHub repository'
18
+  'home:Open this repos master branch in a web browser'
19
+  'ignore:Ignore a SHA from github network commits'
20
+  'info:Info about this project'
21
+  'issues:Project issues tools'
22
+  'network:Project network tools - sub-commands : web [user], list, fetch, commits'
23
+  'open:Open the given user/project in a web browser'
24
+  'pull-request:Generate the text for a pull request'
25
+  'pull:Pull from a remote'
26
+  'search:Search GitHub for the given repository name'
27
+  'track:Track another users repository'
28
+)
29
+
30
+local expl
31
+local -a pkgs installed_pkgs
32
+
33
+_arguments \
34
+  '*:: :->subcmds' && return 0
35
+
36
+if (( CURRENT == 1 )); then
37
+  _describe -t commands "github subcommand" _1st_arguments
38
+  return
39
+fi
0 40
new file mode 100644
... ...
@@ -0,0 +1,4 @@
0
+# add github completion function to path
1
+fpath=($ZSH/plugins/github $fpath)
2
+autoload -U compinit
3
+compinit -i
0 4
deleted file mode 100644
... ...
@@ -1,16 +0,0 @@
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 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 1
\ No newline at end of file
18 2
new file mode 100644
... ...
@@ -0,0 +1,16 @@
0
+# To use: add a .lighthouse file into your directory with the URL to the
1
+# individual project. For example:
2
+# https://rails.lighthouseapp.com/projects/8994
3
+# Example usage: http://screencast.com/t/ZDgwNDUwNT
4
+open_lighthouse_ticket () {
5
+  if [ ! -f .lighthouse-url ]; then
6
+    echo "There is no .lighthouse file in the current directory..."
7
+    return 0;
8
+  else
9
+    lighthouse_url=$(cat .lighthouse-url);
10
+    echo "Opening ticket #$1";
11
+    `open $lighthouse_url/tickets/$1`;
12
+  fi
13
+}
14
+
15
+alias lho='open_lighthouse_ticket'
0 16
\ No newline at end of file
1 17
deleted file mode 100644
... ...
@@ -1,7 +0,0 @@
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 1
new file mode 100644
... ...
@@ -0,0 +1,7 @@
0
+#Aliases
1
+alias pc="sudo port clean --all installed"
2
+alias pi="sudo port install $1"
3
+alias psu="sudo port selfupdate"
4
+alias puni="sudo port uninstall inactive"
5
+alias puo="sudo port upgrade outdated"
6
+alias pup="psu && puo"
0 7
deleted file mode 100644
... ...
@@ -1,6 +0,0 @@
1
-# commands to control local mysql-server installation
2
-# paths are for osx installtion via macports
3
-
4
-alias mysqlstart='sudo /opt/local/bin/mysqld_safe5'
5
-alias mysqlstop='/opt/local/bin/mysqladmin5 -u root -p shutdown'
6
-alias mysqlstatus='mysqladmin5 -u root -p ping'
7 1
\ No newline at end of file
8 2
new file mode 100644
... ...
@@ -0,0 +1,6 @@
0
+# commands to control local mysql-server installation
1
+# paths are for osx installtion via macports
2
+
3
+alias mysqlstart='sudo /opt/local/bin/mysqld_safe5'
4
+alias mysqlstop='/opt/local/bin/mysqladmin5 -u root -p shutdown'
5
+alias mysqlstatus='mysqladmin5 -u root -p ping'
0 6
\ No newline at end of file
1 7
deleted file mode 100644
... ...
@@ -1,11 +0,0 @@
1
-function tab() {
2
-  osascript 2>/dev/null <<EOF
3
-    tell application "System Events"
4
-      tell process "Terminal" to keystroke "t" using command down
5
-    end
6
-    tell application "Terminal"
7
-      activate
8
-      do script with command "cd \"$PWD\"; $*" in window 1
9
-    end tell
10
-EOF
11
-}
12 1
\ No newline at end of file
13 2
new file mode 100644
... ...
@@ -0,0 +1,11 @@
0
+function tab() {
1
+  osascript 2>/dev/null <<EOF
2
+    tell application "System Events"
3
+      tell process "Terminal" to keystroke "t" using command down
4
+    end
5
+    tell application "Terminal"
6
+      activate
7
+      do script with command "cd \"$PWD\"; $*" in window 1
8
+    end tell
9
+EOF
10
+}
0 11
\ No newline at end of file
1 12
new file mode 100644
... ...
@@ -0,0 +1,46 @@
0
+#compdef pip
1
+#autoload
2
+
3
+# pip zsh completion, based on homebrew completion
4
+
5
+_pip_installed() {
6
+  installed_pkgs=(`pip freeze`)
7
+}
8
+
9
+local -a _1st_arguments
10
+_1st_arguments=(
11
+  'bundle:Create pybundles (archives containing multiple packages)'
12
+  'freeze:Output all currently installed packages (exact versions) to stdout'
13
+  'help:Show available commands'
14
+  'install:Install packages'
15
+  'search:Search PyPI'
16
+  'uninstall:Uninstall packages'
17
+  'unzip:Unzip individual packages'
18
+  'zip:Zip individual packages'
19
+)
20
+
21
+local expl
22
+local -a pkgs installed_pkgs
23
+
24
+_arguments \
25
+  '(--version)--version[Show version number of program and exit]' \
26
+  '(-v --verbose)'{-v,--verbose}'[Give more output]' \
27
+  '(-q --quiet)'{-q,--quiet}'[Give less output]' \
28
+  '(-h --help)'{-h,--help}'[Show help]' \
29
+  '*:: :->subcmds' && return 0
30
+
31
+if (( CURRENT == 1 )); then
32
+  _describe -t commands "pip subcommand" _1st_arguments
33
+  return
34
+fi
35
+
36
+case "$words[1]" in
37
+  list)
38
+      if [[ "$state" == forms ]]; then
39
+        _pip_installed
40
+        _requested installed_pkgs expl 'installed packages' compadd -a installed_pkgs
41
+      fi ;;
42
+  uninstall)
43
+    _pip_installed
44
+    _wanted installed_pkgs expl 'installed packages' compadd -a installed_pkgs ;;
45
+esac
0 46
new file mode 100644
... ...
@@ -0,0 +1,4 @@
0
+# add brew completion function to path
1
+fpath=($ZSH/plugins/pip $fpath)
2
+autoload -U compinit
3
+compinit -i
0 4
deleted file mode 100644
... ...
@@ -1,36 +0,0 @@
1
-
2
-alias ss='thin --stats "/thin/stats" start'
3
-alias sg='ruby script/generate'
4
-alias sd='ruby script/destroy'
5
-alias sp='ruby script/plugin'
6
-alias ssp='ruby script/spec'
7
-alias rdbm='rake db:migrate'
8
-alias sc='ruby script/console'
9
-alias sd='ruby script/server --debugger'
10
-alias devlog='tail -f log/development.log'
11
-
12
-function _cap_does_task_list_need_generating () {
13
-  if [ ! -f .cap_tasks~ ]; then return 0;
14
-  else
15
-    accurate=$(stat -f%m .cap_tasks~)
16
-    changed=$(stat -f%m config/deploy.rb)
17
-    return $(expr $accurate '>=' $changed)
18
-  fi
19
-}
20
-
21
-function _cap () {
22
-  if [ -f config/deploy.rb ]; then
23
-    if _cap_does_task_list_need_generating; then
24
-      echo "\nGenerating .cap_tasks~..." > /dev/stderr
25
-      cap show_tasks -q | cut -d " " -f 1 | sed -e '/^ *$/D' -e '1,2D'
26
-> .cap_tasks~
27
-    fi
28
-    compadd `cat .cap_tasks~`
29
-  fi
30
-}
31
-
32
-compctl -K _cap cap
33
-
34
-function remote_console() {
35
-  /usr/bin/env ssh $1 "( cd $2 && ruby script/console production )"
36
-}
37 1
new file mode 100644
... ...
@@ -0,0 +1,13 @@
0
+alias ss='thin --stats "/thin/stats" start'
1
+alias sg='ruby script/generate'
2
+alias sd='ruby script/destroy'
3
+alias sp='ruby script/plugin'
4
+alias ssp='ruby script/spec'
5
+alias rdbm='rake db:migrate'
6
+alias sc='ruby script/console'
7
+alias sd='ruby script/server --debugger'
8
+alias devlog='tail -f log/development.log'
9
+
10
+function remote_console() {
11
+  /usr/bin/env ssh $1 "( cd $2 && ruby script/console production )"
12
+}
0 13
deleted file mode 100644
... ...
@@ -1,4 +0,0 @@
1
-alias sgem='sudo gem'
2
-
3
-# Find ruby file
4
-alias rfind='find . -name *.rb | xargs grep -n'
5 1
\ No newline at end of file
6 2
new file mode 100644
... ...
@@ -0,0 +1,4 @@
0
+alias sgem='sudo gem'
1
+
2
+# Find ruby file
3
+alias rfind='find . -name *.rb | xargs grep -n'
0 4
\ No newline at end of file
1 5
deleted file mode 100644
... ...
@@ -1,23 +0,0 @@
1
-# Based on code from Joseph M. Reagle
2
-# http://www.cygwin.com/ml/cygwin/2001-06/msg00537.html
3
-
4
-local SSH_ENV=$HOME/.ssh/environment
5
-
6
-function start_agent {
7
-  /usr/bin/env ssh-agent | sed 's/^echo/#echo/' > ${SSH_ENV}
8
-  chmod 600 ${SSH_ENV}
9
-  . ${SSH_ENV} > /dev/null
10
-  /usr/bin/ssh-add;
11
-}
12
-
13
-# Source SSH settings, if applicable
14
-
15
-if [ -f "${SSH_ENV}" ]; then
16
-  . ${SSH_ENV} > /dev/null
17
-  ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || {
18
-    start_agent;
19
-  }
20
-else
21
-  start_agent;
22
-fi
23
-
24 1
new file mode 100644
... ...
@@ -0,0 +1,23 @@
0
+# Based on code from Joseph M. Reagle
1
+# http://www.cygwin.com/ml/cygwin/2001-06/msg00537.html
2
+
3
+local SSH_ENV=$HOME/.ssh/environment
4
+
5
+function start_agent {
6
+  /usr/bin/env ssh-agent | sed 's/^echo/#echo/' > ${SSH_ENV}
7
+  chmod 600 ${SSH_ENV}
8
+  . ${SSH_ENV} > /dev/null
9
+  /usr/bin/ssh-add;
10
+}
11
+
12
+# Source SSH settings, if applicable
13
+
14
+if [ -f "${SSH_ENV}" ]; then
15
+  . ${SSH_ENV} > /dev/null
16
+  ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || {
17
+    start_agent;
18
+  }
19
+else
20
+  start_agent;
21
+fi
22
+
0 23
deleted file mode 100644
... ...
@@ -1,14 +0,0 @@
1
-
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
9
-alias mr='mate CHANGELOG app config db lib public script spec test'
10
-
11
-function tm() {
12
-  cd $1
13
-  mate $1
14
-}
15 1
new file mode 100644
... ...
@@ -0,0 +1,14 @@
0
+
1
+# TextMate
2
+alias et='mate . &'
3
+alias ett='mate app config lib db public spec test Rakefile Capfile Todo &'
4
+alias etp='mate app config lib db public spec test vendor/plugins vendor/gems Rakefile Capfile Todo &'
5
+alias etts='mate app config lib db public script spec test vendor/plugins vendor/gems Rakefile Capfile Todo &'
6
+
7
+# Editor Ruby file in TextMate
8
+alias mr='mate CHANGELOG app config db lib public script spec test'
9
+
10
+function tm() {
11
+  cd $1
12
+  mate $1
13
+}
0 14
deleted file mode 100644
... ...
@@ -1,22 +0,0 @@
1
-function zle-line-init zle-keymap-select {
2
-  zle reset-prompt
3
-}
4
-
5
-zle -N zle-line-init
6
-zle -N zle-keymap-select
7
-
8
-bindkey -v
9
-
10
-# if mode indicator wasn't setup by theme, define default
11
-if [[ "$MODE_INDICATOR" == "" ]]; then
12
-  MODE_INDICATOR="%{$fg_bold[red]%}<%{$fg[red]%}<<%{$reset_color%}"
13
-fi
14
-
15
-function vi_mode_prompt_info() {
16
-  echo "${${KEYMAP/vicmd/$MODE_INDICATOR}/(main|viins)/}"
17
-}
18
-
19
-# define right prompt, if it wasn't defined by a theme
20
-if [[ "$RPS1" == "" && "$RPROMPT" == "" ]]; then
21
-  RPS1='$(vi_mode_prompt_info)'
22
-fi
23 1
new file mode 100644
... ...
@@ -0,0 +1,22 @@
0
+function zle-line-init zle-keymap-select {
1
+  zle reset-prompt
2
+}
3
+
4
+zle -N zle-line-init
5
+zle -N zle-keymap-select
6
+
7
+bindkey -v
8
+
9
+# if mode indicator wasn't setup by theme, define default
10
+if [[ "$MODE_INDICATOR" == "" ]]; then
11
+  MODE_INDICATOR="%{$fg_bold[red]%}<%{$fg[red]%}<<%{$reset_color%}"
12
+fi
13
+
14
+function vi_mode_prompt_info() {
15
+  echo "${${KEYMAP/vicmd/$MODE_INDICATOR}/(main|viins)/}"
16
+}
17
+
18
+# define right prompt, if it wasn't defined by a theme
19
+if [[ "$RPS1" == "" && "$RPROMPT" == "" ]]; then
20
+  RPS1='$(vi_mode_prompt_info)'
21
+fi
0 22
new file mode 100644
... ...
@@ -0,0 +1,6 @@
0
+PROMPT='%{$fg_bold[cyan]%}☁ %{$fg_bold[green]%}%p %{$fg[green]%}%c %{$fg_bold[cyan]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}'
1
+
2
+ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}[%{$fg[cyan]%}"
3
+ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
4
+ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%}] %{$fg[yellow]%}⚡%{$reset_color%}"
5
+ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%}]"
0 6
\ No newline at end of file
1 7
new file mode 100644
... ...
@@ -0,0 +1,15 @@
0
+PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}'
1
+
2
+ZSH_THEME_GIT_PROMPT_PREFIX="("
3
+ZSH_THEME_GIT_PROMPT_SUFFIX=")"
4
+ZSH_THEME_GIT_PROMPT_DIRTY=""
5
+ZSH_THEME_GIT_PROMPT_CLEAN=""
6
+
7
+RPROMPT='$(git_prompt_status)%{$reset_color%}'
8
+
9
+ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[cyan]%} ✈"
10
+ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[yellow]%} ✭"
11
+ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%} ✗"
12
+ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[blue]%} ➦"
13
+ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[magenta]%} ✂"
14
+ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[grey]%} ✱"
0 15
new file mode 100644
... ...
@@ -0,0 +1,10 @@
0
+# ZSH Theme - Preview: http://cl.ly/f701d00760f8059e06dc
1
+# Thanks to gallifrey, upon whose theme this is based
2
+
3
+local return_code="%(?..%{$fg_bold[red]%}%? ↵%{$reset_color%})"
4
+
5
+PROMPT='%{$fg_bold[green]%}%n@%m%{$reset_color%} %{$fg_bold[blue]%}%2~%{$reset_color%} $(git_prompt_info)%{$reset_color%}%B»%b '
6
+RPS1="${return_code}"
7
+
8
+ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}("
9
+ZSH_THEME_GIT_PROMPT_SUFFIX=") %{$reset_color%}"
0 10
new file mode 100644
... ...
@@ -0,0 +1,14 @@
0
+if [ "$(whoami)" = "root" ]; then NCOLOR="red"; else NCOLOR="green"; fi
1
+
2
+PROMPT='%{$fg[$NCOLOR]%}%B%n%b%{$reset_color%}:%{$fg[blue]%}%B%c/%b%{$reset_color%} $(git_prompt_info)%(!.#.$) '
3
+RPROMPT='[%*]'
4
+
5
+# git theming
6
+ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}(%{$fg_no_bold[red]%}%B"
7
+ZSH_THEME_GIT_PROMPT_SUFFIX="%b%{$fg_bold[blue]%})%{$reset_color%} "
8
+ZSH_THEME_GIT_PROMPT_CLEAN=""
9
+ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[red]%}"
10
+
11
+# LS colors, made with http://geoff.greer.fm/lscolors/
12
+export LSCOLORS="Gxfxcxdxbxegedabagacad"
13
+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:'