02c5fd5bdd0d37bb0e1cb19ad058154f5b7d96a7
- 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/aliases.zsh b/lib/aliases.zsh
2index 80760a1f526e612a637e7c9c1898fbd8fb8f37f7..d2d3aed811f08191cab9c012de2284e4f32b8354 100644
3--- a/lib/aliases.zsh
4+++ b/lib/aliases.zsh
5@@ -3,7 +3,6 @@ alias pu='pushd'
6 alias po='popd'
7
8 # Basic directory operations
9-alias .='pwd'
10 alias ...='cd ../..'
11 alias -- -='cd -'
12
13diff --git a/lib/completion.zsh b/lib/completion.zsh
14index cba90179f28d31ba24c1c4ca77b76e6485632d2c..52cc5b53c0fe14d4b65953d04cee4342122794de 100644
15--- a/lib/completion.zsh
16+++ b/lib/completion.zsh
17@@ -1,4 +1,4 @@
18-## fixme - the load process here seems a bit bizarre
19+# fixme - the load process here seems a bit bizarre
20
21 unsetopt menu_complete # do not autoselect the first completion entry
22 unsetopt flowcontrol
23@@ -30,6 +30,11 @@ zstyle ':completion:*:*:*:*:*' menu select
24 zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;34=0=01'
25 zstyle ':completion:*:*:*:*:processes' command "ps -u `whoami` -o pid,user,comm -w -w"
26
27+# disable named-directories autocompletion
28+zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-directories
29+cdpath=(.)
30+
31+
32 # Load known hosts file for auto-completion with ssh and scp commands
33 if [ -f ~/.ssh/known_hosts ]; then
34 zstyle ':completion:*' hosts $( sed 's/[, ].*$//' $HOME/.ssh/known_hosts )
35diff --git a/lib/functions.zsh b/lib/functions.zsh
36index fcbe994be3ef9f7a483b2b7e86e9fa5cf265bcfb..561586cba657cb274f76b6a7a87743e154f006e4 100644
37--- a/lib/functions.zsh
38+++ b/lib/functions.zsh
39@@ -5,7 +5,7 @@ function title {
40 print -nR $'\033k'$1$'\033'\\\
41
42 print -nR $'\033]0;'$2$'\a'
43- elif [[ $TERM == "xterm" || $TERM == "rxvt" ]]; then
44+ elif [[ $TERM =~ "^xterm" || $TERM == "rxvt" ]]; then
45 # Use this one instead for XTerms:
46 print -nR $'\033]0;'$*$'\a'
47 fi
48diff --git a/lib/key-bindings.zsh b/lib/key-bindings.zsh
49index 2e282d66a85662e64e02444bdc97b0d72e7aa490..7196a88ffe3de7e8b1f4e8327ed58f050f8898b8 100644
50--- a/lib/key-bindings.zsh
51+++ b/lib/key-bindings.zsh
52@@ -20,6 +20,7 @@ bindkey "^[[F" end-of-line
53 bindkey "^[[4~" end-of-line
54 bindkey ' ' magic-space # also do history expansion on space
55
56+bindkey '^[[Z' reverse-menu-complete
57
58 # consider emacs keybindings:
59
60diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh
61index bb45c71eb6f47fc2d082f64c827dc3ff11ac2a5b..c46aea7ac77eb63f7c59ba2c94083f5d56161a5d 100644
62--- a/oh-my-zsh.sh
63+++ b/oh-my-zsh.sh
64@@ -21,5 +21,3 @@ then
65 else
66 /usr/bin/env zsh $ZSH/tools/check_for_upgrade.sh
67 fi
68-
69-unset config_file
70diff --git a/plugins/brew.plugin.zsh b/plugins/brew.plugin.zsh
71index 91397bf3a8406a3ebde25a3215540569f59680c6..162eb6442351855f82e0d0bf89e433ace7f4fe1e 100644
72--- a/plugins/brew.plugin.zsh
73+++ b/plugins/brew.plugin.zsh
74@@ -1,6 +1,6 @@
75 #compdef brew
76
77-# copied from _fink
78+# imported from the latest homebrew contributions
79
80 _brew_all_formulae() {
81 formulae=(`brew search`)
82@@ -12,19 +12,25 @@ _brew_installed_formulae() {
83
84 local -a _1st_arguments
85 _1st_arguments=(
86+ 'cat:display formula file for a formula'
87+ 'cleanup:uninstall unused and old versions of packages'
88+ 'create:create a new formula'
89+ 'deps:list dependencies and dependants of a formula'
90+ 'doctor:audits your installation for common issues'
91+ 'edit:edit a formula'
92+ 'home:visit the homepage of a formula or the brew project'
93+ 'info:information about a formula'
94 'install:install a formula'
95+ 'link:link a formula'
96+ 'list:list files in a formula or not-installed formulae'
97+ 'log:git commit log for a formula'
98+ 'outdated:list formulas for which a newer version is available'
99+ 'prune:remove dead links'
100 'remove:remove a formula'
101 'search:search for a formula (/regex/ or string)'
102- 'list:list files in a formula or not-installed formulae'
103- 'link:link a formula'
104 'unlink:unlink a formula'
105- 'home:visit the homepage of a formula or the brew project'
106- 'info:information about a formula'
107- 'prune:remove dead links'
108 'update:freshen up links'
109- 'log:git commit log for a formula'
110- 'create:create a new formula'
111- 'edit:edit a formula'
112+ 'uses:show formulas which depend on a formula'
113 )
114
115 local expl
116@@ -47,12 +53,12 @@ case "$words[1]" in
117 _arguments \
118 '(--unbrewed)--unbrewed[files in brew --prefix not controlled by brew]' \
119 '1: :->forms' && return 0
120-
121+
122 if [[ "$state" == forms ]]; then
123 _brew_installed_formulae
124 _requested installed_formulae expl 'installed formulae' compadd -a installed_formulae
125 fi ;;
126- install|home|log|info)
127+ install|home|log|info|uses|cat|deps)
128 _brew_all_formulae
129 _wanted formulae expl 'all formulae' compadd -a formulae ;;
130 remove|edit|xo)
131diff --git a/plugins/dirpersist.plugin.zsh b/plugins/dirpersist.plugin.zsh
132new file mode 100644
133index 0000000000000000000000000000000000000000..6a2b289a2881abeeee97a47fb40dfffeb07c6077
134--- /dev/null
135+++ b/plugins/dirpersist.plugin.zsh
136@@ -0,0 +1,39 @@
137+#!/bin/zsh
138+#
139+# Make the dirstack more persistant
140+#
141+# Add dirpersist to $plugins in ~/.zshrc to load
142+#
143+
144+# $zdirstore is the file used to persist the stack
145+zdirstore=~/.zdirstore
146+
147+dirpersistinstall () {
148+ if grep 'dirpersiststore' ~/.zlogout > /dev/null; then
149+ else
150+ if read -q \?"Would you like to set up your .zlogout file for use with dirspersist? (y/n) "; then
151+ echo "# Store dirs stack\n# See ~/.oh-my-zsh/plugins/dirspersist.plugin.zsh\ndirpersiststore" >> ~/.zlogout
152+ else
153+ echo "If you don't want this message to appear, remove dirspersist from \$plugins"
154+ fi
155+ fi
156+}
157+
158+dirpersiststore () {
159+ dirs -p | perl -e 'foreach (reverse <STDIN>) {chomp;s/([& ])/\\$1/g ;print "if [ -d $_ ]; then pushd -q $_; fi\n"}' > $zdirstore
160+}
161+
162+dirpersistrestore () {
163+ if [ -f $zdirstore ]; then
164+ source $zdirstore
165+ fi
166+}
167+
168+DIRSTACKSIZE=10
169+setopt autopushd pushdminus pushdsilent pushdtohome pushdignoredups
170+
171+dirpersistinstall
172+dirpersistrestore
173+
174+# Make popd changes permanent without having to wait for logout
175+alias popd="popd;dirpersiststore"
176diff --git a/plugins/macports.plugin.zsh b/plugins/macports.plugin.zsh
177new file mode 100644
178index 0000000000000000000000000000000000000000..9564829b036373ce405dd17c61936a9b5ab4184d
179--- /dev/null
180+++ b/plugins/macports.plugin.zsh
181@@ -0,0 +1,7 @@
182+#Aliases
183+alias pc="sudo port clean --all installed"
184+alias pi="sudo port install $1"
185+alias psu="sudo port selfupdate"
186+alias puni="sudo port uninstall inactive"
187+alias puo="sudo port upgrade outdated"
188+alias pup="psu && puo"
189diff --git a/plugins/ssh-agent.plugin.zsh b/plugins/ssh-agent.plugin.zsh
190new file mode 100644
191index 0000000000000000000000000000000000000000..ce0d645c1c00ae3494aeeb5ff1f0ebd334b00955
192--- /dev/null
193+++ b/plugins/ssh-agent.plugin.zsh
194@@ -0,0 +1,23 @@
195+# Based on code from Joseph M. Reagle
196+# http://www.cygwin.com/ml/cygwin/2001-06/msg00537.html
197+
198+local SSH_ENV=$HOME/.ssh/environment
199+
200+function start_agent {
201+ /usr/bin/env ssh-agent | sed 's/^echo/#echo/' > ${SSH_ENV}
202+ chmod 600 ${SSH_ENV}
203+ . ${SSH_ENV} > /dev/null
204+ /usr/bin/ssh-add;
205+}
206+
207+# Source SSH settings, if applicable
208+
209+if [ -f "${SSH_ENV}" ]; then
210+ . ${SSH_ENV} > /dev/null
211+ ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || {
212+ start_agent;
213+ }
214+else
215+ start_agent;
216+fi
217+
218diff --git a/plugins/vi-mode.plugin.zsh b/plugins/vi-mode.plugin.zsh
219new file mode 100644
220index 0000000000000000000000000000000000000000..c47ab72114562251e4ca75f1395dcaea1abe2002
221--- /dev/null
222+++ b/plugins/vi-mode.plugin.zsh
223@@ -0,0 +1,22 @@
224+function zle-line-init zle-keymap-select {
225+ zle reset-prompt
226+}
227+
228+zle -N zle-line-init
229+zle -N zle-keymap-select
230+
231+bindkey -v
232+
233+# if mode indicator wasn't setup by theme, define default
234+if [[ "$MODE_INDICATOR" == "" ]]; then
235+ MODE_INDICATOR="%{$fg_bold[red]%}<%{$fg[red]%}<<%{$reset_color%}"
236+fi
237+
238+function vi_mode_prompt_info() {
239+ echo "${${KEYMAP/vicmd/$MODE_INDICATOR}/(main|viins)/}"
240+}
241+
242+# define right prompt, if it wasn't defined by a theme
243+if [[ "$RPS1" == "" && "$RPROMPT" == "" ]]; then
244+ RPS1='$(vi_mode_prompt_info)'
245+fi
246diff --git a/themes/candy.zsh-theme b/themes/candy.zsh-theme
247new file mode 100644
248index 0000000000000000000000000000000000000000..bc125c5ce1409824ef1b572074b3902d7b54eb71
249--- /dev/null
250+++ b/themes/candy.zsh-theme
251@@ -0,0 +1,7 @@
252+PROMPT=$'%{$fg_bold[green]%}%n@%m %{$fg[blue]%}%D{[%I:%M:%S]} %{$reset_color%}%{$fg[white]%}[%~]%{$reset_color%} $(git_prompt_info)\
253+%{$fg[blue]%}->%{$fg_bold[blue]%} %#%{$reset_color%} '
254+
255+ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}["
256+ZSH_THEME_GIT_PROMPT_SUFFIX="]%{$reset_color%}"
257+ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}*%{$fg[green]%}"
258+ZSH_THEME_GIT_PROMPT_CLEAN=""
259diff --git a/themes/fletcherm.zsh-theme b/themes/fletcherm.zsh-theme
260new file mode 100644
261index 0000000000000000000000000000000000000000..e961885442071ee257e6138e55bca1f018c21452
262--- /dev/null
263+++ b/themes/fletcherm.zsh-theme
264@@ -0,0 +1,12 @@
265+# Copied from old version of tonotdo's theme. LSCOLORS modified.
266+PROMPT='%{$fg_no_bold[cyan]%}%n%{$fg_no_bold[magenta]%}•%{$fg_no_bold[green]%}%3~$(git_prompt_info)%{$reset_color%}» '
267+RPROMPT='[%*]'
268+
269+# git theming
270+ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}(%{$fg_no_bold[red]%}"
271+ZSH_THEME_GIT_PROMPT_SUFFIX=""
272+ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg_bold[blue]%})"
273+ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[yellow]%}⚡%{$fg_bold[blue]%})"
274+
275+export LSCOLORS="exfxcxdxbxegedabagacad"
276diff --git a/themes/josh.zsh-theme b/themes/josh.zsh-theme
277new file mode 100644
278index 0000000000000000000000000000000000000000..6bed1a70e46716437afb494ed699c724bd8df670
279--- /dev/null
280+++ b/themes/josh.zsh-theme
281@@ -0,0 +1,43 @@
282+grey='\e[0;90m'
283+
284+ZSH_THEME_GIT_PROMPT_PREFIX="%{$grey%}("
285+ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
286+ZSH_THEME_GIT_PROMPT_DIRTY="%{$grey%}) %{$fg[yellow]%}✗%{$reset_color%}"
287+ZSH_THEME_GIT_PROMPT_CLEAN="%{$grey%})"
288+
289+function josh_prompt {
290+ (( spare_width = ${COLUMNS} ))
291+ prompt=" "
292+
293+ branch=$(current_branch)
294+ ruby_version=$(rvm_prompt_info)
295+ path_size=${#PWD}
296+ branch_size=${#branch}
297+ ruby_size=${#ruby_version}
298+ user_machine_size=${#${(%):-%n@%m-}}
299+
300+ if [[ ${#branch} -eq 0 ]]
301+ then (( ruby_size = ruby_size + 1 ))
302+ else
303+ (( branch_size = branch_size + 4 ))
304+ if [[ -n $(git status -s 2> /dev/null) ]]; then
305+ (( branch_size = branch_size + 2 ))
306+ fi
307+ fi
308+
309+ (( spare_width = ${spare_width} - (${user_machine_size} + ${path_size} + ${branch_size} + ${ruby_size}) ))
310+
311+ while [ ${#prompt} -lt $spare_width ]; do
312+ prompt=" $prompt"
313+ done
314+
315+ prompt="%{%F{green}%}$PWD$prompt%{%F{red}%}$(rvm_prompt_info)%{$reset_color%} $(git_prompt_info)"
316+
317+ echo $prompt
318+}
319+
320+setopt prompt_subst
321+
322+PROMPT='
323+%n@%m $(josh_prompt)
324+%(?,%{%F{green}%},%{%F{red}%})⚡%{$reset_color%} '
325diff --git a/themes/kennethreitz.zsh-theme b/themes/kennethreitz.zsh-theme
326new file mode 100644
327index 0000000000000000000000000000000000000000..109be0c2244c774eabed3eba38c3ad2816e9f1d3
328--- /dev/null
329+++ b/themes/kennethreitz.zsh-theme
330@@ -0,0 +1,13 @@
331+local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
332+
333+PROMPT='%{$fg[green]%}%c \
334+$(git_prompt_info)\
335+%{$fg[red]%}%(!.#.»)%{$reset_color%} '
336+PROMPT2='%{$fg[red]%}\ %{$reset_color%}'
337+RPS1='%{$fg[blue]%}%~%{$reset_color%} ${return_code} '
338+
339+ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}:: %{$fg[yellow]%}("
340+ZSH_THEME_GIT_PROMPT_SUFFIX=")%{$reset_color%} "
341+ZSH_THEME_GIT_PROMPT_CLEAN=""
342+ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}*%{$fg[yellow]%}"
343+
344diff --git a/themes/mrtazz.zsh-theme b/themes/mrtazz.zsh-theme
345new file mode 100644
346index 0000000000000000000000000000000000000000..214ba5a471e9d3cb67b7e3b6c261f749ede45f31
347--- /dev/null
348+++ b/themes/mrtazz.zsh-theme
349@@ -0,0 +1,7 @@
350+PROMPT='%{$fg_bold[red]%}%m%{$reset_color%}:%{$fg[cyan]%}%c%{$reset_color%}:%# '
351+RPROMPT='%{$fg_bold[green]%}$(git_prompt_info)%{$reset_color%}% '
352+
353+ZSH_THEME_GIT_PROMPT_PREFIX="<%{$fg[red]%}"
354+ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
355+ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%} %{$fg[yellow]%}✗%{$fg[green]%}>%{$reset_color%}"
356+ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%}>"
357diff --git a/themes/theunraveler.zsh-theme b/themes/theunraveler.zsh-theme
358new file mode 100644
359index 0000000000000000000000000000000000000000..4eec8e827d98b1f5df8a780bfe03e3f87de25d18
360--- /dev/null
361+++ b/themes/theunraveler.zsh-theme
362@@ -0,0 +1,6 @@
363+# Comment
364+
365+ZSH_THEME_GIT_PROMPT_PREFIX=' (git:'
366+ZSH_THEME_GIT_PROMPT_SUFFIX=')'
367+
368+PROMPT='%{$fg[magenta]%}[%c]$(git_prompt_info) $ %{$reset_color%}'
369diff --git a/tools/install.sh b/tools/install.sh
370index 004b252f42ae985dd14c6f9b9034be6c105a908e..6e3872bb9ef24466ff32e67013128a61eae13679 100755
371--- a/tools/install.sh
372+++ b/tools/install.sh
373@@ -22,7 +22,7 @@ echo "Copying your current PATH and adding it to the end of ~/.zshrc for you."
374 echo "export PATH=$PATH" >> ~/.zshrc
375
376 echo "Time to change your default shell to zsh!"
377-chsh -s /bin/zsh
378+chsh -s "/usr/bin/env zsh"
379
380 echo ' __ __ '
381 echo ' ____ / /_ ____ ___ __ __ ____ _____/ /_ '
382@@ -32,5 +32,5 @@ echo '\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ '
383 echo ' /____/'
384
385 echo "\n\n ....is now installed."
386-/bin/zsh
387+/usr/bin/env zsh
388 source ~/.zshrc