Browse code

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

Roman Kamyk authored on 12/05/2011 at 11:40:07
Showing 46 changed files
... ...
@@ -2,4 +2,5 @@ locals.zsh
2 2
 log/.zsh_history
3 3
 projects.zsh
4 4
 custom/*
5
-!custom/example.zsh
6 5
\ No newline at end of file
6
+!custom/example.zsh
7
+cache
... ...
@@ -8,7 +8,7 @@ h2. Setup
8 8
 
9 9
 h3. The automatic installer... (do you trust me?)
10 10
 
11
-@wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh@
11
+@wget --no-check-certificate https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh@
12 12
 
13 13
 h3. The manual way
14 14
 
... ...
@@ -54,16 +54,18 @@ h3. Uninstalling
54 54
 
55 55
 If you want to uninstall it, just run @uninstall_oh_my_zsh@ from the command line and it'll remove itself and revert you to bash (or your previous zsh config).
56 56
 
57
-h2. Thanks
58
-
59
-* Rick Olson (technoweenie) might remember some of the configuration, which I took from a pastie a few years ago.
60
-* Marcel (noradio) provided Rick the original zsh configuration.
61
-* Nicholas (ulysses) for the "rake autocompletion code":http://weblog.rubyonrails.org/2006/3/9/fast-rake-task-completion-for-zsh.
62
-
63 57
 h2. Help out!
64 58
 
65 59
 I'm far from being a zsh-expert and suspect there are many ways to improve. If you have ideas on how to make the configuration easier to maintain (and faster), don't hesitate to fork and send pull requests!
66 60
 
67 61
 h3. Send us your theme!
68 62
 
69
-I'm hoping to collect a bunch of themes for our command prompts. You can see existing ones in the @themes/@ directory.
70 63
\ No newline at end of file
64
+I'm hoping to collect a bunch of themes for our command prompts. You can see existing ones in the @themes/@ directory.
65
+
66
+h2. Contributors
67
+
68
+This project wouldn't exist without all of our awesome users and contributors.
69
+
70
+* "View our growing list of contributors":https://github.com/robbyrussell/oh-my-zsh/contributors
71
+
72
+Thank you so much!
71 73
\ No newline at end of file
... ...
@@ -8,9 +8,6 @@ setopt always_to_end
8 8
 
9 9
 WORDCHARS=''
10 10
 
11
-autoload -U compinit
12
-compinit -i
13
-
14 11
 zmodload -i zsh/complist
15 12
 
16 13
 ## case-insensitive (all),partial-word and then substring completion
... ...
@@ -4,7 +4,8 @@ function git_prompt_info() {
4 4
   echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_SUFFIX"
5 5
 }
6 6
 
7
-parse_git_dirty () {
7
+# Checks if working tree is dirty
8
+parse_git_dirty() {
8 9
   if [[ -n $(git status -s 2> /dev/null) ]]; then
9 10
     echo "$ZSH_THEME_GIT_PROMPT_DIRTY"
10 11
   else
... ...
@@ -12,7 +13,24 @@ parse_git_dirty () {
12 12
   fi
13 13
 }
14 14
 
15
-# get the status of the working tree
15
+# Checks if there are commits ahead from remote
16
+function git_prompt_ahead() {
17
+  if $(echo "$(git log origin/master..HEAD 2> /dev/null)" | grep '^commit' &> /dev/null); then
18
+    echo "$ZSH_THEME_GIT_PROMPT_AHEAD"
19
+  fi
20
+}
21
+
22
+# Formats prompt string for current git commit short SHA
23
+function git_prompt_short_sha() {
24
+  SHA=$(git rev-parse --short HEAD 2> /dev/null) && echo "$ZSH_THEME_GIT_PROMPT_SHA_BEFORE$SHA$ZSH_THEME_GIT_PROMPT_SHA_AFTER"
25
+}
26
+
27
+# Formats prompt string for current git commit long SHA
28
+function git_prompt_long_sha() {
29
+  SHA=$(git rev-parse HEAD 2> /dev/null) && echo "$ZSH_THEME_GIT_PROMPT_SHA_BEFORE$SHA$ZSH_THEME_GIT_PROMPT_SHA_AFTER"
30
+}
31
+
32
+# Get the status of the working tree
16 33
 git_prompt_status() {
17 34
   INDEX=$(git status --porcelain 2> /dev/null)
18 35
   STATUS=""
... ...
@@ -41,4 +59,4 @@ git_prompt_status() {
41 41
     STATUS="$ZSH_THEME_GIT_PROMPT_UNMERGED$STATUS"
42 42
   fi
43 43
   echo $STATUS
44
-}
44
+}
45 45
\ No newline at end of file
... ...
@@ -1,6 +1,4 @@
1 1
 # TODO: Explain what some of this does..
2
-autoload -U compinit
3
-compinit -i
4 2
 
5 3
 bindkey -e
6 4
 bindkey '\ew' kill-region
... ...
@@ -3,11 +3,12 @@
3 3
 #Fully support screen, iterm, and probably most modern xterm and rxvt
4 4
 #Limited support for Apple Terminal (Terminal can't set window or tab separately)
5 5
 function title {
6
-  if [[ "$TERM" == "screen" ]]; then 
7
-    print -Pn "\ek$1\e\\" #set screen hardstatus, usually truncated at 20 chars
8
-  elif [[ ($TERM =~ "^xterm") ]] || [[ ($TERM == "rxvt") ]] || [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then
9
-    print -Pn "\e]2;$2\a" #set window name
10
-    print -Pn "\e]1;$1\a" #set icon (=tab) name (will override window name on broken terminal)
6
+  [ "$DISABLE_AUTO_TITLE" != "true" ] || return
7
+  if [[ "$TERM" == screen* ]]; then 
8
+    print -Pn "\ek$1:q\e\\" #set screen hardstatus, usually truncated at 20 chars
9
+  elif [[ "$TERM" == xterm* ]] || [[ $TERM == rxvt* ]] || [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then
10
+    print -Pn "\e]2;$2:q\a" #set window name
11
+    print -Pn "\e]1;$1:q\a" #set icon (=tab) name (will override window name on broken terminal)
11 12
   fi
12 13
 }
13 14
 
... ...
@@ -21,6 +22,8 @@ function precmd {
21 21
 
22 22
 #Appears at the beginning of (and during) of command execution
23 23
 function preexec {
24
+  emulate -L zsh
25
+  setopt extended_glob
24 26
   local CMD=${1[(wr)^(*=*|sudo|ssh|-*)]} #cmd name only, or if this is sudo or ssh, the next cmd
25 27
   title "$CMD" "%100>...>$2%<<"
26 28
 }
... ...
@@ -7,15 +7,38 @@ fpath=($ZSH/functions $fpath)
7 7
 # TIP: Add files you don't want in git to .gitignore
8 8
 for config_file ($ZSH/lib/*.zsh) source $config_file
9 9
 
10
-# Load all of your custom configurations from custom/
11
-for config_file ($ZSH/custom/*.zsh) source $config_file
10
+# Add all defined plugins to fpath
11
+plugin=${plugin:=()}
12
+for plugin ($plugins) fpath=($ZSH/plugins/$plugin $fpath)
13
+
14
+# Load and run compinit
15
+autoload -U compinit
16
+compinit -i
12 17
 
13 18
 # Load all of the plugins that were defined in ~/.zshrc
14
-plugin=${plugin:=()}
15
-for plugin ($plugins) source $ZSH/plugins/$plugin/$plugin.plugin.zsh
19
+for plugin ($plugins); do
20
+  if [ -f $ZSH/plugins/$plugin/$plugin.plugin.zsh ]; then
21
+    source $ZSH/plugins/$plugin/$plugin.plugin.zsh
22
+  fi
23
+done
24
+
25
+# Load all of your custom configurations from custom/
26
+for config_file ($ZSH/custom/*.zsh) source $config_file
16 27
 
17 28
 # Load the theme
18
-source "$ZSH/themes/$ZSH_THEME.zsh-theme"
29
+# Check for updates on initial load...
30
+if [ "$ZSH_THEME" = "random" ]
31
+then
32
+  themes=($ZSH/themes/*zsh-theme)
33
+  N=${#themes[@]}
34
+  ((N=RANDOM%N))
35
+  RANDOM_THEME=${themes[$N]}
36
+  source "$RANDOM_THEME"
37
+  echo "[oh-my-zsh] Random theme '$RANDOM_THEME' loaded..."
38
+else
39
+  source "$ZSH/themes/$ZSH_THEME.zsh-theme"
40
+fi
41
+
19 42
 
20 43
 # Check for updates on initial load...
21 44
 if [ "$DISABLE_AUTO_UPDATE" = "true" ]
... ...
@@ -31,6 +31,7 @@ _1st_arguments=(
31 31
   'search:search for a formula (/regex/ or string)'
32 32
   'unlink:unlink a formula'
33 33
   'update:freshen up links'
34
+  'upgrade:upgrade outdated formulae'
34 35
   'uses:show formulas which depend on a formula'
35 36
 )
36 37
 
37 38
deleted file mode 100644
... ...
@@ -1,4 +0,0 @@
1
-# add brew completion function to path
2
-fpath=($ZSH/plugins/brew $fpath)
3
-autoload -U compinit
4
-compinit -i
5 1
new file mode 100644
... ...
@@ -0,0 +1,67 @@
0
+#compdef cpanm
1
+
2
+##
3
+# cpanminus Z Shell completion script
4
+##
5
+#
6
+# Current supported cpanm version: 1.4000 (Tue Mar  8 01:00:49 PST 2011)
7
+#
8
+# The latest code is always located at:
9
+#   https://github.com/rshhh/cpanminus/blob/master/etc/_cpanm
10
+#
11
+
12
+local arguments curcontext="$curcontext"
13
+typeset -A opt_args
14
+
15
+
16
+arguments=(
17
+
18
+# Commands
19
+#  '(--install -i)'{--install,-i}'[Installs the modules]'
20
+  '(- :)--self-upgrade[Upgrades itself]'
21
+  '(- :)--info[Displays distribution info on CPAN]'
22
+  '(--installdeps)--installdeps[Only install dependencies]'
23
+  '(--look)--look[Download/unpack the distribution and then open the directory with your shell]'
24
+  '(- :)'{--help,-h}'[Displays help information]'
25
+  '(- :)'{--version,-V}'[Displays software version]'
26
+
27
+# Options
28
+  {--force,-f}'[Force install]'
29
+  {--notest,-n}'[Do not run unit tests]'
30
+  {--sudo,-S}'[sudo to run install commands]'
31
+  '(-v --verbose --quiet -q)'{--verbose,-v}'[Turns on chatty output]'
32
+  '(-q --quiet --verbose -v)'{--quiet,-q}'[Turns off all output]'
33
+  {--local-lib,-l}'[Specify the install base to install modules]'
34
+  {--local-lib-contained,-L}'[Specify the install base to install all non-core modules]'
35
+  '--mirror[Specify the base URL for the mirror (e.g. http://cpan.cpantesters.org/)]:URLs:_urls'
36
+  '--mirror-only[Use the mirror\''s index file instead of the CPAN Meta DB]'
37
+  '--prompt[Prompt when configure/build/test fails]'
38
+  '--reinstall[Reinstall the distribution even if you already have the latest version installed]'
39
+  '--interactive[Turn on interactive configure]'
40
+
41
+  '--scandeps[Scan the depencencies of given modules and output the tree in a text format]'
42
+  '--format[Specify what format to display the scanned dependency tree]:scandeps format:(tree json yaml dists)'
43
+
44
+  '--save-dists[Specify the optional directory path to copy downloaded tarballs]'
45
+#  '--uninst-shadows[Uninstalls the shadow files of the distribution that you\''re installing]'
46
+
47
+  '--auto-cleanup[Number of days that cpanm\''s work directories expire in. Defaults to 7]'
48
+  '(--no-man-pages)--man-pages[Generates man pages for executables (man1) and libraries (man3)]'
49
+  '(--man-pages)--no-man-pages[Do not generate man pages]'
50
+
51
+
52
+  # Note: Normally with "--lwp", "--wget" and "--curl" options set to true (which is the default) cpanm tries LWP,
53
+  #            Wget, cURL and HTTP::Tiny (in that order) and uses the first one available.
54
+  # (So that the exclusions are not enabled here for the completion)
55
+  '(--lwp)--lwp[Use LWP module to download stuff]'
56
+  '(--wget)--wget[Use GNU Wget (if available) to download stuff]'
57
+  '(--curl)--curl[Use cURL (if available) to download stuff]'
58
+
59
+# Other completions
60
+  '*:Local directory or archive:_files -/ -g "*.(tar.gz|tgz|tar.bz2|zip)(-.)"'
61
+  #  '*::args: _normal' # this looks for default files (any files)
62
+)
63
+_arguments -s $arguments \
64
+  && return 0
65
+
66
+return 1
0 67
new file mode 100644
... ...
@@ -0,0 +1,13 @@
0
+# Aliases
1
+alias as="aptitude -F \"* %p -> %d \n(%v/%V)\" \
2
+		--no-gui --disable-columns search"	# search package
3
+alias ad="sudo apt-get update"				# update packages lists
4
+alias au="sudo apt-get update && \
5
+		sudo apt-get dselect-upgrade"		# upgrade packages
6
+alias ai="sudo apt-get install"				# install package
7
+alias ar="sudo apt-get remove --purge && \
8
+		sudo apt-get autoremove --purge"	# remove package
9
+alias ap="apt-cache policy"				# apt policy
10
+alias av="apt-cache show"				# show package info
11
+alias acs="apt-cache search"                            # search package
12
+alias ac="sudo apt-get clean && sudo apt-get autoclean" # clean apt cache
0 13
new file mode 100644
... ...
@@ -0,0 +1,60 @@
0
+# https://github.com/dbbolton/
1
+#
2
+# Debian-related zsh aliases and functions for zsh
3
+
4
+
5
+# Aliases ###################################################################
6
+
7
+# Some self-explanatory aliases
8
+alias afs='apt-file search --regexp'
9
+alias aps='aptitude search'
10
+alias apsrc='apt-get source'
11
+alias apv='apt-cache policy'
12
+
13
+alias apdg='su -c "aptitude update && aptitude safe-upgrade"'
14
+alias apud='su -c "aptitude update"'
15
+alias apug='su -c "aptitude safe-upgrade"'
16
+
17
+# print all installed packages
18
+alias allpkgs='aptitude search -F "%p" --disable-columns ~i'
19
+
20
+# Install all .deb files in the current directory.
21
+# Warning: you will need to put the glob in single quotes if you use:
22
+# glob_subst
23
+alias di='su -c "dpkg -i ./*.deb"'
24
+
25
+# Create a basic .deb package
26
+alias mydeb='time dpkg-buildpackage -rfakeroot -us -uc'
27
+
28
+# Remove ALL kernel images and headers EXCEPT the one in use
29
+alias kclean='su -c '\''aptitude remove -P ?and(~i~nlinux-(ima|hea) ?not(~n`uname -r`))'\'' root'
30
+
31
+
32
+
33
+# Functions #################################################################
34
+
35
+# create a simple script that can be used to 'duplicate' a system
36
+apt-copy() {
37
+	print '#!/bin/sh'"\n" > apt-copy.sh
38
+
39
+	list=$(perl -m'AptPkg::Cache' -e '$c=AptPkg::Cache->new; for (keys %$c){ push @a, $_ if $c->{$_}->{'CurrentState'} eq 'Installed';} print "$_ " for sort @a;')
40
+
41
+	print 'aptitude install '"$list\n" >> apt-copy.sh
42
+
43
+	chmod +x apt-copy.sh
44
+}
45
+
46
+
47
+# Kernel-package building shortcut
48
+dbb-build () {
49
+	MAKEFLAGS=''		# temporarily unset MAKEFLAGS ( '-j3' will fail )
50
+	appendage='-custom' # this shows up in $ (uname -r )
51
+    revision=$(date +"%Y%m%d") # this shows up in the .deb file name
52
+
53
+    make-kpkg clean
54
+
55
+    time fakeroot make-kpkg --append-to-version "$appendage" --revision \
56
+        "$revision" kernel_image kernel_headers
57
+}
58
+
59
+
0 60
deleted file mode 100644
... ...
@@ -1,4 +0,0 @@
1
-# add gem completion function to path
2
-fpath=($ZSH/plugins/gem $fpath)
3
-autoload -U compinit
4
-compinit -i
5 1
new file mode 100644
... ...
@@ -0,0 +1,332 @@
0
+#!zsh
1
+#
2
+# Installation
3
+# ------------
4
+#
5
+# To achieve git-flow completion nirvana:
6
+#
7
+#  0. Update your zsh's git-completion module to the newest verion.
8
+#     From here. http://zsh.git.sourceforge.net/git/gitweb.cgi?p=zsh/zsh;a=blob_plain;f=Completion/Unix/Command/_git;hb=HEAD
9
+#
10
+#  1. Install this file. Either:
11
+#
12
+#     a. Place it in your .zshrc:
13
+#
14
+#     b. Or, copy it somewhere (e.g. ~/.git-flow-completion.zsh) and put the following line in
15
+#        your .zshrc:
16
+#
17
+#            source ~/.git-flow-completion.zsh
18
+#
19
+#     c. Or, use this file as a oh-my-zsh plugin.
20
+#
21
+
22
+_git-flow ()
23
+{
24
+	local curcontext="$curcontext" state line
25
+	typeset -A opt_args
26
+
27
+	_arguments -C \
28
+		':command:->command' \
29
+		'*::options:->options'
30
+
31
+	case $state in
32
+		(command)
33
+
34
+			local -a subcommands
35
+			subcommands=(
36
+				'init:Initialize a new git repo with support for the branching model.'
37
+				'feature:Manage your feature branches.'
38
+				'release:Manage your release branches.'
39
+				'hotfix:Manage your hotfix branches.'
40
+				'support:Manage your support branches.'
41
+				'version:Shows version information.'
42
+			)
43
+			_describe -t commands 'git flow' subcommands
44
+		;;
45
+
46
+		(options)
47
+			case $line[1] in
48
+
49
+				(init)
50
+					_arguments \
51
+						-f'[Force setting of gitflow branches, even if already configured]'
52
+					;;
53
+
54
+					(version)
55
+					;;
56
+
57
+					(hotfix)
58
+						__git-flow-hotfix
59
+					;;
60
+
61
+					(release)
62
+						__git-flow-release
63
+					;;
64
+
65
+					(feature)
66
+						__git-flow-feature
67
+					;;
68
+			esac
69
+		;;
70
+	esac
71
+}
72
+
73
+__git-flow-release ()
74
+{
75
+	local curcontext="$curcontext" state line
76
+	typeset -A opt_args
77
+
78
+	_arguments -C \
79
+		':command:->command' \
80
+		'*::options:->options'
81
+
82
+	case $state in
83
+		(command)
84
+
85
+			local -a subcommands
86
+			subcommands=(
87
+				'start:Start a new release branch.'
88
+				'finish:Finish a release branch.'
89
+				'list:List all your release branches. (Alias to `git flow release`)'
90
+			)
91
+			_describe -t commands 'git flow release' subcommands
92
+			_arguments \
93
+				-v'[Verbose (more) output]'
94
+		;;
95
+
96
+		(options)
97
+			case $line[1] in
98
+
99
+				(start)
100
+					_arguments \
101
+						-F'[Fetch from origin before performing finish]'\
102
+						':version:__git_flow_version_list'
103
+				;;
104
+
105
+				(finish)
106
+					_arguments \
107
+						-F'[Fetch from origin before performing finish]' \
108
+						-s'[Sign the release tag cryptographically]'\
109
+						-u'[Use the given GPG-key for the digital signature (implies -s)]'\
110
+						-m'[Use the given tag message]'\
111
+						-p'[Push to $ORIGIN after performing finish]'\
112
+						':version:__git_flow_version_list'
113
+				;;
114
+
115
+				*)
116
+					_arguments \
117
+						-v'[Verbose (more) output]'
118
+				;;
119
+			esac
120
+		;;
121
+	esac
122
+}
123
+
124
+__git-flow-hotfix ()
125
+{
126
+	local curcontext="$curcontext" state line
127
+	typeset -A opt_args
128
+
129
+	_arguments -C \
130
+		':command:->command' \
131
+		'*::options:->options'
132
+
133
+	case $state in
134
+		(command)
135
+
136
+			local -a subcommands
137
+			subcommands=(
138
+				'start:Start a new hotfix branch.'
139
+				'finish:Finish a hotfix branch.'
140
+				'list:List all your hotfix branches. (Alias to `git flow hotfix`)'
141
+			)
142
+			_describe -t commands 'git flow hotfix' subcommands
143
+			_arguments \
144
+				-v'[Verbose (more) output]'
145
+		;;
146
+
147
+		(options)
148
+			case $line[1] in
149
+
150
+				(start)
151
+					_arguments \
152
+						-F'[Fetch from origin before performing finish]'\
153
+						':hotfix:__git_flow_version_list'\
154
+						':branch-name:__git_branch_names'
155
+				;;
156
+
157
+				(finish)
158
+					_arguments \
159
+						-F'[Fetch from origin before performing finish]' \
160
+						-s'[Sign the release tag cryptographically]'\
161
+						-u'[Use the given GPG-key for the digital signature (implies -s)]'\
162
+						-m'[Use the given tag message]'\
163
+						-p'[Push to $ORIGIN after performing finish]'\
164
+						':hotfix:__git_flow_hotfix_list'
165
+				;;
166
+
167
+				*)
168
+					_arguments \
169
+						-v'[Verbose (more) output]'
170
+				;;
171
+			esac
172
+		;;
173
+	esac
174
+}
175
+
176
+__git-flow-feature ()
177
+{
178
+	local curcontext="$curcontext" state line
179
+	typeset -A opt_args
180
+
181
+	_arguments -C \
182
+		':command:->command' \
183
+		'*::options:->options'
184
+
185
+	case $state in
186
+		(command)
187
+
188
+			local -a subcommands
189
+			subcommands=(
190
+				'start:Start a new feature branch.'
191
+				'finish:Finish a feature branch.'
192
+				'list:List all your feature branches. (Alias to `git flow feature`)'
193
+				'publish: public'
194
+				'track: track'
195
+				'diff: diff'
196
+				'rebase: rebase'
197
+				'checkout: checkout'
198
+				'pull: pull'
199
+			)
200
+			_describe -t commands 'git flow feature' subcommands
201
+			_arguments \
202
+				-v'[Verbose (more) output]'
203
+		;;
204
+
205
+		(options)
206
+			case $line[1] in
207
+
208
+				(start)
209
+					_arguments \
210
+						-F'[Fetch from origin before performing finish]'\
211
+						':feature:__git_flow_feature_list'\
212
+						':branch-name:__git_branch_names'
213
+				;;
214
+
215
+				(finish)
216
+					_arguments \
217
+						-F'[Fetch from origin before performing finish]' \
218
+						-r'[Rebase instead of merge]'\
219
+						':feature:__git_flow_feature_list'
220
+				;;
221
+
222
+				(publish)
223
+					_arguments \
224
+						':feature:__git_flow_feature_list'\
225
+				;;
226
+
227
+				(track)
228
+					_arguments \
229
+						':feature:__git_flow_feature_list'\
230
+				;;
231
+
232
+				(diff)
233
+					_arguments \
234
+						':branch:__git_branch_names'\
235
+				;;
236
+
237
+				(rebase)
238
+					_arguments \
239
+						-i'[Do an interactive rebase]' \
240
+						':branch:__git_branch_names'
241
+				;;
242
+
243
+				(checkout)
244
+					_arguments \
245
+						':branch:__git_flow_feature_list'\
246
+				;;
247
+
248
+				(pull)
249
+					_arguments \
250
+						':remote:__git_remotes'\
251
+						':branch:__git_branch_names'
252
+				;;
253
+
254
+				*)
255
+					_arguments \
256
+						-v'[Verbose (more) output]'
257
+				;;
258
+			esac
259
+		;;
260
+	esac
261
+}
262
+
263
+__git_flow_version_list ()
264
+{
265
+	local expl
266
+	declare -a versions
267
+
268
+	versions=(${${(f)"$(_call_program versions git flow release list 2> /dev/null | tr -d ' |*')"}})
269
+	__git_command_successful || return
270
+
271
+	_wanted versions expl 'version' compadd $versions
272
+}
273
+
274
+__git_flow_feature_list ()
275
+{
276
+	local expl
277
+	declare -a features
278
+
279
+	features=(${${(f)"$(_call_program features git flow feature list 2> /dev/null | tr -d ' |*')"}})
280
+	__git_command_successful || return
281
+
282
+	_wanted features expl 'feature' compadd $features
283
+}
284
+
285
+__git_remotes () {
286
+	local expl gitdir remotes
287
+
288
+	gitdir=$(_call_program gitdir git rev-parse --git-dir 2>/dev/null)
289
+	__git_command_successful || return
290
+
291
+	remotes=(${${(f)"$(_call_program remotes git config --get-regexp '"^remote\..*\.url$"')"}//#(#b)remote.(*).url */$match[1]})
292
+	__git_command_successful || return
293
+
294
+	# TODO: Should combine the two instead of either or.
295
+	if (( $#remotes > 0 )); then
296
+		_wanted remotes expl remote compadd $* - $remotes
297
+	else
298
+		_wanted remotes expl remote _files $* - -W "($gitdir/remotes)" -g "$gitdir/remotes/*"
299
+	fi
300
+}
301
+
302
+__git_flow_hotfix_list ()
303
+{
304
+	local expl
305
+	declare -a hotfixes
306
+
307
+	hotfixes=(${${(f)"$(_call_program hotfixes git flow hotfix list 2> /dev/null | tr -d ' |*')"}})
308
+	__git_command_successful || return
309
+
310
+	_wanted hotfixes expl 'hotfix' compadd $hotfixes
311
+}
312
+
313
+__git_branch_names () {
314
+	local expl
315
+	declare -a branch_names
316
+
317
+	branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads 2>/dev/null)"}#refs/heads/})
318
+	__git_command_successful || return
319
+
320
+	_wanted branch-names expl branch-name compadd $* - $branch_names
321
+}
322
+
323
+__git_command_successful () {
324
+	if (( ${#pipestatus:#0} > 0 )); then
325
+		_message 'not a git repository'
326
+		return 1
327
+	fi
328
+	return 0
329
+}
330
+
331
+zstyle ':completion:*:*:git:*' user-commands flow:'description for foo'
0 332
\ No newline at end of file
... ...
@@ -1,22 +1,36 @@
1 1
 # Aliases
2 2
 alias g='git'
3
+compdef g=git
3 4
 alias gst='git status'
5
+compdef _git gst=git-status
4 6
 alias gl='git pull'
7
+compdef _git gl=git-pull
5 8
 alias gup='git fetch && git rebase'
9
+compdef _git gup=git-fetch
6 10
 alias gp='git push'
7
-alias gd='git diff | mate'
8
-alias gdv='git diff -w "$@" | vim -R -'
11
+compdef _git gp=git-push
12
+gdv() { git-diff -w "$@" | view - }
13
+compdef _git gdv=git-diff
9 14
 alias gc='git commit -v'
15
+compdef _git gc=git-commit
10 16
 alias gca='git commit -v -a'
17
+compdef _git gca=git-commit
11 18
 alias gco='git checkout'
19
+compdef _git gco=git-checkout
12 20
 alias gb='git branch'
21
+compdef _git gb=git-branch
13 22
 alias gba='git branch -a'
23
+compdef _git gba=git-branch
14 24
 alias gcount='git shortlog -sn'
25
+compdef gcount=git
15 26
 alias gcp='git cherry-pick'
27
+compdef _git gcp=git-cherry-pick
16 28
 alias glg='git log --stat --max-count=5'
29
+compdef _git glg=git-log
17 30
 
18 31
 # Git and svn mix
19 32
 alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk'
33
+compdef git-svn-dcommit-push=git
20 34
 
21 35
 #
22 36
 # Will return the current branch name
... ...
@@ -29,5 +43,8 @@ function current_branch() {
29 29
 
30 30
 # these aliases take advantage of the previous function
31 31
 alias ggpull='git pull origin $(current_branch)'
32
+compdef ggpull=git
32 33
 alias ggpush='git push origin $(current_branch)'
34
+compdef ggpush=git
33 35
 alias ggpnp='git pull origin $(current_branch) && git push origin $(current_branch)'
36
+compdef ggpnp=git
... ...
@@ -1,4 +1,7 @@
1
-# add github completion function to path
2
-fpath=($ZSH/plugins/github $fpath)
3
-autoload -U compinit
4
-compinit -i
1
+# hub alias from defunkt
2
+# https://github.com/defunkt/hub
3
+if [ "$commands[(I)hub]" ]; then
4
+    # eval `hub alias -s zsh`
5
+    function git(){hub "$@"}
6
+fi
7
+
5 8
new file mode 100644
... ...
@@ -0,0 +1,27 @@
0
+function _lein_commands() {
1
+    local ret=1 state
2
+    _arguments ':subcommand:->subcommand' && ret=0
3
+
4
+    case $state in
5
+      subcommand)
6
+        subcommands=(
7
+          "clean:remove compiled files and dependencies from project"
8
+          "compile:ahead-of-time compile the project"
9
+          "deps:download and install all dependencies"
10
+          "help:display a list of tasks or help for a given task"
11
+          "install:install the project and its dependencies in your local repository"
12
+          "jar:create a jar file containing the compiled .class files"
13
+          "new:create a new project skeleton"
14
+          "pom:write a pom.xml file to disk for maven interop"
15
+          "test:run the project's tests"
16
+          "uberjar:Create a jar including the contents of each of deps"
17
+          "upgrade:upgrade leiningen to the latest stable release"
18
+          "version:print leiningen's version"
19
+        )
20
+        _describe -t subcommands 'leiningen subcommands' subcommands && ret=0
21
+    esac
22
+
23
+    return ret
24
+}
25
+
26
+compdef _lein_commands lein
0 27
new file mode 100644
... ...
@@ -0,0 +1,26 @@
0
+# LOL!!1
1
+# Source: http://aur.archlinux.org/packages/lolbash/lolbash/lolbash.sh
2
+
3
+alias wtf='dmesg'
4
+alias onoz='cat /var/log/errors.log'
5
+alias rtfm='man'
6
+
7
+alias visible='echo'
8
+alias invisible='cat'
9
+alias moar='more'
10
+
11
+alias icanhas='mkdir'
12
+alias donotwant='rm'
13
+alias dowant='cp'
14
+alias gtfo='mv'
15
+
16
+alias hai='cd'
17
+alias plz='pwd'
18
+
19
+alias inur='locate'
20
+
21
+alias nomz='ps -aux'
22
+alias nomnom='killall'
23
+
24
+alias cya='reboot'
25
+alias kthxbai='halt'
0 26
new file mode 100644
... ...
@@ -0,0 +1,89 @@
0
+#compdef port
1
+
2
+local subcmds 
3
+
4
+# we cache the list of ports
5
+# we shall use some cache policy to avoid problems with new ports
6
+if (( ! $+portlist )); then
7
+	portlist=($(port echo all; echo "all current active inactive installed uninstalled outdated"))
8
+fi
9
+
10
+subcmds=(
11
+'activate'
12
+'archive'
13
+'build'
14
+'cat'
15
+'clean'
16
+'configure'
17
+'contents'
18
+'deactivate'
19
+'dependents'
20
+'deps'
21
+'destroot'
22
+'dir'
23
+'distcheck'
24
+'distclean'
25
+'dmg'
26
+'echo'
27
+'edit'
28
+'extract'
29
+'fetch'
30
+'file'
31
+'help'
32
+'info'
33
+'install' 
34
+'installed' 
35
+'list'
36
+'livecheck'
37
+'location'
38
+'mpkg'
39
+'outdated'
40
+'patch'
41
+'pkg'
42
+'provides'
43
+'rpmpackage'
44
+'search'
45
+'selfupdate'
46
+'sync'
47
+'test'
48
+'unarchive'
49
+'uninstall'
50
+'upgrade' 
51
+'variants'
52
+'version'
53
+)
54
+
55
+_arguments -C \
56
+'-v[verbose mode (generate verbose messages)]' \
57
+'-d[debug mode (generate debugging messages)]' \
58
+'-q[quiet mode (suppress messages)]' \
59
+'-D[specify portdir]' \
60
+'-k[keep mode (do not autoclean after install)]' \
61
+'-n[dont follow dependencies in upgrade (only for upgrading)]' \
62
+'-a[upgrade all installed ports (only for upgrading)]' \
63
+'-u[uninstall non-active ports when upgrading and uninstalling]' \
64
+'-f[force mode (ignore state file)]' \
65
+'-s[source-only mode]' \
66
+'-b[binary-only mode]' \
67
+'-o[honor state files older than Portfile]' \
68
+'*::command:->command' \
69
+&& return 0
70
+
71
+case $state in
72
+	command)
73
+	if ((CURRENT == 1)); then
74
+		state=subcommands
75
+	else
76
+		state=portname
77
+	fi
78
+	;;
79
+esac
80
+
81
+case $state in
82
+	subcommands)
83
+	_describe -t commands 'port commands' subcmds
84
+	;;
85
+	portname)
86
+	_describe -t commands 'available ports' portlist
87
+	;;
88
+esac
... ...
@@ -5,3 +5,4 @@ alias psu="sudo port selfupdate"
5 5
 alias puni="sudo port uninstall inactive"
