Skip to content

Commit 5700607

Browse files
committed
Merge branch 'master' of git://github.com/robbyrussell/oh-my-zsh
2 parents 3e1a721 + 757fa33 commit 5700607

40 files changed

+1335
-89
lines changed

lib/completion.zsh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,12 @@ zstyle ':completion:*:*:*:users' ignored-patterns \
5959
# ... unless we really want to.
6060
zstyle '*' single-ignored show
6161

62+
if [ "x$COMPLETION_WAITING_DOTS" = "xtrue" ]; then
63+
expand-or-complete-with-dots() {
64+
echo -n "\e[31m......\e[0m"
65+
zle expand-or-complete
66+
zle redisplay
67+
}
68+
zle -N expand-or-complete-with-dots
69+
bindkey "^I" expand-or-complete-with-dots
70+
fi

lib/git.zsh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ git_prompt_status() {
5252
if $(echo "$INDEX" | grep '^R ' &> /dev/null); then
5353
STATUS="$ZSH_THEME_GIT_PROMPT_RENAMED$STATUS"
5454
fi
55-
if $(echo "$INDEX" | grep '^D ' &> /dev/null); then
55+
if $(echo "$INDEX" | grep '^ D ' &> /dev/null); then
56+
STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS"
57+
elif $(echo "$INDEX" | grep '^AD ' &> /dev/null); then
5658
STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS"
5759
fi
5860
if $(echo "$INDEX" | grep '^UU ' &> /dev/null); then

lib/key-bindings.zsh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,15 @@ bindkey '^[[B' down-line-or-search
1414

1515
bindkey "^[[H" beginning-of-line
1616
bindkey "^[[1~" beginning-of-line
17+
bindkey "^[OH" beginning-of-line
1718
bindkey "^[[F" end-of-line
1819
bindkey "^[[4~" end-of-line
20+
bindkey "^[OF" end-of-line
1921
bindkey ' ' magic-space # also do history expansion on space
2022

23+
bindkey "^[[1;5C" forward-word
24+
bindkey "^[[1;5D" backward-word
25+
2126
bindkey '^[[Z' reverse-menu-complete
2227

2328
# Make the delete key (or Fn + Delete on the Mac) work instead of outputting a ~

oh-my-zsh.sh

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Check for updates on initial load...
22
if [ "$DISABLE_AUTO_UPDATE" != "true" ]
33
then
4-
/usr/bin/env zsh $ZSH/tools/check_for_upgrade.sh
4+
/usr/bin/env ZSH=$ZSH zsh $ZSH/tools/check_for_upgrade.sh
55
fi
66

77
# Initializes Oh My Zsh
@@ -21,17 +21,24 @@ for plugin ($plugins) fpath=($ZSH/plugins/$plugin $fpath)
2121
autoload -U compinit
2222
compinit -i
2323

24+
# Set ZSH_CUSTOM to the path where your custom config files
25+
# and plugins exists, or else we will use the default custom/
26+
if [ "$ZSH_CUSTOM" = "" ]
27+
then
28+
ZSH_CUSTOM="$ZSH/custom"
29+
fi
30+
2431
# Load all of the plugins that were defined in ~/.zshrc
2532
for plugin ($plugins); do
26-
if [ -f $ZSH/custom/plugins/$plugin/$plugin.plugin.zsh ]; then
27-
source $ZSH/custom/plugins/$plugin/$plugin.plugin.zsh
33+
if [ -f $ZSH_CUSTOM/plugins/$plugin/$plugin.plugin.zsh ]; then
34+
source $ZSH_CUSTOM/plugins/$plugin/$plugin.plugin.zsh
2835
elif [ -f $ZSH/plugins/$plugin/$plugin.plugin.zsh ]; then
2936
source $ZSH/plugins/$plugin/$plugin.plugin.zsh
3037
fi
3138
done
3239

3340
# Load all of your custom configurations from custom/
34-
for config_file ($ZSH/custom/*.zsh) source $config_file
41+
for config_file ($ZSH_CUSTOM/*.zsh) source $config_file
3542

3643
# Load the theme
3744
if [ "$ZSH_THEME" = "random" ]

plugins/bundler/_bundler

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
#compdef bundle
2+
3+
local curcontext="$curcontext" state line _gems _opts ret=1
4+
5+
_arguments -C -A "-v" -A "--version" \
6+
'(- 1 *)'{-v,--version}'[display version information]' \
7+
'1: :->cmds' \
8+
'*:: :->args' && ret=0
9+
10+
case $state in
11+
cmds)
12+
_values "bundle command" \
13+
"install[Install the gems specified by the Gemfile or Gemfile.lock]" \
14+
"update[Update dependencies to their latest versions]" \
15+
"package[Package the .gem files required by your application]" \
16+
"exec[Execute a script in the context of the current bundle]" \
17+
"config[Specify and read configuration options for bundler]" \
18+
"check[Determine whether the requirements for your application are installed]" \
19+
"list[Show all of the gems in the current bundle]" \
20+
"show[Show the source location of a particular gem in the bundle]" \
21+
"console[Start an IRB session in the context of the current bundle]" \
22+
"open[Open an installed gem in the editor]" \
23+
"viz[Generate a visual representation of your dependencies]" \
24+
"init[Generate a simple Gemfile, placed in the current directory]" \
25+
"gem[Create a simple gem, suitable for development with bundler]" \
26+
"help[Describe available tasks or one specific task]"
27+
ret=0
28+
;;
29+
args)
30+
case $line[1] in
31+
help)
32+
_values 'commands' \
33+
'install' \
34+
'update' \
35+
'package' \
36+
'exec' \
37+
'config' \
38+
'check' \
39+
'list' \
40+
'show' \
41+
'console' \
42+
'open' \
43+
'viz' \
44+
'init' \
45+
'gem' \
46+
'help' && ret=0
47+
;;
48+
install)
49+
_arguments \
50+
'(--no-color)--no-color[disable colorization in output]' \
51+
'(--local)--local[do not attempt to connect to rubygems.org]' \
52+
'(--quiet)--quiet[only output warnings and errors]' \
53+
'(--gemfile)--gemfile=-[use the specified gemfile instead of Gemfile]:gemfile' \
54+
'(--system)--system[install to the system location]' \
55+
'(--deployment)--deployment[install using defaults tuned for deployment environments]' \
56+
'(--frozen)--frozen[do not allow the Gemfile.lock to be updated after this install]' \
57+
'(--path)--path=-[specify a different path than the system default]:path:_files' \
58+
'(--binstubs)--binstubs=-[generate bin stubs for bundled gems to ./bin]:directory:_files' \
59+
'(--without)--without=-[exclude gems that are part of the specified named group]:groups'
60+
ret=0
61+
;;
62+
exec)
63+
_normal && ret=0
64+
;;
65+
(open|show)
66+
_gems=( $(bundle show 2> /dev/null | sed -e '/^ \*/!d; s/^ \* \([^ ]*\) .*/\1/') )
67+
if [[ $_gems != "" ]]; then
68+
_values 'gems' $_gems && ret=0
69+
fi
70+
;;
71+
*)
72+
_opts=( $(bundle help $line[1] | sed -e '/^ \[-/!d; s/^ \[\(-[^=]*\)=.*/\1/') )
73+
_opts+=( $(bundle help $line[1] | sed -e '/^ -/!d; s/^ \(-.\), \[\(-[^=]*\)=.*/\1 \2/') )
74+
if [[ $_opts != "" ]]; then
75+
_values 'options' $_opts && ret=0
76+
fi
77+
;;
78+
esac
79+
;;
80+
esac
81+
82+
return ret

plugins/bundler/bundler.plugin.zsh

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1+
fpath=($ZSH/plugins/bundler $fpath)
2+
autoload -U compinit
3+
compinit -i
4+
15
alias be="bundle exec"
26
alias bi="bundle install"
37
alias bl="bundle list"
4-
alias bu="bundle update"
58
alias bp="bundle package"
9+
alias bu="bundle update"
610

711
# The following is based on https://github.com/gma/bundler-exec
812

9-
bundled_commands=(cap capify cucumber heroku rackup rails rake rspec ruby shotgun spec spork thin unicorn unicorn_rails)
13+
bundled_commands=(cap capify cucumber foreman guard heroku nanoc rackup rails rainbows rake rspec ruby shotgun spec spork thin unicorn unicorn_rails)
1014

1115
## Functions
1216

@@ -33,5 +37,10 @@ _run-with-bundler() {
3337

3438
## Main program
3539
for cmd in $bundled_commands; do
36-
alias $cmd="_run-with-bundler $cmd"
40+
eval "function bundled_$cmd () { _run-with-bundler $cmd \$@}"
41+
alias $cmd=bundled_$cmd
42+
43+
if which _$cmd > /dev/null 2>&1; then
44+
compdef _$cmd bundled_$cmd
45+
fi
3746
done

plugins/cake/cake.plugin.zsh

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
11
# Set this to 1 if you want to cache the tasks
2-
cache_task_list=1
2+
_cake_cache_task_list=1
33

44
# Cache filename
5-
cache_file='.cake_task_cache'
5+
_cake_task_cache_file='.cake_task_cache'
6+
7+
_cake_get_target_list () {
8+
cake | grep '^cake ' | sed -e "s/cake \([^ ]*\) .*/\1/" | grep -v '^$'
9+
}
610

711
_cake_does_target_list_need_generating () {
812

9-
if [ $cache_task_list -eq 0 ]; then
13+
if [ ${_cake_cache_task_list} -eq 0 ]; then
1014
return 1;
1115
fi
1216

13-
if [ ! -f $cache_file ]; then return 0;
17+
if [ ! -f ${_cake_task_cache_file} ]; then return 0;
1418
else
15-
accurate=$(stat -f%m $cache_file)
19+
accurate=$(stat -f%m $_cake_task_cache_file)
1620
changed=$(stat -f%m Cakefile)
1721
return $(expr $accurate '>=' $changed)
1822
fi
@@ -21,12 +25,12 @@ _cake_does_target_list_need_generating () {
2125
_cake () {
2226
if [ -f Cakefile ]; then
2327
if _cake_does_target_list_need_generating; then
24-
cake | sed -e "s/cake \([^ ]*\) .*/\1/" | grep -v '^$' > $cache_file
25-
compadd `cat $cache_file`
28+
_cake_get_target_list > ${_cake_task_cache_file}
29+
compadd `cat ${_cake_task_cache_file}`
2630
else
27-
compadd `cake | sed -e "s/cake \([^ ]*\) .*/\1/" | grep -v '^$'`
31+
compadd `_cake_get_target_list`
2832
fi
2933
fi
3034
}
3135

32-
compdef _cake cake
36+
compdef _cake cake

plugins/deb/deb.plugin.zsh

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)