Diff
1diff --git a/README.textile b/README.textile
2index 1916d9f4e07f65a631f7c7306b20c9ae1f739369..86dd5da22b74dd17d855b772177afd2bcc580d30 100644
3--- a/README.textile
4+++ b/README.textile
5@@ -1,3 +1,5 @@
6+!https://s3.amazonaws.com/ohmyzsh/oh-my-zsh-logo.png!
7+
8 oh-my-zsh is an open source, community-driven framework for managing your ZSH configuration. It comes bundled with a ton of helpful functions, helpers, plugins, themes, and few things that make you shout...
9
10 bq. "OH MY ZSHELL!"
11diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh
12index 93c10e3d2e92ee111258a45d58aed8848ca13991..15c1dce44c19249a12823c5493226edc61358ce0 100644
13--- a/oh-my-zsh.sh
14+++ b/oh-my-zsh.sh
15@@ -38,10 +38,20 @@ for plugin ($plugins); do
16 fi
17 done
18
19+# Figure out the SHORT hostname
20+if [ -n "$commands[scutil]" ]; then
21+ # OS X
22+ SHORT_HOST=$(scutil --get ComputerName)
23+else
24+ SHORT_HOST=${HOST/.*/}
25+fi
26+
27+# Save the location of the current completion dump file.
28+ZSH_COMPDUMP="${ZDOTDIR:-${HOME}}/.zcompdump-${SHORT_HOST}-${ZSH_VERSION}"
29+
30 # Load and run compinit
31 autoload -U compinit
32-compinit -i
33-
34+compinit -i -d "${ZSH_COMPDUMP}"
35
36 # Load all of the plugins that were defined in ~/.zshrc
37 for plugin ($plugins); do
38diff --git a/plugins/brew/_brew b/plugins/brew/_brew
39index e43ba2900d6f231878b8dbe90c29098501b621af..bf0a286c1f31c933fc31510c958c25dc42599a59 100644
40--- a/plugins/brew/_brew
41+++ b/plugins/brew/_brew
42@@ -28,6 +28,7 @@ _1st_arguments=(
43 'missing:check all installed formuale for missing dependencies.'
44 'outdated:list formulas for which a newer version is available'
45 'prune:remove dead links'
46+ 'reinstall:reinstall a formula'
47 'remove:remove a formula'
48 'search:search for a formula (/regex/ or string)'
49 'server:start a local web app that lets you browse formulae (requires Sinatra)'
50@@ -75,7 +76,7 @@ case "$words[1]" in
51 install|home|homepage|log|info|abv|uses|cat|deps|edit|options|versions)
52 _brew_all_formulae
53 _wanted formulae expl 'all formulae' compadd -a formulae ;;
54- remove|rm|uninstall|unlink|cleanup|link|ln)
55+ reinstall|remove|rm|uninstall|unlink|cleanup|link|ln)
56 _brew_installed_formulae
57 _wanted installed_formulae expl 'installed formulae' compadd -a installed_formulae ;;
58 esac
59diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh
60index c01241409dca69f25a5aad53fd624ac731c33cbb..1e70db6afe9898f970c45b00e9b79c62ce586b73 100644
61--- a/plugins/bundler/bundler.plugin.zsh
62+++ b/plugins/bundler/bundler.plugin.zsh
63@@ -1,10 +1,17 @@
64 alias be="bundle exec"
65-alias bi="bundle install"
66 alias bl="bundle list"
67 alias bp="bundle package"
68 alias bo="bundle open"
69 alias bu="bundle update"
70
71+if [[ "$(uname)" == 'Darwin' ]]
72+then
73+ local cores_num="$(sysctl hw.ncpu | awk '{print $2}')"
74+else
75+ local cores_num="$(nproc)"
76+fi
77+eval "alias bi='bundle install --jobs=$cores_num'"
78+
79 # The following is based on https://github.com/gma/bundler-exec
80
81 bundled_commands=(annotate berks cap capify cucumber foodcritic foreman guard jekyll kitchen knife middleman nanoc rackup rainbows rake rspec ruby shotgun spec spin spork strainer tailor thin thor unicorn unicorn_rails puma)
82@@ -42,3 +49,4 @@ for cmd in $bundled_commands; do
83 compdef _$cmd bundled_$cmd=$cmd
84 fi
85 done
86+
87diff --git a/plugins/jump/jump.plugin.zsh b/plugins/jump/jump.plugin.zsh
88new file mode 100644
89index 0000000000000000000000000000000000000000..a3c5cf8c35a340159515fbc5cefa02e322a85ea2
90--- /dev/null
91+++ b/plugins/jump/jump.plugin.zsh
92@@ -0,0 +1,52 @@
93+# Easily jump around the file system by manually adding marks
94+# marks are stored as symbolic links in the directory $MARKPATH (default $HOME/.marks)
95+#
96+# jump FOO: jump to a mark named FOO
97+# mark FOO: create a mark named FOO
98+# unmark FOO: delete a mark
99+# marks: lists all marks
100+#
101+export MARKPATH=$HOME/.marks
102+
103+jump() {
104+ cd -P "$MARKPATH/$1" 2>/dev/null || echo "No such mark: $1"
105+}
106+
107+mark() {
108+ if (( $# == 0 )); then
109+ MARK=$(basename "$(pwd)")
110+ else
111+ MARK="$1"
112+ fi
113+ if read -q \?"Mark $(pwd) as ${MARK}? (y/n) "; then
114+ mkdir -p "$MARKPATH"; ln -s "$(pwd)" "$MARKPATH/$MARK"
115+ fi
116+}
117+
118+unmark() {
119+ rm -i "$MARKPATH/$1"
120+}
121+
122+autoload colors
123+marks() {
124+ for link in $MARKPATH/*(@); do
125+ local markname="$fg[cyan]${link:t}$reset_color"
126+ local markpath="$fg[blue]$(readlink $link)$reset_color"
127+ printf "%s\t" $markname
128+ printf "-> %s \t\n" $markpath
129+ done
130+}
131+
132+_completemarks() {
133+ reply=($(ls $MARKPATH/**/*(-) | grep : | sed -E 's/(.*)\/([_\da-zA-Z\-]*):$/\2/g'))
134+}
135+compctl -K _completemarks jump
136+compctl -K _completemarks unmark
137+
138+_mark_expansion() {
139+ setopt extendedglob
140+ autoload -U modify-current-argument
141+ modify-current-argument '$(readlink "$MARKPATH/$ARG")'
142+}
143+zle -N _mark_expansion
144+bindkey "^g" _mark_expansion
145diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh
146index 3ecc2ac69fcb64e7456ac59599a1220e5c4bf2f2..96fab80a6349456e13a3a1bc03c628d2b85c4e40 100644
147--- a/plugins/tmux/tmux.plugin.zsh
148+++ b/plugins/tmux/tmux.plugin.zsh
149@@ -38,7 +38,7 @@ if which tmux &> /dev/null
150 fi
151
152 # Set the correct local config file to use.
153- if [[ "$ZSH_TMUX_ITERM2" == "false" ]] && (( [[ -f $HOME/.tmux.conf ]] || -h $HOME/.tmux.conf ]] ))
154+ if [[ "$ZSH_TMUX_ITERM2" == "false" ]] && [[ -f $HOME/.tmux.conf || -h $HOME/.tmux.conf ]]
155 then
156 #use this when they have a ~/.tmux.conf
157 export _ZSH_TMUX_FIXED_CONFIG="$zsh_tmux_plugin_path/tmux.extra.conf"
158diff --git a/plugins/web-search/web-search.plugin.zsh b/plugins/web-search/web-search.plugin.zsh
159index 6b6de2b1585d758cace3c0f808972945058114c4..8eedb90ee5fe0671a64370db859ae592672e5354 100644
160--- a/plugins/web-search/web-search.plugin.zsh
161+++ b/plugins/web-search/web-search.plugin.zsh
162@@ -11,7 +11,7 @@ function web_search() {
163 fi
164
165 # check whether the search engine is supported
166- if [[ ! $1 =~ '(google|bing|yahoo)' ]];
167+ if [[ ! $1 =~ '(google|bing|yahoo|duckduckgo)' ]];
168 then
169 echo "Search engine $1 not supported."
170 return 1
171@@ -24,8 +24,12 @@ function web_search() {
172 $open_cmd "$url"
173 return
174 fi
175-
176- url="${url}/search?q="
177+ if [[ $1 == 'duckduckgo' ]]; then
178+ #slightly different search syntax for DDG
179+ url="${url}/?q="
180+ else
181+ url="${url}/search?q="
182+ fi
183 shift # shift out $1
184
185 while [[ $# -gt 0 ]]; do
186@@ -34,10 +38,19 @@ function web_search() {
187 done
188
189 url="${url%?}" # remove the last '+'
190-
191+
192 $open_cmd "$url"
193 }
194
195+
196 alias bing='web_search bing'
197 alias google='web_search google'
198 alias yahoo='web_search yahoo'
199+alias ddg='web_search duckduckgo'
200+#add your own !bang searches here
201+alias wiki='web_search duckduckgo \!w'
202+alias news='web_search duckduckgo \!n'
203+alias youtube='web_search duckduckgo \!yt'
204+alias map='web_search duckduckgo \!m'
205+alias image='web_search duckduckgo \!i'
206+alias ducky='web_search duckduckgo \!'
207diff --git a/themes/sunrise.zsh-theme b/themes/sunrise.zsh-theme
208index 88b371d792f4d1620e03bf80b0e9fa7654ab9c06..acc6ed312f863bd63cf2cdcc738beb8341cd8994 100644
209--- a/themes/sunrise.zsh-theme
210+++ b/themes/sunrise.zsh-theme
211@@ -5,16 +5,15 @@
212 #-------------------------------------------------------------------------------
213
214 # Color shortcuts
215-R=$fg[red]
216-G=$fg[green]
217-M=$fg[magenta]
218-RB=$fg_bold[red]
219-YB=$fg_bold[yellow]
220-BB=$fg_bold[blue]
221+R=$fg_no_bold[red]
222+G=$fg_no_bold[green]
223+M=$fg_no_bold[magenta]
224+Y=$fg_no_bold[yellow]
225+B=$fg_no_bold[blue]
226 RESET=$reset_color
227
228 if [ "$(whoami)" = "root" ]; then
229- PROMPTCOLOR="%{$RB%}" PREFIX="-!-";
230+ PROMPTCOLOR="%{$R%}" PREFIX="-!-";
231 else
232 PROMPTCOLOR="" PREFIX="---";
233 fi
234@@ -73,13 +72,14 @@ function custom_git_prompt() {
235 PROMPT='%B$PREFIX %2~ $(custom_git_prompt)%{$M%}%B»%b%{$RESET%} '
236 RPS1="${return_code}"
237
238-ZSH_THEME_GIT_PROMPT_PREFIX="%{$YB%}‹"
239-ZSH_THEME_GIT_PROMPT_SUFFIX="%{$YB%}›%{$RESET%} "
240+ZSH_THEME_GIT_PROMPT_PREFIX="%{$Y%}‹"
241+ZSH_THEME_GIT_PROMPT_SUFFIX="%{$Y%}›%{$RESET%} "
242
243 ZSH_THEME_GIT_PROMPT_DIRTY="%{$R%}*"
244 ZSH_THEME_GIT_PROMPT_CLEAN=""
245
246-ZSH_THEME_GIT_PROMPT_AHEAD="%{$BB%}➔"
247+ZSH_THEME_GIT_PROMPT_AHEAD="%{$B%}➔"
248+
249
250 ZSH_THEME_GIT_STATUS_PREFIX=" "
251
252@@ -90,7 +90,7 @@ ZSH_THEME_GIT_PROMPT_STAGED_RENAMED="%{$G%}R"
253 ZSH_THEME_GIT_PROMPT_STAGED_DELETED="%{$G%}D"
254
255 # Not-staged
256-ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$R%}⁇"
257+ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$R%}?"
258 ZSH_THEME_GIT_PROMPT_MODIFIED="%{$R%}M"
259 ZSH_THEME_GIT_PROMPT_DELETED="%{$R%}D"
260 ZSH_THEME_GIT_PROMPT_UNMERGED="%{$R%}UU"