6 6
 alias puo="sudo port upgrade outdated"
7 7
 alias pup="psu && puo"
8
+
8 9
new file mode 100644
... ...
@@ -0,0 +1,8 @@
0
+# commands to control local mysql-server installation
1
+# paths are for osx installation via macports
2
+
3
+alias mysqlstart='sudo /opt/local/share/mysql5/mysql/mysql.server start'
4
+alias mysqlstop='sudo /opt/local/share/mysql5/mysql/mysql.server stop'
5
+alias mysqlrestart='sudo /opt/local/share/mysql5/mysql/mysql.server restart'
6
+
7
+alias mysqlstatus='mysqladmin5 -u root -p ping'
0 8
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,19 @@
0
+#compdef npm
1
+
2
+# Node Package Manager 0.3.15 completion, letting npm do all the completion work
3
+
4
+_npm() {
5
+  compadd -- $(_npm_complete $words)
6
+}
7
+
8
+# We want to show all errors of any substance, but never the "npm (not )ok" one.
9
+# (Also doesn't consider "ERR! no match found" worth breaking the terminal for.)
10
+_npm_complete() {
11
+  local ask_npm
12
+  ask_npm=(npm completion --color false --loglevel error -- $@)
13
+  { _call_program npm $ask_npm 2>&1 >&3 \
14
+  | egrep -v '^(npm (not |)ok|ERR! no match found)$' >&2; \
15
+  } 3>&1
16
+}
17
+
18
+_npm "$@"
0 19
new file mode 100644
... ...
@@ -0,0 +1,62 @@
0
+# https://github.com/dbbolton
1
+#
2
+# Below are some useful Perl-related aliases/functions that I use with zsh.
3
+
4
+
5
+# Aliases ###################################################################
6
+
7
+# perlbrew ########
8
+alias pbi='perlbrew install'
9
+alias pbl='perlbrew list'
10
+alias pbo='perlbrew off'
11
+alias pbs='perlbrew switch'
12
+alias pbu='perlbrew use'
13
+
14
+# Perl ############
15
+
16
+# perldoc`
17
+alias pd='perldoc'
18
+
19
+# use perl like awk/sed
20
+alias ple='perl -wlne'
21
+
22
+# show the latest stable release of Perl
23
+alias latest-perl='curl -s http://www.perl.org/get.html | perl -wlne '\''if (/perl\-([\d\.]+)\.tar\.gz/) { print $1; exit;}'\'
24
+
25
+
26
+
27
+# Functions #################################################################
28
+
29
+# newpl - creates a basic Perl script file and opens it with $EDITOR 
30
+newpl () {
31
+	# set $EDITOR to 'vim' if it is undefined
32
+	[[ -z $EDITOR ]] && EDITOR=vim
33
+
34
+	# if the file exists, just open it
35
+	[[ -e $1 ]] && print "$1 exists; not modifying.\n" && $EDITOR $1
36
+
37
+	# if it doesn't, make it, and open it
38
+	[[ ! -e $1 ]] && print '#!/usr/bin/perl'"\n"'use strict;'"\n"'use warnings;'\
39
+		"\n\n" > $1 && $EDITOR $1
40
+}
41
+
42
+
43
+# pgs - Perl Global Substitution
44
+# find pattern		= 1st arg
45
+# replace pattern	= 2nd arg
46
+# filename			= 3rd arg
47
+pgs() { # [find] [replace] [filename]
48
+    perl -i.orig -pe 's/'"$1"'/'"$2"'/g' "$3"
49
+}
50
+
51
+
52
+# Perl grep, because 'grep -P' is terrible. Lets you work with pipes or files.
53
+prep() { # [pattern] [filename unless STDOUT]
54
+    perl -nle 'print if /'"$1"'/;' $2
55
+}
56
+
57
+# say - append a newline to 'print'
58
+say() {
59
+    print "$1\n"
60
+}
61
+
0 62
deleted file mode 100644
... ...
@@ -1,4 +0,0 @@
1
-# add brew completion function to path
2
-fpath=($ZSH/plugins/pip $fpath)
3
-autoload -U compinit
4
-compinit -i
... ...
@@ -1,10 +1,30 @@
1
-alias rs='ruby script/rails server'
2
-alias rg='ruby script/rails generate'
3
-alias rd='ruby script/rails destroy'
4
-alias rp='ruby script/rails plugin'
1
+# Rails 3 aliases, backwards-compatible with Rails 2.
2
+
3
+function _bundle_command {
4
+  if command -v bundle && [ -e "Gemfile" ]; then
5
+    bundle exec $@
6
+  else
7
+    $@
8
+  fi
9
+}
10
+
11
+function _rails_command () {
12
+  if [ -e "script/server" ]; then
13
+    ruby script/$@
14
+  else
15
+    ruby script/rails $@
16
+  fi
17
+}
18
+
19
+alias rc='_rails_command console'
20
+alias rd='_rails_command destroy'
21
+alias rdb='_rails_command dbconsole'
5 22
 alias rdbm='rake db:migrate db:test:clone'
