Browse code

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

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