68f893cbe05e5a84adf7f26a0ed7492af6e03def
- Author
- NanoTech <nanotech008@gmail.com>
- Committer
- NanoTech <nanotech008@gmail.com>
- Date
Message
Diff
This diff is truncated to protect this page.
1diff --git a/lib/functions.zsh b/lib/functions.zsh
2index 561586cba657cb274f76b6a7a87743e154f006e4..e3c0de43ed8852c672b877177898f27f52af2a02 100644
3--- a/lib/functions.zsh
4+++ b/lib/functions.zsh
5@@ -5,7 +5,7 @@ function title {
6 print -nR $'\033k'$1$'\033'\\\
7
8 print -nR $'\033]0;'$2$'\a'
9- elif [[ $TERM =~ "^xterm" || $TERM == "rxvt" ]]; then
10+ elif [[ ($TERM =~ "^xterm") ]] || [[ ($TERM == "rxvt") ]]; then
11 # Use this one instead for XTerms:
12 print -nR $'\033]0;'$*$'\a'
13 fi
14@@ -37,4 +37,3 @@ function take() {
15 mkdir -p $1
16 cd $1
17 }
18-
19diff --git a/lib/git.zsh b/lib/git.zsh
20index 889dd98dff0f76d07c2ccd7adcbec5bf66c66cff..75fdc1f9c2e90f605d8b99542b3974d848b826a9 100644
21--- a/lib/git.zsh
22+++ b/lib/git.zsh
23@@ -11,3 +11,30 @@ parse_git_dirty () {
24 echo "$ZSH_THEME_GIT_PROMPT_CLEAN"
25 fi
26 }
27+
28+# get the status of the working tree
29+git_prompt_status() {
30+ INDEX=$(git status --porcelain 2> /dev/null)
31+ STATUS=""
32+ if $(echo "$INDEX" | grep '^?? ' &> /dev/null); then
33+ STATUS="$ZSH_THEME_GIT_PROMPT_UNTRACKED$STATUS"
34+ fi
35+ if $(echo "$INDEX" | grep '^A ' &> /dev/null); then
36+ STATUS="$ZSH_THEME_GIT_PROMPT_ADDED$STATUS"
37+ elif $(echo "$INDEX" | grep '^M ' &> /dev/null); then
38+ STATUS="$ZSH_THEME_GIT_PROMPT_ADDED$STATUS"
39+ fi
40+ if $(echo "$INDEX" | grep '^ M ' &> /dev/null); then
41+ STATUS="$ZSH_THEME_GIT_PROMPT_MODIFIED$STATUS"
42+ fi
43+ if $(echo "$INDEX" | grep '^R ' &> /dev/null); then
44+ STATUS="$ZSH_THEME_GIT_PROMPT_RENAMED$STATUS"
45+ fi
46+ if $(echo "$INDEX" | grep '^ D ' &> /dev/null); then
47+ STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS"
48+ fi
49+ if $(echo "$INDEX" | grep '^UU ' &> /dev/null); then
50+ STATUS="$ZSH_THEME_GIT_PROMPT_UNMERGED$STATUS"
51+ fi
52+ echo $STATUS
53+}
54diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh
55index c46aea7ac77eb63f7c59ba2c94083f5d56161a5d..848e48eb5e7002391a4a352c8bd7828a09023998 100644
56--- a/oh-my-zsh.sh
57+++ b/oh-my-zsh.sh
58@@ -12,7 +12,7 @@ for config_file ($ZSH/custom/*.zsh) source $config_file
59
60 # Load all of the plugins that were defined in ~/.zshrc
61 plugin=${plugin:=()}
62-for plugin ($plugins) source $ZSH/plugins/$plugin.plugin.zsh
63+for plugin ($plugins) source $ZSH/plugins/$plugin/$plugin.plugin.zsh
64
65 # Check for updates on initial load...
66 if [ "$DISABLE_AUTO_UPDATE" = "true" ]
67diff --git a/plugins/brew.plugin.zsh b/plugins/brew/_brew
68rename from plugins/brew.plugin.zsh
69rename to plugins/brew/_brew
70index 162eb6442351855f82e0d0bf89e433ace7f4fe1e..4e590ac6302d0196a9b269798ea9f4ded913a05c 100644
71--- a/plugins/brew.plugin.zsh
72+++ b/plugins/brew/_brew
73@@ -1,4 +1,5 @@
74 #compdef brew
75+#autoload
76
77 # imported from the latest homebrew contributions
78
79@@ -65,3 +66,4 @@ case "$words[1]" in
80 _brew_installed_formulae
81 _wanted installed_formulae expl 'installed formulae' compadd -a installed_formulae ;;
82 esac
83+
84diff --git a/plugins/brew/brew.plugin.zsh b/plugins/brew/brew.plugin.zsh
85new file mode 100644
86index 0000000000000000000000000000000000000000..353a18942ac594122f5bfc634fcef3f834d1c665
87--- /dev/null
88+++ b/plugins/brew/brew.plugin.zsh
89@@ -0,0 +1,4 @@
90+# add brew completion function to path
91+fpath=($ZSH/plugins/brew $fpath)
92+autoload -U compinit
93+compinit -i
94diff --git a/plugins/rails.plugin.zsh b/plugins/cap/cap.plugin.zsh
95rename from plugins/rails.plugin.zsh
96rename to plugins/cap/cap.plugin.zsh
97index 45bebb72246f894e7754ef72fdd2e2f62e996e78..a0fa21d005e628888cf73c9f3e4abc56d1a090b1 100644
98--- a/plugins/rails.plugin.zsh
99+++ b/plugins/cap/cap.plugin.zsh
100@@ -1,14 +1,3 @@
101-
102-alias ss='thin --stats "/thin/stats" start'
103-alias sg='ruby script/generate'
104-alias sd='ruby script/destroy'
105-alias sp='ruby script/plugin'
106-alias ssp='ruby script/spec'
107-alias rdbm='rake db:migrate'
108-alias sc='ruby script/console'
109-alias sd='ruby script/server --debugger'
110-alias devlog='tail -f log/development.log'
111-
112 function _cap_does_task_list_need_generating () {
113 if [ ! -f .cap_tasks~ ]; then return 0;
114 else
115@@ -29,8 +18,4 @@ function _cap () {
116 fi
117 }
118
119-compctl -K _cap cap
120-
121-function remote_console() {
122- /usr/bin/env ssh $1 "( cd $2 && ruby script/console production )"
123-}
124+compctl -K _cap cap
125diff --git a/plugins/dirpersist.plugin.zsh b/plugins/dirpersist/dirpersist.plugin.zsh
126rename from plugins/dirpersist.plugin.zsh
127rename to plugins/dirpersist/dirpersist.plugin.zsh
128diff --git a/plugins/gem/_gem b/plugins/gem/_gem
129new file mode 100644
130index 0000000000000000000000000000000000000000..83cba40d135796280447ee6a1daf6c9e73df53de
131--- /dev/null
132+++ b/plugins/gem/_gem
133@@ -0,0 +1,64 @@
134+#compdef gem
135+#autoload
136+
137+# gem zsh completion, based on homebrew completion
138+
139+_gem_installed() {
140+ installed_gems=(`gem list --local --no-versions`)
141+}
142+
143+local -a _1st_arguments
144+_1st_arguments=(
145+ 'cert:Manage RubyGems certificates and signing settings'
146+ 'check:Check installed gems'
147+ 'cleanup:Clean up old versions of installed gems in the local repository'
148+ 'contents:Display the contents of the installed gems'
149+ 'dependency:Show the dependencies of an installed gem'
150+ 'environment:Display information about the RubyGems environment'
151+ 'fetch:Download a gem and place it in the current directory'
152+ 'generate_index:Generates the index files for a gem server directory'
153+ 'help:Provide help on the `gem` command'
154+ 'install:Install a gem into the local repository'
155+ 'list:Display gems whose name starts with STRING'
156+ 'lock:Generate a lockdown list of gems'
157+ 'mirror:Mirror a gem repository'
158+ 'outdated:Display all gems that need updates'
159+ 'owner:Manage gem owners on RubyGems.org.'
160+ 'pristine:Restores installed gems to pristine condition from files located in the gem cache'
161+ 'push:Push a gem up to RubyGems.org'
162+ 'query:Query gem information in local or remote repositories'
163+ 'rdoc:Generates RDoc for pre-installed gems'
164+ 'search:Display all gems whose name contains STRING'
165+ 'server:Documentation and gem repository HTTP server'
166+ 'sources:Manage the sources and cache file RubyGems uses to search for gems'
167+ 'specification:Display gem specification (in yaml)'
168+ 'stale:List gems along with access times'
169+ 'uninstall:Uninstall gems from the local repository'
170+ 'unpack:Unpack an installed gem to the current directory'
171+ 'update:Update the named gems (or all installed gems) in the local repository'
172+ 'which:Find the location of a library file you can require'
173+)
174+
175+local expl
176+local -a gems installed_gems
177+
178+_arguments \
179+ '(-v --version)'{-v,--version}'[show version]' \
180+ '(-h --help)'{-h,--help}'[show help]' \
181+ '*:: :->subcmds' && return 0
182+
183+if (( CURRENT == 1 )); then
184+ _describe -t commands "gem subcommand" _1st_arguments
185+ return
186+fi
187+
188+case "$words[1]" in
189+ list)
190+ if [[ "$state" == forms ]]; then
191+ _gem_installed
192+ _requested installed_gems expl 'installed gems' compadd -a installed_gems
193+ fi ;;
194+ uninstall|update)
195+ _gem_installed
196+ _wanted installed_gems expl 'installed gems' compadd -a installed_gems ;;
197+esac
198diff --git a/plugins/gem/gem.plugin.zsh b/plugins/gem/gem.plugin.zsh
199new file mode 100644
200index 0000000000000000000000000000000000000000..65d3766f34f20c819e29ddba81a86d84f1c3675d
201--- /dev/null
202+++ b/plugins/gem/gem.plugin.zsh
203@@ -0,0 +1,4 @@
204+# add brew completion function to path
205+fpath=($ZSH/plugins/gem $fpath)
206+autoload -U compinit
207+compinit -i
208diff --git a/plugins/git.plugin.zsh b/plugins/git/git.plugin.zsh
209rename from plugins/git.plugin.zsh
210rename to plugins/git/git.plugin.zsh
211index 655eaf728de883e37884ad328b45bc8104d7c53d..d317d179d8ec7bce0ecf600ec237d5c754f47215 100644
212--- a/plugins/git.plugin.zsh
213+++ b/plugins/git/git.plugin.zsh
214@@ -12,7 +12,7 @@ alias gb='git branch'
215 alias gba='git branch -a'
216 alias gcount='git shortlog -sn'
217 alias gcp='git cherry-pick'
218-
219+alias glg='git log --stat --max-count=5'
220
221 # Git and svn mix
222 alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk'
223diff --git a/plugins/github/_github b/plugins/github/_github
224new file mode 100644
225index 0000000000000000000000000000000000000000..83e1713c774f5a6d898e9c3477cf5b11ee305084
226--- /dev/null
227+++ b/plugins/github/_github
228@@ -0,0 +1,40 @@
229+#compdef github
230+#autoload
231+
232+# in order to make this work, you will need to have the github gem installed
233+# http://github.com/defunkt/github-gem
234+
235+# github zsh completion, based on homebrew completion
236+
237+local -a _1st_arguments
238+_1st_arguments=(
239+ 'browse:Open this repo in a web browser'
240+ 'clone:Clone a repo'
241+ 'config:Automatically set configuration info, or pass args to specify'
242+ 'create-from-local:Create a new GitHub repository from the current local repository'
243+ 'create:Create a new empty GitHub repository'
244+ 'fetch:Fetch from a remote to a local branch'
245+ 'fetch_all:Fetch all refs from a user'
246+ 'fork:Forks a GitHub repository'
247+ 'home:Open this repos master branch in a web browser'
248+ 'ignore:Ignore a SHA from github network commits'
249+ 'info:Info about this project'
250+ 'issues:Project issues tools'
251+ 'network:Project network tools - sub-commands : web [user], list, fetch, commits'
252+ 'open:Open the given user/project in a web browser'
253+ 'pull-request:Generate the text for a pull request'
254+ 'pull:Pull from a remote'
255+ 'search:Search GitHub for the given repository name'
256+ 'track:Track another users repository'
257+)
258+
259+local expl
260+local -a pkgs installed_pkgs
261+
262+_arguments \
263+ '*:: :->subcmds' && return 0
264+
265+if (( CURRENT == 1 )); then
266+ _describe -t commands "github subcommand" _1st_arguments
267+ return
268+fi
269diff --git a/plugins/github/github.plugin.zsh b/plugins/github/github.plugin.zsh
270new file mode 100644
271index 0000000000000000000000000000000000000000..c23504b85b464b411c14abcbe9301e9348ebf5f6
272--- /dev/null
273+++ b/plugins/github/github.plugin.zsh
274@@ -0,0 +1,4 @@
275+# add github completion function to path
276+fpath=($ZSH/plugins/github $fpath)
277+autoload -U compinit
278+compinit -i
279diff --git a/plugins/lighthouse.plugin.zsh b/plugins/lighthouse/lighthouse.plugin.zsh
280rename from plugins/lighthouse.plugin.zsh
281rename to plugins/lighthouse/lighthouse.plugin.zsh
282diff --git a/plugins/macports.plugin.zsh b/plugins/macports/macports.plugin.zsh
283rename from plugins/macports.plugin.zsh
284rename to plugins/macports/macports.plugin.zsh
285diff --git a/plugins/mysql-macports.plugin.zsh b/plugins/mysql/mysql-macports.plugin.zsh
286rename from plugins/mysql-macports.plugin.zsh
287rename to plugins/mysql/mysql-macports.plugin.zsh
288diff --git a/plugins/osx.plugin.zsh b/plugins/osx/osx.plugin.zsh
289rename from plugins/osx.plugin.zsh
290rename to plugins/osx/osx.plugin.zsh
291diff --git a/plugins/pip/_pip b/plugins/pip/_pip
292new file mode 100644
293index 0000000000000000000000000000000000000000..b58010173a5028b0dc0db651f042e56df861d497
294--- /dev/null
295+++ b/plugins/pip/_pip
296@@ -0,0 +1,46 @@
297+#compdef pip
298+#autoload
299+
300+# pip zsh completion, based on homebrew completion
301+
302+_pip_installed() {
303+ installed_pkgs=(`pip freeze`)
304+}
305+
306+local -a _1st_arguments
307+_1st_arguments=(
308+ 'bundle:Create pybundles (archives containing multiple packages)'
309+ 'freeze:Output all currently installed packages (exact versions) to stdout'
310+ 'help:Show available commands'
311+ 'install:Install packages'
312+ 'search:Search PyPI'
313+ 'uninstall:Uninstall packages'
314+ 'unzip:Unzip individual packages'
315+ 'zip:Zip individual packages'
316+)
317+
318+local expl
319+local -a pkgs installed_pkgs
320+
321+_arguments \
322+ '(--version)--version[Show version number of program and exit]' \
323+ '(-v --verbose)'{-v,--verbose}'[Give more output]' \
324+ '(-q --quiet)'{-q,--quiet}'[Give less output]' \
325+ '(-h --help)'{-h,--help}'[Show help]' \
326+ '*:: :->subcmds' && return 0
327+
328+if (( CURRENT == 1 )); then
329+ _describe -t commands "pip subcommand" _1st_arguments
330+ return
331+fi
332+
333+case "$words[1]" in
334+ list)
335+ if [[ "$state" == forms ]]; then
336+ _pip_installed
337+ _requested installed_pkgs expl 'installed packages' compadd -a installed_pkgs
338+ fi ;;
339+ uninstall)
340+ _pip_installed
341+ _wanted installed_pkgs expl 'installed packages' compadd -a installed_pkgs ;;
342+esac
343diff --git a/plugins/pip/pip.plugin.zsh b/plugins/pip/pip.plugin.zsh
344new file mode 100644
345index 0000000000000000000000000000000000000000..bf9f2396885713e6eb409342090be6c9790e3171
346--- /dev/null
347+++ b/plugins/pip/pip.plugin.zsh
348@@ -0,0 +1,4 @@
349+# add brew completion function to path
350+fpath=($ZSH/plugins/pip $fpath)
351+autoload -U compinit
352+compinit -i
353diff --git a/plugins/rails/rails.plugin.zsh b/plugins/rails/rails.plugin.zsh
354new file mode 100644
355index 0000000000000000000000000000000000000000..ac8119e837611d4a19ea146a8e7c4242a8982922
356--- /dev/null
357+++ b/plugins/rails/rails.plugin.zsh
358@@ -0,0 +1,13 @@
359+alias ss='thin --stats "/thin/stats" start'
360+alias sg='ruby script/generate'
361+alias sd='ruby script/destroy'
362+alias sp='ruby script/plugin'
363+alias ssp='ruby script/spec'
364+alias rdbm='rake db:migrate'
365+alias sc='ruby script/console'
366+alias sd='ruby script/server --debugger'
367+alias devlog='tail -f log/development.log'
368+
369+function remote_console() {
370+ /usr/bin/env ssh $1 "( cd $2 && ruby script/console production )"
371+}
372diff --git a/plugins/ruby.plugin.zsh b/plugins/ruby/ruby.plugin.zsh
373rename from plugins/ruby.plugin.zsh
374rename to plugins/ruby/ruby.plugin.zsh
375diff --git a/plugins/ssh-agent.plugin.zsh b/plugins/ssh-agent/ssh-agent.plugin.zsh
376rename from plugins/ssh-agent.plugin.zsh
377rename to plugins/ssh-agent/ssh-agent.plugin.zsh
378diff --git a/plugins/textmate.plugin.zsh b/plugins/textmate/textmate.plugin.zsh
379rename from plugins/textmate.plugin.zsh
380rename to plugins/textmate/textmate.plugin.zsh
381diff --git a/plugins/vi-mode.plugin.zsh b/plugins/vi-mode/vi-mode.plugin.zsh
382rename from plugins/vi-mode.plugin.zsh
383rename to plugins/vi-mode/vi-mode.plugin.zsh
384diff --git a/themes/cloud.zsh-theme b/themes/cloud.zsh-theme
385new file mode 100644
386index 0000000000000000000000000000000000000000..ad5e2834b832938faa4b0a8f12cb060e849cff64
387--- /dev/null
388+++ b/themes/cloud.zsh-theme
389@@ -0,0 +1,6 @@
390+PROMPT='%{$fg_bold[cyan]%}☁ %{$fg_bold[green]%}%p %{$fg[green]%}%c %{$fg_bold[cyan]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}'
391+
392+ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}[%{$fg[cyan]%}"
393+ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
394+ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%}] %{$fg[yellow]%}⚡%{$reset_color%}"
395+ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%}]"
396diff --git a/themes/gozilla.zsh-theme b/themes/gozilla.zsh-theme
397new file mode 100644
398index 0000000000000000000000000000000000000000..c6b752e9b400f9ce2ff8942c937822e62306f164
399--- /dev/null
400+++ b/themes/gozilla.zsh-theme
401@@ -0,0 +1,15 @@
402+PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}'
403+
404+ZSH_THEME_GIT_PROMPT_PREFIX="("
405+ZSH_THEME_GIT_PROMPT_SUFFIX=")"
406+ZSH_THEME_GIT_PROMPT_DIRTY=""
407+ZSH_THEME_GIT_PROMPT_CLEAN=""
408+
409+RPROMPT='$(git_prompt_status)%{$reset_color%}'
410+
411+ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[cyan]%} ✈"
412+ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[yellow]%} ✭"
413+ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%} ✗"
414+ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[blue]%} ➦"
415+ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[magenta]%} ✂"
416+ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[grey]%} ✱"
417diff --git a/themes/lukerandall.zsh-theme b/themes/lukerandall.zsh-theme
418new file mode 100644
419index 0000000000000000000000000000000000000000..24a0612b72b9fa8bb3813ab3d1c9edb493bcb9aa
420--- /dev/null
421+++ b/themes/lukerandall.zsh-theme
422@@ -0,0 +1,10 @@
423+# ZSH Theme - Preview: http://cl.ly/f701d00760f8059e06dc
424+# Thanks to gallifrey, upon whose theme this is based
425+
426+local return_code="%(?..%{$fg_bold[red]%}%? ↵%{$reset_color%})"
427+
428+PROMPT='%{$fg_bold[green]%}%n@%m%{$reset_color%} %{$fg_bold[blue]%}%2~%{$reset_color%} $(git_prompt_info)%{$reset_color%}%B»%b '
429+RPS1="${return_code}"
430+
431+ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}("
432+ZSH_THEME_GIT_PROMPT_SUFFIX=") %{$reset_color%}"
433diff --git a/themes/philips.zsh-theme b/themes/philips.zsh-theme
434new file mode 100644
435index 0000000000000000000000000000000000000000..fa7c590355a2a1fcd8b7c4d87ad19e9f234be2eb
436--- /dev/null
437+++ b/themes/philips.zsh-theme
438@@ -0,0 +1,14 @@
439+if [ "$(whoami)" = "root" ]; then NCOLOR="red"; else NCOLOR="green"; fi
440+
441+PROMPT='%{$fg[$NCOLOR]%}%B%n%b%{$reset_color%}:%{$fg[blue]%}%B%c/%b%{$reset_color%} $(git_prompt_info)%(!.#.$) '
442+RPROMPT='[%*]'
443+
444+# git theming
445+ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}(%{$fg_no_bold[red]%}%B"
446+ZSH_THEME_GIT_PROMPT_SUFFIX="%b%{$fg_bold[blue]%})%{$reset_color%} "
447+ZSH_THEME_GIT_PROMPT_CLEAN=""
448+ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[red]%}"
449+
450+# LS colors, made with http://geoff.greer.fm/lscolors/
451+export LSCOLORS="Gxfxcxdxbxegedabagacad"