6
-alias rdbmr='rake db:migrate && rake db:migrate:redo'
7
-alias rc='ruby script/rails console'
8
-alias rd='ruby script/rails server --debugger'
23
+alias rg='_rails_command generate'
24
+alias rp='_rails_command plugin'
25
+alias rs='_rails_command server'
26
+alias rsd='_rails_command server --debugger'
9 27
 alias devlog='tail -f log/development.log'
10 28
 
29
+alias rspec='_bundle_command rspec'
30
+alias cuke='_bundle_command cucumber'
11 31
new file mode 100644
... ...
@@ -0,0 +1,142 @@
0
+#compdef redis-cli rec
1
+#autoload
2
+
3
+#redis cli completion, based off homebrew completion (ref. 2011-04-14)
4
+
5
+local -a _1st_arguments
6
+_1st_arguments=(
7
+  'append:append a value to a key'
8
+  'auth:authenticate to the server'
9
+  'bgrewriteeaof:asynchronously rewrite the append-only file'
10
+  'bgsave:asynchornously save the dataset to disk'
11
+  'blpop:remove and get the first element in a list, or block until one is available'
12
+  'brpop:remove and get the last element in a list, or block until one is available'
13
+  'brpoplpush:pop a value from a list, push it to another list and return it; or block until one is available'
14
+  # 'config get:get the value of a configuration parameter'
15
+  # 'config set:set a configuration parameter to the given value'
16
+  # 'config resetstat: reset the stats returned by INFO'
17
+  'dbsize:return the number of keys in the selected database'
18
+  # 'debug object:get debugging information about a key'
19
+  # 'debug setgfault:make the server crash'
20
+  'decr:decrement the integer value of a key by one'
21
+  'decrby:decrement the integet value of a key by the given number'
22
+  'del:delete a key'
23
+  'discard:discard all commands issued after MULTI'
24
+  'echo:echo the given string'
25
+  'exec:execute all commands issued after a MULTI'
26
+  'exists:determine if a key exists'
27
+  'expire:set the time to live for a key, in seconds'
28
+  'expireat:set the expiration for a key as a UNIX timestamp'
29
+  'flushall:remove all keys from all databases'
30
+  'flushdb:remove all keys from the current database'
31
+  'get:get the value of a key'
32
+  'getbit:returns the bit value at offset in the string value stored at key'
33
+  'getrange:get a substring of the string stored at a key'
34
+  'getset:set the string value of a key and return its old value'
35
+  'hdel:delete a hash field'
36
+  'hexists:determine if a hash field exists'
37
+  'hget:get the value of a hash field'
38
+  'hgetall:get all the fields and values in a hash'
39
+  'hincrby:increment the integer value of a hash field by the given number'
40
+  'hkeys:get all the fields in a hash'
41
+  'hlen:get the number of fields in a hash'
42
+  'hmget:get the values of all the given hash fields'
43
+  'hmset:set multiple hash fields to multiple values'
44
+  'hset:set the string value of a hash field'
45
+  'hsetnx:set the value of a hash field, only if the field does not exist'
46
+  'hvals:get all the values in a hash'
47
+  'incr:increment the integer value of a key by one'
48
+  'incrby:increment the integer value of a key by the given number'
49
+  'info:get information and statistics about the server'
50
+  'keys:find all keys matching the given pattern'
51
+  'lastsave:get the UNIX timestamp of the last successful save to disk'
52
+  'lindex:get an element from a list by its index'
53
+  'linset:insert an element before or after another element in a list'
54
+  'llen:get the length of a list'
55
+  'lpop:remove and get the first element in a list'
56
+  'lpush:prepend a value to a list'
57
+  'lpushx:prepend a value to a list, only if the list exists'
58
+  'lrange:get a range of elements from a list'
59
+  'lrem:remove elements from a list'
60
+  'lset:set the value of an element in a list by its index'
61
+  'ltrim:trim a list to the specified range'
62
+  'mget:get the values of all the given keys'
63
+  'monitor:listen for all requests received by the server in real time'
64
+  'move:move a key to another database'
65
+  'mset:set multiple keys to muliple values'
66
+  'msetnx:set multiple keys tom ultiple values, only if none of the keys exist'
67
+  'multi:mark the start of a transaction block'
68
+  'object:inspect the internals of Redis objects'
69
+  'persist:remove the expiration from a key'
70
+  'ping:ping the server'
71
+  'psubscribe:listen for messages published to channels matching the given patterns'
72
+  'publish:post a message to a channel'
73
+  'punsubscribe:stop listening for messages posted to channels matching the given patterns'
74
+  'quit:close the connection'
75
+  'randomkey:return a random key from the keyspace'
76
+  'rename:rename a key'
77
+  'renamenx:rename a key, only if the new key does not exist'
78
+  'rpop:remove and get the last element in a list'
79
+  'rpoplpush:remove the last element in a list, append it to another list and return it'
80
+  'rpush:append a value to a list'
81
+  'rpushx:append a value to a list, only if the list exists'
82
+  'sadd:add a member to a set'
83
+  'save:synchronously save the dataset to disk'
84
+  'scard:get the number of members in a set'
85
+  'sdiff:subtract multiple sets'
86
+  'sdiffstore:subtract multiple sets and store the resulting set in a key'
87
+  'select:change the selected database for the current connection'
88
+  'set:set the string value of a key'
89
+  'setbit:sets or clears the bit at offset in the string value stored at key'
90
+  'setex:set the value and expiration of a key'
91
+  'setnx:set the value of a key, only if the key does not exist'
92
+  'setrange:overwrite part of a string at key starting at the specified offset'
93
+  'shutdown:synchronously save the dataset to disk and then shut down the server'
94
+  'sinter:intersect multiple sets'
95
+  'sinterstore:intersect multiple sets and store the resulting set in a key'
96
+  'sismember:determine if a given value is a member of a set'
97
+  'slaveof:make the server a slave of another instance, or promote it as master'
98
+  'smembers:get all the members in a set'
99
+  'smove:move a member from one set to another'
100
+  'sort:sort the elements in a list, set or sorted set'
101
+  'spop:remove and return a random member from a set'
102
+  'srandmember:get a random member from a set'
103
+  'srem:remove a member from a set'
104
+  'strlen:get the length of the value stored in a key'
105
+  'subscribe:listen for messages published to the given channels'
106
+  'sunion:add multiple sets'
107
+  'sunionstore:add multiple sets and store the resulting set in a key'
108
+  'ttl:get the time to live for a key'
109
+  'type:determine the type stored at key'
110
+  'unsubscribe:stop listening for messages posted to the given channels'
111
+  'unwatch:forget about all watched keys'
112
+  'watch:watch the given keys to determine execution of the MULTI/EXEC block'
113
+  'zadd:add a member to a sorted set, or update its score if it already exists'
114
+  'zcard:get the number of members in a sorted set'
115
+  'zcount:count the members in a sorted set with scores within the given values'
116
+  'zincrby:increment the score of a member in a sorted set'
117
+  'zinterstore:intersect multiple sorted sets and store the resulting sorted set in a new key'
118
+  'zrange:return a range of members in a sorted set, by index'
119
+  'zrangebyscore:return a range of members in a sorted set, by score'
120
+  'zrank:determine the index of a member in a sorted set'
121
+  'zrem:remove a member from a sorted set'
122
+  'zremrangebyrank:remove all members in a sorted set within the given indexes'
123
+  'zremrangebyscore:remove all members in a sorted set within the given scores'
124
+  'zrevrange:return a range of membrs in a sorted set, by index, with scores ordered from high to low'
125
+  'zrevrangebyscore:return a range of members in a sorted set, by score, with scores ordered from high to low'
126
+  'zrevrank:determine the index of a member in a sorted set, with scores ordered from high to low'
127
+  'zscore:get the score associated with the given member in a sorted set'
128
+  'zunionstore:add multiple sorted sets and store te resulting sorted set in a new key'
129
+)
130
+
131
+local expl
132
+
133
+_arguments \
134
+  '(-v --version)'{-v,--version}'[show version]' \
135
+  '(-h --help)'{-h,--help}'[show help]' \
136
+  '*:: :->subcmds' && return 0
137
+
138
+if (( CURRENT == 1 )); then
139
+  _describe -t commands "redis-cli subcommand" _1st_arguments
140
+  return
141
+fi
0 142
\ No newline at end of file
... ...
@@ -1,7 +1,7 @@
1 1
 # Based on code from Joseph M. Reagle
