6c13721f553140d6cb136377c51eb55a281c5f17
- Author
- James Smith <james@loopj.com>
- Committer
- James Smith <james@loopj.com>
- Date
Message
Diff
This diff is truncated to protect this page.
1diff --git a/plugins/laravel/_artisan b/plugins/laravel/_artisan
2new file mode 100644
3index 0000000000000000000000000000000000000000..8637514cfe97ccf0ce40d208b46c68ebbb8f86bb
4--- /dev/null
5+++ b/plugins/laravel/_artisan
6@@ -0,0 +1,40 @@
7+#compdef artisan
8+
9+# Laravel autocompletion
10+# Author: John Hamelink <john@johnhamelink.com>
11+#
12+# This plugin does the following:
13+# - Adds aliases and autocompletion for artisan
14+# - Adds aliases and autocompletion for bob
15+
16+local curcontext="$curcontext" state line _opts _bundles ret=1
17+_arguments -C \
18+ '1: :->cmds' \
19+ '*:: :->args' && ret=0
20+
21+case $state in
22+ cmds)
23+
24+ _values "Artisan command" \
25+ 'session\:install[Create a session table]' \
26+ 'migrate[Manage Migrations]' \
27+ 'test[Run a test]' \
28+ 'route\:\:call[Call a route in the CLI]' \
29+ 'key\:\:generate[Generate a key]'
30+ ret=0
31+ ;;
32+ args)
33+ case $line[1] in
34+ migrate)
35+ _values \
36+ 'install[Create the Laravel migration table' \
37+ 'make[Create a migration]' \
38+ 'rollback[Roll back to the last migration operation]' \
39+ 'reset[Roll back all migrations that have ever run]'
40+ ret=0
41+ ;;
42+ esac
43+ ;;
44+esac
45+
46+return ret
47diff --git a/plugins/laravel/laravel.plugin.zsh b/plugins/laravel/laravel.plugin.zsh
48new file mode 100644
49index 0000000000000000000000000000000000000000..ed932ee89fae5965f74bdad6cd65a18cfa696640
50--- /dev/null
51+++ b/plugins/laravel/laravel.plugin.zsh
52@@ -0,0 +1,3 @@
53+#!zsh
54+alias artisan='php artisan'
55+alias bob='php artisan bob::build'
56diff --git a/plugins/supervisor/_supervisorctl b/plugins/supervisor/_supervisorctl
57new file mode 100644
58index 0000000000000000000000000000000000000000..d159f20e07f9a384e47e4cc16b78cce80aeeeef6
59--- /dev/null
60+++ b/plugins/supervisor/_supervisorctl
61@@ -0,0 +1,136 @@
62+#compdef supervisorctl
63+
64+typeset -A opt_args
65+local context state line
66+
67+_supervisorctl() {
68+ _arguments -s -S \
69+ {--configuration,-c}"[configuration file path (default /etc/supervisor.conf)]:FILENAME:_files" \
70+ {--help,-h}"[print usage message and exit]:" \
71+ {--interactive,-i}"[start an interactive shell after executing commands]" \
72+ {--serverurl,-s}"[URL on which supervisord server is listening (default "http://localhost:9001").]" \
73+ {--username,-u}"[username to use for authentication with server]:USERNAME:_users" \
74+ {--password,-p}"[password to use for authentication with server]:PASSWORD:" \
75+ {--history-file,-r}"[keep a readline history (if readline is available)]:FILENAME:_files" \
76+ "*::supervisorctl commands:_supervisorctl_command"
77+}
78+
79+(( $+functions[_supervisorctl_command] )) ||
80+_supervisorctl_command() {
81+ local cmd ret=1
82+
83+ (( $+supervisorctl_cmds )) || _supervisorctl_cmds=(
84+ "add:Activates any updates in config for process/group" \
85+ "avail:Display all configured processes" \
86+ "clear:Clear process/multiple-process/all-process log files" \
87+ "exit:Exit the supervisor shell." \
88+ "fg:Connect to a process in foreground mode" \
89+ "maintail:tail of supervisor main log file" \
90+ "open:Connect to a remote supervisord process. (for UNIX domain socket, use unix:///socket/path)" \
91+ "pid:Get the PID of supervisord." \
92+ "quit:Exit the supervisor shell." \
93+ "reload:Restart the remote supervisord." \
94+ "remove:Removes process/group from active config" \
95+ "reread:Reload the daemon's configuration files" \
96+ "restart:Restart process or group." \
97+ "shutdown:Shut the remote supervisord down." \
98+ "start:Start process or groups." \
99+ "status:Get process status info." \
100+ "stop:Stop process or group." \
101+ "tail:tail of process stdout" \
102+ "update:Reload config and add/remove as necessary" \
103+ "version:Show the version of the remote supervisord process" \
104+ "help:Show help" \
105+ )
106+
107+ if (( CURRENT == 1 )); then
108+ _describe -t commands 'supervisorctl subcommand' _supervisorctl_cmds \
109+ || compadd "$@" - ${(s.:.)${(j.:.)_supervisorctl_syns}}
110+ else
111+ local curcontext="$curcontext"
112+
113+ cmd="${${_supervisorctl_cmds[(r)$words[1]:*]%%:*}:-${(k)_supervisorctl_syns[(r)(*:|)$words[1](:*|)]}}"
114+ if (( $#cmd )); then
115+ curcontext="${curcontext%:*:*}:supervisorctl-${cmd}:"
116+ _call_function ret _supervisorctl_$cmd || _message 'no more arguments'
117+ else
118+ _message "unknown supervisorctl command: $words[1]"
119+ fi
120+ return ret
121+ fi
122+}
123+
124+# get supervisor contoroll processes
125+(( $+functions[_get_supervisor_procs] )) ||
126+_get_supervisor_procs() {
127+ local cache_policy
128+ zstyle -s ":completion:${curcontext}:" cache-policy cache_policy
129+ if [[ -z "$cache_policy" ]]; then
130+ zstyle ":completion:${curcontext}:" cache-policy _supervisor_procs_caching_policy
131+ fi
132+
133+ if ( [[ ${+_supervisor_procs} -eq 0 ]] || _cache_invalid supervisor_procs ) \
134+ && ! _retrieve_cache supervisor_procs; then
135+
136+ _supervisor_procs=(${${(f)"$(supervisorctl status >/dev/null 2>&1 | awk -F' ' '{print $1}')"}})
137+ _store_cache supervisor_procs _supervisor_procs
138+ fi
139+
140+ local expl
141+ _wanted supervisor_procs expl 'supervisor processes' compadd -a _supervisor_procs
142+}
143+
144+_supervisor_procs_caching_policy() {
145+ local -a oldp
146+ oldp=( "$1"(Nmw+1) )
147+ (( $#oldp ))
148+}
149+
150+(( $+functions[_supervisorctl_add] )) ||
151+_supervisorctl_add() {
152+ _arguments -s \
153+ "--help[use help system]" \
154+ "*::supervisorctl commands:_supervisorctl"
155+}
156+
157+(( $+functions[_supervisorctl_help] )) ||
158+_supervisorctl_help() {
159+ _arguments -s \
160+ "*:supervisorctl commands:_supervisorctl"
161diff --git a/plugins/supervisor/_supervisord b/plugins/supervisor/_supervisord
162new file mode 100644
163index 0000000000000000000000000000000000000000..34d27805dd1f9d1d3444786073c93e86c44eda31
164--- /dev/null
165+++ b/plugins/supervisor/_supervisord
166@@ -0,0 +1,32 @@
167+#compdef supervisord
168+
169+typeset -A opt_args
170+local context state line
171+
172+_arguments \
173+ {--configuration,-c}"[configuration file]:FILENAME:_files" \
174+ {--nodaemon,-n}"[run in the foreground (same as 'nodaemon true' in config file)]" \
175+ {--help,-h}"[print this usage message and exit]:" \
176+ {--user,-u}"[run supervisord as this user]:USER:_users" \
177+ {--umask,-m}"[use this umask for daemon subprocess (default is 022)]" \
178+ {--directory,-d}"[directory to chdir to when daemonized]" \
179+ {--logfile,-l}"[use FILENAME as logfile path]:FILENAME:_files" \
180+ {--logfile_maxbytes,-y}"[use BYTES to limit the max size of logfile]" \
181+ {--logfile_backups,-z}"[number of backups to keep when max bytes reached]" \
182+ {--loglevel,-e}"[use LEVEL as log level (debug,info,warn,error,critical)]:level:->levels" \
183+ {--pidfile,-j}"[write a pid file for the daemon process to FILENAME]:FILENAME:_files" \
184+ {--identifier,-i}"[identifier used for this instance of supervisord]" \
185+ {--childlogdir,-q}"[the log directory for child process logs]:child log directory:_files -/" \
186+ {--nocleanup,-k}"[prevent the process from performing cleanup (removal of old automatic child log files) at startup.]" \
187+ {--minfds,-a}"[the minimum number of file descriptors for start success]" \
188+ {--strip_ansi,-t}"[strip ansi escape codes from process output]" \
189+ "--minprocs[the minimum number of processes available for start success]" \
190+ "--profile_options[run supervisord under profiler and output results based on OPTIONS, which is a comma-sep'd list of 'cumulative', 'calls', and/or 'callers', e.g. 'cumulative,callers')]" \
191+ "*::args:_gnu_generic"
192+
193+case $state in
194+levels)
195+ levels=("debug" "info" "warn" "error" "critical")
196+ _describe -t levels 'supervisord levels' levels && return 0
197+ ;;
198+esac
199diff --git a/plugins/supervisor/supervisor.plugin.zsh b/plugins/supervisor/supervisor.plugin.zsh
200new file mode 100644
201index 0000000000000000000000000000000000000000..cf1997c5be62ffeebc99253cced7608415e38e4e
202--- /dev/null
203+++ b/plugins/supervisor/supervisor.plugin.zsh
204@@ -0,0 +1 @@
205+# DECLARION: This plugin was created by hhatto. What I did is just making a portal from https://bitbucket.org/hhatto/zshcompfunc4supervisor.
206diff --git a/themes/3den.zsh-theme b/themes/3den.zsh-theme
207new file mode 100644
208index 0000000000000000000000000000000000000000..1d2c7db7f182583189b42f71101a627c04d62c9d
209--- /dev/null
210+++ b/themes/3den.zsh-theme
211@@ -0,0 +1,7 @@
212+PROMPT=$'%{$fg[white]%}$(~/.rvm/bin/rvm-prompt) %{$fg_bold[cyan]%}%~%{$reset_color%}$(git_prompt_info) %{$fg[cyan]%}%D{[%I:%M:%S]}\
213+%{$fg_bold[green]%}%n$%{$reset_color%} '
214+
215+ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[white]%}("
216+ZSH_THEME_GIT_PROMPT_SUFFIX=")%{$reset_color%}"
217+ZSH_THEME_GIT_PROMPT_DIRTY="*"
218+ZSH_THEME_GIT_PROMPT_CLEAN=""
219diff --git a/themes/jnrowe.zsh-theme b/themes/jnrowe.zsh-theme
220index 7c8a7082e96696931d797f1e847d7eeef2f4c581..bae88f7abc6269d4eea700a47d8cf270cdb1fa63 100644
221--- a/themes/jnrowe.zsh-theme
222+++ b/themes/jnrowe.zsh-theme
223@@ -2,15 +2,14 @@ autoload -U add-zsh-hook
224 autoload -Uz vcs_info
225
226 zstyle ':vcs_info:*' actionformats \
227- '%F{5}(%f%s%F{5})%F{3}-%F{5}[%F{2}%b%F{3}|%F{1}%a%F{5}]%f '
228-zstyle ':vcs_info:*' formats \
229- '%F{2}%s%F{7}:%F{2}(%F{1}%b%F{2})%f '
230+ '%F{5}(%f%s%F{5})%F{3}-%F{5}[%F{2}%b%F{3}|%F{1}%a%F{5}]%f '
231+zstyle ':vcs_info:*' formats '%F{2}%s%F{7}:%F{2}(%F{1}%b%F{2})%f '
232 zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r'
233 zstyle ':vcs_info:*' enable git
234
235-add-zsh-hook precmd prompt_jnrowe_precmd
236+add-zsh-hook precmd prompt_vcs
237
238-prompt_jnrowe_precmd () {
239+prompt_vcs () {
240 vcs_info
241
242 if [ "${vcs_info_msg_0_}" = "" ]; then
243@@ -24,8 +23,16 @@ prompt_jnrowe_precmd () {
244 fi
245 }
246
247+function {
248+ if [[ -n "$SSH_CLIENT" ]]; then
249+ PROMPT_HOST=" ($HOST)"
250+ else
251+ PROMPT_HOST=''
252+ fi
253+}
254+
255 local ret_status="%(?:%{$fg_bold[green]%}Ξ:%{$fg_bold[red]%}%S↑%s%?)"
256
257-PROMPT='${ret_status}%{$fg_bold[green]%}%p %{$fg_bold[yellow]%}%2~ ${vcs_info_msg_0_}${dir_status}%{$reset_color%} '
258+PROMPT='${ret_status}%{$fg[blue]%}${PROMPT_HOST}%{$fg_bold[green]%}%p %{$fg_bold[yellow]%}%2~ ${vcs_info_msg_0_}${dir_status}%{$reset_color%} '
259
260 # vim: set ft=zsh ts=4 sw=4 et: