dc76c5694dda120fcac02b2d75ef0a149de94a2f
- Author
- Pat Regan <thehead@patshead.com>
- Committer
- Pat Regan <thehead@patshead.com>
- Date
Message
Diff
This diff is truncated to protect this page.
1diff --git a/plugins/brew/_brew b/plugins/brew/_brew
2index 4e590ac6302d0196a9b269798ea9f4ded913a05c..cee1e25f0bdbaae3808392f6bc678e22f653ec80 100644
3--- a/plugins/brew/_brew
4+++ b/plugins/brew/_brew
5@@ -31,6 +31,7 @@ _1st_arguments=(
6 'search:search for a formula (/regex/ or string)'
7 'unlink:unlink a formula'
8 'update:freshen up links'
9+ 'upgrade:upgrade outdated formulae'
10 'uses:show formulas which depend on a formula'
11 )
12
13diff --git a/plugins/mysql-macports/mysql-macports.plugin.zsh b/plugins/mysql-macports/mysql-macports.plugin.zsh
14new file mode 100644
15index 0000000000000000000000000000000000000000..c39563fe49c0cbc81dd7eb9ca8feeb5bc54a3da0
16--- /dev/null
17+++ b/plugins/mysql-macports/mysql-macports.plugin.zsh
18@@ -0,0 +1,8 @@
19+# commands to control local mysql-server installation
20+# paths are for osx installation via macports
21+
22+alias mysqlstart='sudo /opt/local/share/mysql5/mysql/mysql.server start'
23+alias mysqlstop='sudo /opt/local/share/mysql5/mysql/mysql.server stop'
24+alias mysqlrestart='sudo /opt/local/share/mysql5/mysql/mysql.server restart'
25+
26+alias mysqlstatus='mysqladmin5 -u root -p ping'
27diff --git a/plugins/mysql/mysql-macports.plugin.zsh b/plugins/mysql/mysql-macports.plugin.zsh
28deleted file mode 100644
29index 63b881c9f5b74f8f11770b20fe40749add1f23ae..0000000000000000000000000000000000000000
30--- a/plugins/mysql/mysql-macports.plugin.zsh
31+++ /dev/null
32@@ -1,6 +0,0 @@
33-# commands to control local mysql-server installation
34-# paths are for osx installtion via macports
35-
36-alias mysqlstart='sudo /opt/local/bin/mysqld_safe5'
37-alias mysqlstop='/opt/local/bin/mysqladmin5 -u root -p shutdown'
38-alias mysqlstatus='mysqladmin5 -u root -p ping'
39diff --git a/plugins/redis-cli/_redis-cli b/plugins/redis-cli/_redis-cli
40new file mode 100644
41index 0000000000000000000000000000000000000000..3789add182d2dd0283cf54ccece4f59a04513ac1
42--- /dev/null
43+++ b/plugins/redis-cli/_redis-cli
44@@ -0,0 +1,142 @@
45+#compdef redis-cli rec
46+#autoload
47+
48+#redis cli completion, based off homebrew completion (ref. 2011-04-14)
49+
50+local -a _1st_arguments
51+_1st_arguments=(
52+ 'append:append a value to a key'
53+ 'auth:authenticate to the server'
54+ 'bgrewriteeaof:asynchronously rewrite the append-only file'
55+ 'bgsave:asynchornously save the dataset to disk'
56+ 'blpop:remove and get the first element in a list, or block until one is available'
57+ 'brpop:remove and get the last element in a list, or block until one is available'
58+ 'brpoplpush:pop a value from a list, push it to another list and return it; or block until one is available'
59+ # 'config get:get the value of a configuration parameter'
60+ # 'config set:set a configuration parameter to the given value'
61+ # 'config resetstat: reset the stats returned by INFO'
62+ 'dbsize:return the number of keys in the selected database'
63+ # 'debug object:get debugging information about a key'
64+ # 'debug setgfault:make the server crash'
65+ 'decr:decrement the integer value of a key by one'
66+ 'decrby:decrement the integet value of a key by the given number'
67+ 'del:delete a key'
68+ 'discard:discard all commands issued after MULTI'
69+ 'echo:echo the given string'
70+ 'exec:execute all commands issued after a MULTI'
71+ 'exists:determine if a key exists'
72+ 'expire:set the time to live for a key, in seconds'
73+ 'expireat:set the expiration for a key as a UNIX timestamp'
74+ 'flushall:remove all keys from all databases'
75+ 'flushdb:remove all keys from the current database'
76+ 'get:get the value of a key'
77+ 'getbit:returns the bit value at offset in the string value stored at key'
78+ 'getrange:get a substring of the string stored at a key'
79+ 'getset:set the string value of a key and return its old value'
80+ 'hdel:delete a hash field'
81+ 'hexists:determine if a hash field exists'
82+ 'hget:get the value of a hash field'
83+ 'hgetall:get all the fields and values in a hash'
84+ 'hincrby:increment the integer value of a hash field by the given number'
85+ 'hkeys:get all the fields in a hash'
86+ 'hlen:get the number of fields in a hash'
87+ 'hmget:get the values of all the given hash fields'
88+ 'hmset:set multiple hash fields to multiple values'
89+ 'hset:set the string value of a hash field'
90+ 'hsetnx:set the value of a hash field, only if the field does not exist'
91+ 'hvals:get all the values in a hash'
92+ 'incr:increment the integer value of a key by one'
93+ 'incrby:increment the integer value of a key by the given number'
94+ 'info:get information and statistics about the server'
95+ 'keys:find all keys matching the given pattern'
96+ 'lastsave:get the UNIX timestamp of the last successful save to disk'
97+ 'lindex:get an element from a list by its index'
98+ 'linset:insert an element before or after another element in a list'
99+ 'llen:get the length of a list'
100+ 'lpop:remove and get the first element in a list'
101+ 'lpush:prepend a value to a list'
102+ 'lpushx:prepend a value to a list, only if the list exists'
103+ 'lrange:get a range of elements from a list'
104+ 'lrem:remove elements from a list'
105+ 'lset:set the value of an element in a list by its index'
106+ 'ltrim:trim a list to the specified range'
107+ 'mget:get the values of all the given keys'
108+ 'monitor:listen for all requests received by the server in real time'
109+ 'move:move a key to another database'
110+ 'mset:set multiple keys to muliple values'
111+ 'msetnx:set multiple keys tom ultiple values, only if none of the keys exist'
112+ 'multi:mark the start of a transaction block'
113+ 'object:inspect the internals of Redis objects'
114+ 'persist:remove the expiration from a key'
115+ 'ping:ping the server'
116+ 'psubscribe:listen for messages published to channels matching the given patterns'
117+ 'publish:post a message to a channel'
118+ 'punsubscribe:stop listening for messages posted to channels matching the given patterns'
119+ 'quit:close the connection'
120+ 'randomkey:return a random key from the keyspace'
121+ 'rename:rename a key'
122+ 'renamenx:rename a key, only if the new key does not exist'
123+ 'rpop:remove and get the last element in a list'
124+ 'rpoplpush:remove the last element in a list, append it to another list and return it'
125+ 'rpush:append a value to a list'
126+ 'rpushx:append a value to a list, only if the list exists'
127+ 'sadd:add a member to a set'
128+ 'save:synchronously save the dataset to disk'
129+ 'scard:get the number of members in a set'
130+ 'sdiff:subtract multiple sets'
131+ 'sdiffstore:subtract multiple sets and store the resulting set in a key'
132+ 'select:change the selected database for the current connection'
133+ 'set:set the string value of a key'
134+ 'setbit:sets or clears the bit at offset in the string value stored at key'
135+ 'setex:set the value and expiration of a key'
136+ 'setnx:set the value of a key, only if the key does not exist'
137+ 'setrange:overwrite part of a string at key starting at the specified offset'
138+ 'shutdown:synchronously save the dataset to disk and then shut down the server'
139+ 'sinter:intersect multiple sets'
140+ 'sinterstore:intersect multiple sets and store the resulting set in a key'
141+ 'sismember:determine if a given value is a member of a set'
142+ 'slaveof:make the server a slave of another instance, or promote it as master'
143+ 'smembers:get all the members in a set'
144diff --git a/plugins/redis-cli/redis-cli.plugin.zsh b/plugins/redis-cli/redis-cli.plugin.zsh
145new file mode 100644
146index 0000000000000000000000000000000000000000..af5a843c98e413038cf03af86d2a387fdcc9cf2d
147--- /dev/null
148+++ b/plugins/redis-cli/redis-cli.plugin.zsh
149@@ -0,0 +1,4 @@
150+# add redis completion function to path
151+fpath=($ZSH/plugins/redis-cli $fpath)
152+autoload -U compinit
153+compinit -i
154diff --git a/plugins/yum/yum.plugin.zsh b/plugins/yum/yum.plugin.zsh
155new file mode 100644
156index 0000000000000000000000000000000000000000..d6ba7ed62c91fb9aac9c71e4a0fcbb35aa10cf37
157--- /dev/null
158+++ b/plugins/yum/yum.plugin.zsh
159@@ -0,0 +1,12 @@
160+## Aliases
161+
162+alias ys="yum search" # search package
163+alias yp="yum info" # show package info
164+alias yl="yum list" # list packages
165+alias yli="yum list installed" # print all installed packages
166+
167+alias yu="sudo yum update" # upgrate packages
168+alias yi="sudo yum install" # install package
169+alias yr="sudo yum remove" # remove package
170+alias yrl="sudo yum remove --remove-leaves" # remove package and leaves
171+alias yc="sudo yum clean all" # clean cache
172diff --git a/themes/Soliah.zsh-theme b/themes/Soliah.zsh-theme
173index 1c0ab3cc971e9633b7c42f32e118f0977d30375b..237e70fda314cc6ac047ebfbde7c38b2c641f8c3 100644
174--- a/themes/Soliah.zsh-theme
175+++ b/themes/Soliah.zsh-theme
176@@ -1,4 +1,4 @@
177-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)
178+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)
179 $ '
180
181 ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[white]%}"
182@@ -16,6 +16,29 @@ ZSH_THEME_GIT_TIME_SHORT_COMMIT_MEDIUM="%{$fg[yellow]%}"
183 ZSH_THEME_GIT_TIME_SINCE_COMMIT_LONG="%{$fg[red]%}"
184 ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL="%{$fg[cyan]%}"
185
186+
187+# Git sometimes goes into a detached head state. git_prompt_info doesn't
188+# return anything in this case. So wrap it in another function and check
189+# for an empty string.
190+function check_git_prompt_info() {
191+ if git rev-parse --git-dir > /dev/null 2>&1; then
192+ if [[ -z $(git_prompt_info) ]]; then
193+ echo "%{$fg[magenta]%}detached-head%{$reset_color%})"
194+ else
195+ echo "$(git_prompt_info)"
196+ fi
197+ fi
198+}
199+
200+# Determine if we are using a gemset.
201+function rvm_gemset() {
202+ GEMSET=`rvm gemset list | grep '=>' | cut -b4-`
203+ if [[ -n $GEMSET ]]; then
204+ echo "%{$fg[yellow]%}$GEMSET%{$reset_color%}|"
205+ fi
206+
207+}
208+
209 # Determine the time since last commit. If branch is clean,
210 # use a neutral color, otherwise colors will vary according to time.
211 function git_time_since_commit() {
212@@ -49,15 +72,15 @@ function git_time_since_commit() {
213 fi
214
215 if [ "$HOURS" -gt 24 ]; then
216- echo "($COLOR${DAYS}d${SUB_HOURS}h${SUB_MINUTES}m%{$reset_color%}|"
217+ echo "($(rvm_gemset)$COLOR${DAYS}d${SUB_HOURS}h${SUB_MINUTES}m%{$reset_color%}|"
218 elif [ "$MINUTES" -gt 60 ]; then
219- echo "($COLOR${HOURS}h${SUB_MINUTES}m%{$reset_color%}|"
220+ echo "($(rvm_gemset)$COLOR${HOURS}h${SUB_MINUTES}m%{$reset_color%}|"
221 else
222- echo "($COLOR${MINUTES}m%{$reset_color%}|"
223+ echo "($(rvm_gemset)$COLOR${MINUTES}m%{$reset_color%}|"
224 fi
225 else
226 COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL"
227- echo "($COLOR~|"
228+ echo "($(rvm_gemset)$COLOR~|"
229 fi
230 fi
231 }
232diff --git a/themes/dogenpunk.zsh-theme b/themes/dogenpunk.zsh-theme
233new file mode 100644
234index 0000000000000000000000000000000000000000..f4d65ab742781e1242fb5ca5ffaaf23fe6643c86
235--- /dev/null
236+++ b/themes/dogenpunk.zsh-theme
237@@ -0,0 +1,85 @@
238+# -----------------------------------------------------------------------------
239+# FILE: dogenpunk.zsh-theme
240+# DESCRIPTION: oh-my-zsh theme file.
241+# AUTHOR: Matthew Nelson (dogenpunk@gmail.com)
242+# VERSION: 0.1
243+# SCREENSHOT: coming soon
244+# -----------------------------------------------------------------------------
245+
246+MODE_INDICATOR="%{$fg_bold[red]%}❮%{$reset_color%}%{$fg[red]%}❮❮%{$reset_color%}"
247+local return_status="%{$fg[red]%}%(?..⏎)%{$reset_color%}"
248+
249+PROMPT='%{$fg[blue]%}%m%{$reset_color%}%{$fg_bold[white]%} ओम् %{$reset_color%}%{$fg[cyan]%}%~:%{$reset_color%}$(git_time_since_commit)$(git_prompt_info)
250+%{$fg[red]%}%!%{$reset_color%} $(prompt_char) '
251+
252+ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[green]%}git%{$reset_color%}@%{$bg[white]%}%{$fg[black]%}"
253+ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%})"
254+ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}!%{$reset_color%}"
255+ZSH_THEME_GIT_PROMPT_CLEAN=""
256+
257+RPROMPT='${return_status}$(git_prompt_status)%{$reset_color%}'
258+
259+ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[green]%} ✚"
260+ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[blue]%} ✹"
261+ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%} ✖"
262+ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[magenta]%} ➜"
263+ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[yellow]%} ═"
264+ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[cyan]%} ✭"
265+
266+function prompt_char() {
267+ git branch >/dev/null 2>/dev/null && echo "%{$fg[green]%}±%{$reset_color%}" && return
268+ hg root >/dev/null 2>/dev/null && echo "%{$fg_bold[red]%}☿%{$reset_color%}" && return
269+ echo "%{$fg[cyan]%}◯ %{$reset_color%}"
270+}
271+
272+# Colors vary depending on time lapsed.
273+ZSH_THEME_GIT_TIME_SINCE_COMMIT_SHORT="%{$fg[green]%}"
274+ZSH_THEME_GIT_TIME_SHORT_COMMIT_MEDIUM="%{$fg[yellow]%}"
275+ZSH_THEME_GIT_TIME_SINCE_COMMIT_LONG="%{$fg[red]%}"
276+ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL="%{$fg[cyan]%}"
277+
278+# Determine the time since last commit. If branch is clean,
279+# use a neutral color, otherwise colors will vary according to time.
280+function git_time_since_commit() {
281+ if git rev-parse --git-dir > /dev/null 2>&1; then
282+ # Only proceed if there is actually a commit.
283+ if [[ $(git log 2>&1 > /dev/null | grep -c "^fatal: bad default revision") == 0 ]]; then
284+ # Get the last commit.
285+ last_commit=`git log --pretty=format:'%at' -1 2> /dev/null`
286+ now=`date +%s`
287+ seconds_since_last_commit=$((now-last_commit))
288+
289+ # Totals
290+ MINUTES=$((seconds_since_last_commit / 60))
291+ HOURS=$((seconds_since_last_commit/3600))
292+
293+ # Sub-hours and sub-minutes
294+ DAYS=$((seconds_since_last_commit / 86400))
295+ SUB_HOURS=$((HOURS % 24))
296+ SUB_MINUTES=$((MINUTES % 60))
297+
298+ if [[ -n $(git status -s 2> /dev/null) ]]; then
299+ if [ "$MINUTES" -gt 30 ]; then
300+ COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_LONG"
301+ elif [ "$MINUTES" -gt 10 ]; then
302+ COLOR="$ZSH_THEME_GIT_TIME_SHORT_COMMIT_MEDIUM"
303+ else
304+ COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_SHORT"
305+ fi
306+ else
307+ COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL"
308+ fi
309+
310+ if [ "$HOURS" -gt 24 ]; then
311+ echo "($COLOR${DAYS}d${SUB_HOURS}h${SUB_MINUTES}m%{$reset_color%}|"
312+ elif [ "$MINUTES" -gt 60 ]; then
313+ echo "($COLOR${HOURS}h${SUB_MINUTES}m%{$reset_color%}|"
314+ else
315+ echo "($COLOR${MINUTES}m%{$reset_color%}|"
316+ fi
317+ else
318+ COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL"
319+ echo "($COLOR~|"
320+ fi
321+ fi
322+}
323diff --git a/themes/gallois.zsh-theme b/themes/gallois.zsh-theme
324new file mode 100644
325index 0000000000000000000000000000000000000000..259640ba40cdee547cc8826126dae6f9e4a9d748
326--- /dev/null
327+++ b/themes/gallois.zsh-theme
328@@ -0,0 +1,19 @@
329+ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[green]%}["
330+ZSH_THEME_GIT_PROMPT_SUFFIX="]%{$reset_color%}"
331+ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}*%{$reset_color%}"
332+ZSH_THEME_GIT_PROMPT_CLEAN=""
333+
334+#Customized git status, oh-my-zsh currently does not allow render dirty status before branch
335+git_custom_status() {
336+ local cb=$(current_branch)
337+ if [ -n "$cb" ]; then
338+ echo "$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_PREFIX$(current_branch)$ZSH_THEME_GIT_PROMPT_SUFFIX"
339+ fi
340+}
341+
342+#RVM and git settings
343+if [[ -s ~/.rvm/scripts/rvm ]] ; then
344+ RPS1='$(git_custom_status)%{$fg[red]%}[`~/.rvm/bin/rvm-prompt`]%{$reset_color%} $EPS1'
345+fi
346+
347+PROMPT='%{$fg[cyan]%}[%~% ]%(?.%{$fg[green]%}.%{$fg[red]%})%B$%b '
348diff --git a/themes/murilasso.zsh-theme b/themes/murilasso.zsh-theme
349new file mode 100644
350index 0000000000000000000000000000000000000000..310357b4586efe5b43594277c7ee88f48a2f7152
351--- /dev/null
352+++ b/themes/murilasso.zsh-theme
353@@ -0,0 +1,14 @@
354+local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
355+local user_host='%{$terminfo[bold]$fg[green]%}%n@%m%{$reset_color%}'
356+local current_dir='%{$terminfo[bold]$fg[blue]%}%~%{$reset_color%}'
357+local rvm_ruby='%{$fg[red]%}$(rvm_prompt_info)%{$reset_color%}'
358+local git_branch='%{$fg[blue]%}$(git_prompt_info)%{$reset_color%}'
359+
360+PROMPT="${user_host}:${current_dir} ${rvm_ruby}
361+${git_branch} %B$%b "
362+RPS1="${return_code}"
363+
364+ZSH_THEME_GIT_PROMPT_PREFIX=""
365+ZSH_THEME_GIT_PROMPT_SUFFIX=""
366+ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}✗%{$reset_color%}"
367+ZSH_THEME_GIT_PROMPT_CLEAN=" %{$fg[green]%}✔%{$reset_color%}"
368diff --git a/tools/install.sh b/tools/install.sh
369index 6e3872bb9ef24466ff32e67013128a61eae13679..8ed1403af12109c0dd23051e41c4acf353501fcf 100755
370--- a/tools/install.sh
371+++ b/tools/install.sh
372@@ -5,7 +5,7 @@ then
373 fi
374
375 echo "Cloning Oh My Zsh..."
376-/usr/bin/env git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
377+/usr/bin/env git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
378
379 echo "Looking for an existing zsh config..."
380 if [ -f ~/.zshrc ] || [ -h ~/.zshrc ]
381@@ -22,7 +22,7 @@ echo "Copying your current PATH and adding it to the end of ~/.zshrc for you."
382 echo "export PATH=$PATH" >> ~/.zshrc
383
384 echo "Time to change your default shell to zsh!"
385-chsh -s "/usr/bin/env zsh"
386+chsh -s `which zsh`
387
388 echo ' __ __ '
389 echo ' ____ / /_ ____ ___ __ __ ____ _____/ /_ '