2 2
 # http://www.cygwin.com/ml/cygwin/2001-06/msg00537.html
3 3
 
4
-local SSH_ENV=$HOME/.ssh/environment
4
+local SSH_ENV=$HOME/.ssh/environment-$HOST
5 5
 
6 6
 function start_agent {
7 7
   /usr/bin/env ssh-agent | sed 's/^echo/#echo/' > ${SSH_ENV}
8 8
deleted file mode 100644
... ...
@@ -1,3 +0,0 @@
1
-fpath=($ZSH/plugins/vagrant $fpath)
2
-autoload -U compinit
3
-compinit -i
4 1
new file mode 100644
... ...
@@ -0,0 +1,12 @@
0
+## Aliases
1
+
2
+alias ys="yum search"                       # search package
3
+alias yp="yum info"                         # show package info
4
+alias yl="yum list"                         # list packages
5
+alias yli="yum list installed"              # print all installed packages
6
+
7
+alias yu="sudo yum update"                  # upgrate packages
8
+alias yi="sudo yum install"                 # install package
9
+alias yr="sudo yum remove"                  # remove package
10
+alias yrl="sudo yum remove --remove-leaves" # remove package and leaves
11
+alias yc="sudo yum clean all"               # clean cache
... ...
@@ -1,8 +1,10 @@
1 1
 # Path to your oh-my-zsh configuration.
2 2
 export ZSH=$HOME/.oh-my-zsh
3 3
 
4
-# Set to the name theme to load.
4
+# Set name of the theme to load.
5 5
 # Look in ~/.oh-my-zsh/themes/
6
+# Optionally, if you set this to "random", it'll load a random theme each
7
+# time that oh-my-zsh is loaded.
6 8
 export ZSH_THEME="robbyrussell"
7 9
 
8 10
 # Set to this to use case-sensitive completion
... ...
@@ -14,6 +16,9 @@ export ZSH_THEME="robbyrussell"
14 14
 # Uncomment following line if you want to disable colors in ls
15 15
 # export DISABLE_LS_COLORS="true"
16 16
 
17
+# Uncomment following line if you want to disable autosetting terminal title.
18
+# export DISABLE_AUTO_TITLE="true"
19
+
17 20
 # Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
18 21
 # Example format: plugins=(rails git textmate ruby lighthouse)
19 22
 plugins=(git)
... ...
@@ -1,4 +1,4 @@
1
-PROMPT='%{$fg[blue]%}%n%{$reset_color%} on %{$fg[red]%}%M%{$reset_color%} in %{$fg[blue]%}%~%b%{$reset_color%}$(git_time_since_commit)$(git_prompt_info)
1
+PROMPT='%{$fg[blue]%}%n%{$reset_color%} on %{$fg[red]%}%M%{$reset_color%} in %{$fg[blue]%}%~%b%{$reset_color%}$(git_time_since_commit)$(check_git_prompt_info)
2 2
 $ '
3 3
 
4 4
 ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[white]%}"
... ...
@@ -16,6 +16,29 @@ ZSH_THEME_GIT_TIME_SHORT_COMMIT_MEDIUM="%{$fg[yellow]%}"
16 16
 ZSH_THEME_GIT_TIME_SINCE_COMMIT_LONG="%{$fg[red]%}"
17 17
 ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL="%{$fg[cyan]%}"
18 18
 
19
+
20
+# Git sometimes goes into a detached head state. git_prompt_info doesn't
21
+# return anything in this case. So wrap it in another function and check
22
+# for an empty string.
23
+function check_git_prompt_info() {
24
+    if git rev-parse --git-dir > /dev/null 2>&1; then
25
+        if [[ -z $(git_prompt_info) ]]; then
26
+            echo "%{$fg[magenta]%}detached-head%{$reset_color%})"
27
+        else
28
+            echo "$(git_prompt_info)"
29
+        fi
30
+    fi
31
+}
32
+
33
+# Determine if we are using a gemset.
34
+function rvm_gemset() {
35
+    GEMSET=`rvm gemset list | grep '=>' | cut -b4-`
36
+    if [[ -n $GEMSET ]]; then
37
+        echo "%{$fg[yellow]%}$GEMSET%{$reset_color%}|"
38
+    fi 
39
+
40
+}
41
+
19 42
 # Determine the time since last commit. If branch is clean,
20 43
 # use a neutral color, otherwise colors will vary according to time.
21 44
 function git_time_since_commit() {
... ...
@@ -49,15 +72,15 @@ function git_time_since_commit() {
49 49
             fi
50 50
 
51 51
             if [ "$HOURS" -gt 24 ]; then
52
-                echo "($COLOR${DAYS}d${SUB_HOURS}h${SUB_MINUTES}m%{$reset_color%}|"
52
+                echo "($(rvm_gemset)$COLOR${DAYS}d${SUB_HOURS}h${SUB_MINUTES}m%{$reset_color%}|"
53 53
             elif [ "$MINUTES" -gt 60 ]; then
54
-                echo "($COLOR${HOURS}h${SUB_MINUTES}m%{$reset_color%}|"
54
+                echo "($(rvm_gemset)$COLOR${HOURS}h${SUB_MINUTES}m%{$reset_color%}|"
55 55
             else
56
-                echo "($COLOR${MINUTES}m%{$reset_color%}|"
56
+                echo "($(rvm_gemset)$COLOR${MINUTES}m%{$reset_color%}|"
57 57
             fi
58 58
         else
59 59
             COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL"
60
-            echo "($COLOR~|"
60
+            echo "($(rvm_gemset)$COLOR~|"
61 61
         fi
62 62
     fi
63 63
 }
... ...
@@ -3,7 +3,7 @@ local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
3 3
 
4 4
 local user_host='%{$terminfo[bold]$fg[green]%}%n@%m%{$reset_color%}'
5 5
 local current_dir='%{$terminfo[bold]$fg[blue]%} %~%{$reset_color%}'
6
-local rvm_ruby='%{$fg[red]%}‹$(~/.rvm/bin/rvm-prompt i v g)›%{$reset_color%}'
6
+local rvm_ruby='%{$fg[red]%}‹$(rvm-prompt i v g)›%{$reset_color%}'
7 7
 local git_branch='$(git_prompt_info)%{$reset_color%}'
8 8
 
9 9
 PROMPT="╭─${user_host} ${current_dir} ${rvm_ruby} ${git_branch}
10 10
new file mode 100644
... ...
@@ -0,0 +1,85 @@
0
+# -----------------------------------------------------------------------------
1
+#          FILE: dogenpunk.zsh-theme
2
+#   DESCRIPTION: oh-my-zsh theme file.
3
+#        AUTHOR: Matthew Nelson (dogenpunk@gmail.com)
4
+#       VERSION: 0.1
5
+#    SCREENSHOT: coming soon
6
+# -----------------------------------------------------------------------------
7
+
8
+MODE_INDICATOR="%{$fg_bold[red]%}❮%{$reset_color%}%{$fg[red]%}❮❮%{$reset_color%}"
9
+local return_status="%{$fg[red]%}%(?..⏎)%{$reset_color%}"
10
+
11
+PROMPT='%{$fg[blue]%}%m%{$reset_color%}%{$fg_bold[white]%} ओम् %{$reset_color%}%{$fg[cyan]%}%~:%{$reset_color%}$(git_time_since_commit)$(git_prompt_info)
12
+%{$fg[red]%}%!%{$reset_color%} $(prompt_char) '
13
+
14
+ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[green]%}git%{$reset_color%}@%{$bg[white]%}%{$fg[black]%}"
15
+ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%})"
16
+ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}!%{$reset_color%}"
17
+ZSH_THEME_GIT_PROMPT_CLEAN=""
18
+
19
+RPROMPT='${return_status}$(git_prompt_status)%{$reset_color%}'
20
+
21
+ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[green]%} ✚"
22
+ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[blue]%} ✹"
23
+ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%} ✖"
24
+ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[magenta]%} ➜"
25
+ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[yellow]%} ═"
26
+ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[cyan]%} ✭"
27
+
28
+function prompt_char() {
29
+  git branch >/dev/null 2>/dev/null && echo "%{$fg[green]%}±%{$reset_color%}" && return
30
+  hg root >/dev/null 2>/dev/null && echo "%{$fg_bold[red]%}☿%{$reset_color%}" && return
31
+  echo "%{$fg[cyan]%}◯ %{$reset_color%}"
32
+}
33
+
34
+# Colors vary depending on time lapsed.
35
+ZSH_THEME_GIT_TIME_SINCE_COMMIT_SHORT="%{$fg[green]%}"
36
+ZSH_THEME_GIT_TIME_SHORT_COMMIT_MEDIUM="%{$fg[yellow]%}"
37
+ZSH_THEME_GIT_TIME_SINCE_COMMIT_LONG="%{$fg[red]%}"
38
+ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL="%{$fg[cyan]%}"
39
+
40
+# Determine the time since last commit. If branch is clean,
41
+# use a neutral color, otherwise colors will vary according to time.
42
+function git_time_since_commit() {
43
+    if git rev-parse --git-dir > /dev/null 2>&1; then
44
+        # Only proceed if there is actually a commit.
45
+        if [[ $(git log 2>&1 > /dev/null | grep -c "^fatal: bad default revision") == 0 ]]; then
46
+            # Get the last commit.
47
+            last_commit=`git log --pretty=format:'%at' -1 2> /dev/null`
48
+            now=`date +%s`
49
+            seconds_since_last_commit=$((now-last_commit))
50
+
51
+            # Totals
52
+            MINUTES=$((seconds_since_last_commit / 60))
53
+            HOURS=$((seconds_since_last_commit/3600))
54
+
55
+            # Sub-hours and sub-minutes
56
+            DAYS=$((seconds_since_last_commit / 86400))
57
+            SUB_HOURS=$((HOURS % 24))
58
+            SUB_MINUTES=$((MINUTES % 60))
59
+
60
+            if [[ -n $(git status -s 2> /dev/null) ]]; then
61
+                if [ "$MINUTES" -gt 30 ]; then
62
+                    COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_LONG"
63
+                elif [ "$MINUTES" -gt 10 ]; then
64
+                    COLOR="$ZSH_THEME_GIT_TIME_SHORT_COMMIT_MEDIUM"
65
+                else
66
+                    COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_SHORT"
67
+                fi
68
+            else
69
+                COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL"
70
+            fi
71
+
72
+            if [ "$HOURS" -gt 24 ]; then
73
+                echo "($COLOR${DAYS}d${SUB_HOURS}h${SUB_MINUTES}m%{$reset_color%}|"
74
+            elif [ "$MINUTES" -gt 60 ]; then
75
+                echo "($COLOR${HOURS}h${SUB_MINUTES}m%{$reset_color%}|"
76
+            else
77
+                echo "($COLOR${MINUTES}m%{$reset_color%}|"
78
+            fi
79
+        else
80
+            COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL"
81
+            echo "($COLOR~|"
82
+        fi
83
+    fi
84
+}
0 85
new file mode 100644
... ...
@@ -0,0 +1,10 @@
0
+PROMPT=$'
1
+%{$fg[blue]%}%/%{$reset_color%} $(git_prompt_info)%{$fg[white]%}[%n@%m]%{$reset_color%} %{$fg[white]%}[%T]%{$reset_color%}
2
+%{$fg_bold[black]%}>%{$reset_color%} '
3
+
4
+PROMPT2="%{$fg_blod[black]%}%_> %{$reset_color%}"
5
+
6
+ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}["
7
+ZSH_THEME_GIT_PROMPT_SUFFIX="]%{$reset_color%} "
8
+ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}*%{$fg[green]%}"
9
+ZSH_THEME_GIT_PROMPT_CLEAN=""
0 10
new file mode 100644
... ...
@@ -0,0 +1,19 @@
0
+ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[green]%}["
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 "$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_PREFIX$(current_branch)$ZSH_THEME_GIT_PROMPT_SUFFIX"
10
+  fi
11
+}
12
+
13
+#RVM and git settings
14
+if [[ -s ~/.rvm/scripts/rvm ]] ; then 
15
+  RPS1='$(git_custom_status)%{$fg[red]%}[`~/.rvm/bin/rvm-prompt`]%{$reset_color%} $EPS1'
16
+fi
17
+
18
+PROMPT='%{$fg[cyan]%}[%~% ]%(?.%{$fg[green]%}.%{$fg[red]%})%B$%b '
0 19
new file mode 100644
... ...
@@ -0,0 +1,137 @@
0
+function precmd {
1
+    local TERMWIDTH
2
+    (( TERMWIDTH = ${COLUMNS} - 1 ))
3
+
4
+
5
+    ###
6
+    # Truncate the path if it's too long.
7
+    
8
+    PR_FILLBAR=""
9
+    PR_PWDLEN=""
10
+    
11
+    local promptsize=${#${(%):---(%n@%m:%l)---()--}}
12
+    local rubyprompt=`rvm_prompt_info`
13
+    local rubypromptsize=${#${rubyprompt}}
14
+    local pwdsize=${#${(%):-%~}}
15
+    
16
+    if [[ "$promptsize + $rubypromptsize + $pwdsize" -gt $TERMWIDTH ]]; then
17
+      ((PR_PWDLEN=$TERMWIDTH - $promptsize))
18
+    else
19
+      PR_FILLBAR="\${(l.(($TERMWIDTH - ($promptsize + $rubypromptsize + $pwdsize)))..${PR_HBAR}.)}"
20
+    fi
21
+
22
+}
23
+
24
+
25
+setopt extended_glob
26
+preexec () {
27
+    if [[ "$TERM" == "screen" ]]; then
28
+	local CMD=${1[(wr)^(*=*|sudo|-*)]}
29
+	echo -n "\ek$CMD\e\\"
30
+    fi
31
+}
32
+
33
+
34
+setprompt () {
35
+    ###
36
+    # Need this so the prompt will work.
37
+
38
+    setopt prompt_subst
39
+
40
+
41
+    ###
42
+    # See if we can use colors.
43
+
44
+    autoload colors zsh/terminfo
45
+    if [[ "$terminfo[colors]" -ge 8 ]]; then
46
+	colors
47
+    fi
48
+    for color in RED GREEN YELLOW BLUE MAGENTA CYAN WHITE GREY; do
49
+	eval PR_$color='%{$terminfo[bold]$fg[${(L)color}]%}'
50
+	eval PR_LIGHT_$color='%{$fg[${(L)color}]%}'
51
+	(( count = $count + 1 ))
52
+    done
53
+    PR_NO_COLOUR="%{$terminfo[sgr0]%}"
54
+
55
+    ###
56
+    # Modify Git prompt
57
+    ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[green]%}"
58
+    ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
59
+    ZSH_THEME_GIT_PROMPT_DIRTY=""
60
+    ZSH_THEME_GIT_PROMPT_CLEAN=""
61
+
62
+    ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[green]%} ✚"
63
+    ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[blue]%} ✹"
64
+    ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%} ✖"
65
+    ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[magenta]%} ➜"
66
+    ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[yellow]%} ═"
67
+    ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[cyan]%} ✭"
68
+
69
+    ###
70
+    # See if we can use extended characters to look nicer.
71
+    
72
+    typeset -A altchar
73
+    set -A altchar ${(s..)terminfo[acsc]}
74
+    PR_SET_CHARSET="%{$terminfo[enacs]%}"
75
+    PR_SHIFT_IN="%{$terminfo[smacs]%}"
76
+    PR_SHIFT_OUT="%{$terminfo[rmacs]%}"
77
+    PR_HBAR=${altchar[q]:--}
78
+    PR_ULCORNER=${altchar[l]:--}
79
+    PR_LLCORNER=${altchar[m]:--}
80
+    PR_LRCORNER=${altchar[j]:--}
81
+    PR_URCORNER=${altchar[k]:--}
82
+
83
+    
84
+    ###
85
+    # Decide if we need to set titlebar text.
86
+    
87
+    case $TERM in
88
+	xterm*)
89
+	    PR_TITLEBAR=$'%{\e]0;%(!.-=*[ROOT]*=- | .)%n@%m:%~ | ${COLUMNS}x${LINES} | %y\a%}'
90
+	    ;;
91
+	screen)
92
+	    PR_TITLEBAR=$'%{\e_screen \005 (\005t) | %(!.-=[ROOT]=- | .)%n@%m:%~ | ${COLUMNS}x${LINES} | %y\e\\%}'
93
+	    ;;
94
+	*)
95
+	    PR_TITLEBAR=''
96
+	    ;;
97
+    esac
98
+    
99
+    
100
+    ###
101
+    # Decide whether to set a screen title
102
+    if [[ "$TERM" == "screen" ]]; then
103
+	PR_STITLE=$'%{\ekzsh\e\\%}'
104
+    else
105
+	PR_STITLE=''
106
+    fi
107
+    
108
+    
109
+    ###
110
+    # Finally, the prompt.
111
+
112
+    PROMPT='$PR_SET_CHARSET$PR_STITLE${(e)PR_TITLEBAR}\
113
+$PR_CYAN$PR_SHIFT_IN$PR_ULCORNER$PR_HBAR$PR_SHIFT_OUT$PR_GREY(\
114
+$PR_GREEN%$PR_PWDLEN<...<%~%<<\
115
+$PR_GREY)`rvm_prompt_info`$PR_CYAN$PR_SHIFT_IN$PR_HBAR$PR_HBAR${(e)PR_FILLBAR}$PR_HBAR$PR_SHIFT_OUT$PR_GREY(\
116
+$PR_CYAN%(!.%SROOT%s.%n)$PR_GREY@$PR_GREEN%m:%l\
117
+$PR_GREY)$PR_CYAN$PR_SHIFT_IN$PR_HBAR$PR_URCORNER$PR_SHIFT_OUT\
118
+
119
+$PR_CYAN$PR_SHIFT_IN$PR_LLCORNER$PR_BLUE$PR_HBAR$PR_SHIFT_OUT(\
120
+$PR_YELLOW%D{%H:%M:%S}\
121
+$PR_LIGHT_BLUE%{$reset_color%}`git_prompt_info``git_prompt_status`$PR_BLUE)$PR_CYAN$PR_SHIFT_IN$PR_HBAR\
122
+$PR_SHIFT_IN$PR_HBAR$PR_SHIFT_OUT\
123
+>$PR_NO_COLOUR '
124
+
125
+    # display exitcode on the right when >0
126
+    return_code="%(?..%{$fg[red]%}%? ↵ %{$reset_color%})"
127
+    RPROMPT=' $return_code$PR_CYAN$PR_SHIFT_IN$PR_HBAR$PR_BLUE$PR_HBAR$PR_SHIFT_OUT\
128
+($PR_YELLOW%D{%a,%b%d}$PR_BLUE)$PR_SHIFT_IN$PR_HBAR$PR_CYAN$PR_LRCORNER$PR_SHIFT_OUT$PR_NO_COLOUR'
129
+
130
+    PS2='$PR_CYAN$PR_SHIFT_IN$PR_HBAR$PR_SHIFT_OUT\
131
+$PR_BLUE$PR_SHIFT_IN$PR_HBAR$PR_SHIFT_OUT(\
132
+$PR_LIGHT_GREEN%_$PR_BLUE)$PR_SHIFT_IN$PR_HBAR$PR_SHIFT_OUT\
133
+$PR_CYAN$PR_SHIFT_IN$PR_HBAR$PR_SHIFT_OUT$PR_NO_COLOUR '
134
+}
135
+
136
+setprompt
0 137
new file mode 100644
... ...
@@ -0,0 +1,8 @@
0
+#PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}'
1
+PROMPT="%{$fg_bold[cyan]%}%T%{$fg_bold[green]%} %{$fg_bold[white]%}%n%{$fg[magenta]%}@%{$fg_bold[white]%}%m %{$fg_bold[green]%}%d
2
+%{$fg_bold[yellow]%}%% $(git_prompt_info)%{$reset_color%}"
3
+
4
+#ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$fg[red]%}"
5
+#ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
6
+#ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗%{$reset_color%}"
7
+#ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})"
0 8
new file mode 100644
... ...
@@ -0,0 +1,46 @@
0
+# ------------------------------------------------------------------------
1
+# Juan G. Hurtado oh-my-zsh theme
2
+# (Needs Git plugin for current_branch method)
3
+# ------------------------------------------------------------------------
4
+
5
+# Color shortcuts
6
+RED=$fg[red]
7
+YELLOW=$fg[yellow]
8
+GREEN=$fg[green]
9
+WHITE=$fg[white]
10
+BLUE=$fg[blue]
11
+RED_BOLD=$fg_bold[red]
12
+YELLOW_BOLD=$fg_bold[yellow]
13
+GREEN_BOLD=$fg_bold[green]
14
+WHITE_BOLD=$fg_bold[white]
15
+BLUE_BOLD=$fg_bold[blue]
16
+RESET_COLOR=$reset_color
17
+
18
+# Format for git_prompt_info()
19
+ZSH_THEME_GIT_PROMPT_PREFIX=""
20
+ZSH_THEME_GIT_PROMPT_SUFFIX=""
21
+
22
+# Format for parse_git_dirty()
23
+ZSH_THEME_GIT_PROMPT_DIRTY=" %{$RED%}(*)"
24
+ZSH_THEME_GIT_PROMPT_CLEAN=""
25
+
26
+# Format for git_prompt_status()
27
+ZSH_THEME_GIT_PROMPT_UNMERGED=" %{$RED%}unmerged"
28
+ZSH_THEME_GIT_PROMPT_DELETED=" %{$RED%}deleted"
29
+ZSH_THEME_GIT_PROMPT_RENAMED=" %{$YELLOW%}renamed"
30
+ZSH_THEME_GIT_PROMPT_MODIFIED=" %{$YELLOW%}modified"
31
+ZSH_THEME_GIT_PROMPT_ADDED=" %{$GREEN%}added"
32
+ZSH_THEME_GIT_PROMPT_UNTRACKED=" %{$WHITE%}untracked"
33
+
34
+# Format for git_prompt_ahead()
35
+ZSH_THEME_GIT_PROMPT_AHEAD=" %{$RED%}(!)"
36
+
37
+# Format for git_prompt_long_sha() and git_prompt_short_sha()
38
+ZSH_THEME_GIT_PROMPT_SHA_BEFORE=" %{$WHITE%}[%{$YELLOW%}"
39
+ZSH_THEME_GIT_PROMPT_SHA_AFTER="%{$WHITE%}]"
40
+
41
+# Prompt format
42
+PROMPT='
43
+%{$GREEN_BOLD%}%n@%m%{$WHITE%}:%{$YELLOW%}%~%u$(parse_git_dirty)$(git_prompt_ahead)%{$RESET_COLOR%}
44
+%{$BLUE%}>%{$RESET_COLOR%} '
45
+RPROMPT='%{$GREEN_BOLD%}$(current_branch)$(git_prompt_short_sha)$(git_prompt_status)%{$RESET_COLOR%}'
0 46
\ No newline at end of file
1 47
new file mode 100644
... ...
@@ -0,0 +1,21 @@
0
+autoload -U colors && colors
1
+
2
+autoload -Uz vcs_info
3
+
4
+zstyle ':vcs_info:*' stagedstr '%F{green}●'
5
+zstyle ':vcs_info:*' unstagedstr '%F{yellow}●'
6
+zstyle ':vcs_info:*' check-for-changes true
7
+zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{11}%r'
8
+zstyle ':vcs_info:*' enable git svn
9
+precmd () {
10
+    if [[ -z $(git ls-files --other --exclude-standard 2> /dev/null) ]] {
11
+        zstyle ':vcs_info:*' formats ' [%b%c%u%B%F{green}]'
12
+    } else {
13
+        zstyle ':vcs_info:*' formats ' [%b%c%u%B%F{red}●%F{green}]'
14
+    }
15
+
16
+    vcs_info
17
+}
18
+
19
+setopt prompt_subst
20
+PROMPT='%B%F{magenta}%c%B%F{green}${vcs_info_msg_0_}%B%F{magenta} %{$reset_color%}%% '
0 21
new file mode 100644
... ...
@@ -0,0 +1,50 @@
0
+# ------------------------------------------------------------------------------
1
+#          FILE:  kphoen.zsh-theme
2
+#   DESCRIPTION:  oh-my-zsh theme file.
3
+#        AUTHOR:  Kévin Gomez (geek63@gmail.com)
4
+#       VERSION:  1.0.0
5
+#    SCREENSHOT:
6
+# ------------------------------------------------------------------------------
7
+
8
+
9
+if [[ "$TERM" != "dumb" ]] && [[ "$DISABLE_LS_COLORS" != "true" ]]; then
10
+    PROMPT='[%{$fg[red]%}%n%{$reset_color%}@%{$fg[magenta]%}%m%{$reset_color%}:%{$fg[blue]%}%~%{$reset_color%}$(git_prompt_info)]
11
+%# '
12
+
13
+    ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[green]%}"
14
+    ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
15
+    ZSH_THEME_GIT_PROMPT_DIRTY=""
16
+    ZSH_THEME_GIT_PROMPT_CLEAN=""
17
+
18
+    # display exitcode on the right when >0
19
+    return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
20
+
21
+    RPROMPT='${return_code}$(git_prompt_status)%{$reset_color%}'
22
+
23
+    ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[green]%} ✚"
24
+    ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[blue]%} ✹"
25
+    ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%} ✖"
26
+    ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[magenta]%} ➜"
27
+    ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[yellow]%} ═"
28
+    ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[cyan]%} ✭"
29
+else
30
+    PROMPT='[%n@%m:%~$(git_prompt_info)]
31
+%# '
32
+
33
+    ZSH_THEME_GIT_PROMPT_PREFIX=" on"
34
+    ZSH_THEME_GIT_PROMPT_SUFFIX=""
35
+    ZSH_THEME_GIT_PROMPT_DIRTY=""
36
+    ZSH_THEME_GIT_PROMPT_CLEAN=""
37
+
38
+    # display exitcode on the right when >0
39
+    return_code="%(?..%? ↵)"
40
+
41
+    RPROMPT='${return_code}$(git_prompt_status)'
42
+
43
+    ZSH_THEME_GIT_PROMPT_ADDED=" ✚"
44
+    ZSH_THEME_GIT_PROMPT_MODIFIED=" ✹"
45
+    ZSH_THEME_GIT_PROMPT_DELETED=" ✖"
46
+    ZSH_THEME_GIT_PROMPT_RENAMED=" ➜"
47
+    ZSH_THEME_GIT_PROMPT_UNMERGED=" ═"
48
+    ZSH_THEME_GIT_PROMPT_UNTRACKED=" ✭"
49
+fi
0 50
new file mode 100644
... ...
@@ -0,0 +1,14 @@
0
+local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
1
+local user_host='%{$terminfo[bold]$fg[green]%}%n@%m%{$reset_color%}'
2
+local current_dir='%{$terminfo[bold]$fg[blue]%}%~%{$reset_color%}'
3
+local rvm_ruby='%{$fg[red]%}$(rvm_prompt_info)%{$reset_color%}'
4
+local git_branch='%{$fg[blue]%}$(git_prompt_info)%{$reset_color%}'
5
+
6
+PROMPT="${user_host}:${current_dir} ${rvm_ruby}
7
+${git_branch} %B$%b "
8
+RPS1="${return_code}"
9
+
10
+ZSH_THEME_GIT_PROMPT_PREFIX=""
11
+ZSH_THEME_GIT_PROMPT_SUFFIX=""
12
+ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}✗%{$reset_color%}"
13
+ZSH_THEME_GIT_PROMPT_CLEAN=" %{$fg[green]%}✔%{$reset_color%}"
0 14
new file mode 100644
... ...
@@ -0,0 +1,30 @@
0
+#!/usr/bin/env zsh
1
+#local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
2
+
3
+setopt promptsubst
4
+
5
+autoload -U add-zsh-hook
6
+
7
+PROMPT_SUCCESS_COLOR=$FG[117]
8
+PROMPT_FAILURE_COLOR=$FG[124]
9
+PROMPT_VCS_INFO_COLOR=$FG[242]
10
+PROMPT_PROMPT=$FG[077]
11
+GIT_DIRTY_COLOR=$FG[133]
12
+GIT_CLEAN_COLOR=$FG[118]
13
+GIT_PROMPT_INFO=$FG[012]
14
+
15
+PROMPT='%{$PROMPT_SUCCESS_COLOR%}%~%{$reset_color%} %{$GIT_PROMPT_INFO%}$(git_prompt_info)%{$GIT_DIRTY_COLOR%}$(git_prompt_status) %{$reset_color%}%{$PROMPT_PROMPT%}ᐅ%{$reset_color%} '
16
+
17
+#RPS1="${return_code}"
18
+
19
+ZSH_THEME_GIT_PROMPT_PREFIX="("
20
+ZSH_THEME_GIT_PROMPT_SUFFIX="%{$GIT_PROMPT_INFO%})"
21
+ZSH_THEME_GIT_PROMPT_DIRTY=" %{$GIT_DIRTY_COLOR%}✘"
22
+ZSH_THEME_GIT_PROMPT_CLEAN=" %{$GIT_CLEAN_COLOR%}✔"
23
+
24
+ZSH_THEME_GIT_PROMPT_ADDED="%{$FG[082]%}✚%{$reset_color%}"
25
+ZSH_THEME_GIT_PROMPT_MODIFIED="%{$FG[166]%}✹%{$reset_color%}"
26
+ZSH_THEME_GIT_PROMPT_DELETED="%{$FG[160]%}✖%{$reset_color%}"
27
+ZSH_THEME_GIT_PROMPT_RENAMED="%{$FG[220]%}➜%{$reset_color%}"
28
+ZSH_THEME_GIT_PROMPT_UNMERGED="%{$FG[082]%}═%{$reset_color%}"
29
+ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$FG[190]%}✭%{$reset_color%}"
0 30
new file mode 100644
... ...
@@ -0,0 +1,15 @@
0
+ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[green]%}"
1
+ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
2
+ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}⚡"
3
+ZSH_THEME_GIT_PROMPT_CLEAN=""
4
+
5
+function prompt_char {
6
+	if [ $UID -eq 0 ]; then echo "%{$fg[red]%}#%{$reset_color%}"; else echo $; fi
7
+}
8
+
9
+PROMPT='%(?, ,%{$fg[red]%}FAIL: $?%{$reset_color%}
10
+)
11
+%{$fg[magenta]%}%n%{$reset_color%}@%{$fg[yellow]%}%m%{$reset_color%}: %{$fg_bold[blue]%}%~%{$reset_color%}$(git_prompt_info)
12
+%_$(prompt_char) '
13
+
14
+RPROMPT='%{$fg[green]%}[%*]%{$reset_color%}'
... ...
@@ -25,10 +25,11 @@ then
25 25
     if [ "$line" = Y ] || [ "$line" = y ]
26 26
     then
27 27
       /bin/sh $ZSH/tools/upgrade.sh
28
+      # update the zsh file
29
+      _update_zsh_update
28 30
     fi
29 31
   fi
32
+else
33
+  # create the zsh file
34
+  _update_zsh_update
30 35
 fi
31
-
32
-# update the zsh file
33
-_update_zsh_update
34
-
... ...
@@ -5,7 +5,7 @@ then
5 5
 fi
6 6
 
7 7
 echo "Cloning Oh My Zsh..."
8
-/usr/bin/env git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
8
+/usr/bin/env git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
9 9
 
10 10
 echo "Looking for an existing zsh config..."
11 11
 if [ -f ~/.zshrc ] || [ -h ~/.zshrc ]
... ...
@@ -22,7 +22,7 @@ echo "Copying your current PATH and adding it to the end of ~/.zshrc for you."
22 22
 echo "export PATH=$PATH" >> ~/.zshrc
23 23
 
24 24
 echo "Time to change your default shell to zsh!"
25
-chsh -s "/usr/bin/env zsh"
25
+chsh -s `which zsh`
26 26
 
27 27
 echo '         __                                     __  '
28 28
 echo '  ____  / /_     ____ ___  __  __   ____  _____/ /_ '