Skip to content

Commit 87941c0

Browse files
committed
Merge branch 'master' of git://github.com/robbyrussell/oh-my-zsh into HEAD
2 parents 00aba56 + 96e4e5d commit 87941c0

File tree

87 files changed

+1223
-274
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+1223
-274
lines changed

README.textile

Lines changed: 43 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,110 +1,111 @@
11
!https://s3.amazonaws.com/ohmyzsh/oh-my-zsh-logo.png!
22

3-
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...
3+
@oh-my-zsh@ is an open source, community-driven framework for managing your "Zsh":http://www.zsh.org/ configuration.
4+
5+
It comes bundled with a ton of helpful functions, helpers, plugins, themes, and a few things that make you shout…
46

57
bq. "OH MY ZSHELL!"
68

79
h2. Setup
810

9-
@oh-my-zsh@ should work with any recent release of "zsh":http://www.zsh.org/, the minimum recommended version is 4.3.9.
11+
@oh-my-zsh@ should work with any recent release of "Zsh":http://www.zsh.org/. The minimum recommended version is *4.3.9*.
12+
13+
If not already installed, you can install "Zsh":http://www.zsh.org/ using the command-line.
1014

11-
h3. The automatic installer... (do you trust me?)
15+
h3. The automatic installerdo you trust me?
1216

13-
You can install this via the command line with either `curl` or `wget`.
17+
You can install this via the command-line with either @curl@ or @wget@.
1418

15-
h4. via `curl`
19+
h4. via @curl@:
1620

1721
@curl -L http://install.ohmyz.sh | sh@
1822

19-
h4. via `wget`
23+
h4. via @wget@:
2024

2125
@wget --no-check-certificate http://install.ohmyz.sh -O - | sh@
2226

23-
h4. Optional: change the install directory
27+
h4. *Optionally*, change the install directory:
2428

25-
The default location is `~/.oh-my-zsh` (hidden in your home directory).
29+
The default location is @~/.oh-my-zsh@ (hidden in your home directory).
2630

27-
You can change the install directory with the ZSH environment variable, either
28-
by running `export ZSH=/your/path` before installing, or setting it before the
29-
end of the install pipeline like this:
31+
You can change the install directory with the @ZSH@ environment variable, either by running @export ZSH=/your/path@ before installing, or by setting it before the end of the install pipeline like this:
3032

3133
@curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | ZSH=~/.dotfiles/zsh sh@
3234

33-
3435
h3. The manual way
3536

36-
1. Clone the repository
37+
1. Clone the repository:
3738

38-
@git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh@
39+
@git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh@
3940

40-
2. *OPTIONAL* Backup your existing ~/.zshrc file
41+
2. *Optionally*, backup your existing @~/.zshrc@ file:
4142

42-
@cp ~/.zshrc ~/.zshrc.orig@
43+
@cp ~/.zshrc ~/.zshrc.orig@
4344

44-
3. Create a new zsh config by copying the zsh template we've provided.
45+
3. Create a new "Zsh":http://www.zsh.org/ config file by copying the "Zsh":http://www.zsh.org/ template we've provided:
4546

46-
@cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc@
47+
@cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc@
4748

48-
4. Set zsh as your default shell:
49+
4. Set "Zsh":http://www.zsh.org/ as your default shell:
4950

50-
@chsh -s /bin/zsh@
51+
@chsh -s /bin/zsh@
5152

52-
5. Start / restart zsh (open a new terminal is easy enough...)
53+
5. Start or restart "Zsh":http://www.zsh.org/ by opening a new command-line window.
5354

5455
h3. Problems?
5556

56-
You _might_ need to modify your PATH in ~/.zshrc if you're not able to find some commands after switching to _Oh My Zsh_.
57+
You _might_ need to modify your @PATH@ in @~/.zshrc@ if you're not able to find some commands after switching to @oh-my-zsh@.
5758

58-
If you installed manually or changed the install location, check ZSH in ~/.zshrc
59+
If you installed manually or changed the install location, check the @ZSH@ environment variable in @~/.zshrc@.
5960

6061
h2. Usage
6162

62-
* enable the plugins you want in your @~/.zshrc@ (take a look at the @plugins/@ directory and the "wiki":https://github.com/robbyrussell/oh-my-zsh/wiki/Plugins to see what's possible)
63+
* enable the plugins you want in your @~/.zshrc@ (take a look at the @plugins/@ directory and the "wiki":https://github.com/robbyrussell/oh-my-zsh/wiki/Plugins to see what's available)
6364
** example: @plugins=(git osx ruby)@
64-
* Theme support: Change the @ZSH_THEME@ environment variable in @~/.zshrc@.
65-
** Take a look at the "current themes":https://wiki.github.com/robbyrussell/oh-my-zsh/themes that come bundled with _Oh My Zsh_.
66-
* much much more... take a look at @lib/@ what _Oh My Zsh_ offers...
65+
* theme support: change the @ZSH_THEME@ environment variable in @~/.zshrc@
66+
** take a look at the @themes/@ directory and the "wiki":https://wiki.github.com/robbyrussell/oh-my-zsh/themes to see what comes bundled with @oh-my-zsh@
67+
* & much, much moretake a look at the @lib/@ directory to see what @oh-my-zsh@ has to offer…
6768

6869
h2. Useful
6970

70-
the "refcard":http://www.bash2zsh.com/zsh_refcard/refcard.pdf is pretty tasty for tips.
71+
The "refcard":http://www.bash2zsh.com/zsh_refcard/refcard.pdf is pretty useful for tips.
7172

7273
h3. Customization
7374

74-
If you want to override any of the default behavior, just add a new file (ending in @.zsh@) into the @custom/@ directory.
75-
If you have many functions which go well together you can put them as a *.plugin.zsh file in the @custom/plugins/@ directory and then enable this plugin.
76-
If you would like to override the functionality of a plugin distributed with oh-my-zsh, create a plugin of the same name in the @custom/plugins/@ directory and it will be loaded instead of the one in @plugins/@.
75+
If you want to override any of the default behaviors, just add a new file (ending in @.zsh@) in the @custom/@ directory.
76+
77+
If you have many functions that go well together, you can put them as a @*.plugin.zsh@ file in the @custom/plugins/@ directory and then enable this plugin (see '"Usage":https://github.com/robbyrussell/oh-my-zsh#usage' above).
78+
79+
If you would like to override the functionality of a plugin distributed with @oh-my-zsh@, create a plugin of the same name in the @custom/plugins/@ directory and it will be loaded instead of the one in @plugins/@.
7780

7881
h3. Updates
7982

80-
By default you will be prompted to check for updates. If you would like oh-my-zsh to automatically update itself without prompting you, set the following in your ~/.zshrc
83+
By default you will be prompted to check for upgrades. If you would like @oh-my-zsh@ to automatically upgrade itself without prompting you, set the following in your @~/.zshrc@:
8184

8285
@DISABLE_UPDATE_PROMPT=true@
8386

84-
To disable updates entirely, put this in your ~/.zshrc
87+
To disable upgrades entirely, set the following in your @~/.zshrc@:
8588

8689
@DISABLE_AUTO_UPDATE=true@
8790

88-
To upgrade directly from the command line, just run @upgrade_oh_my_zsh@
91+
To upgrade directly from the command-line, just run @upgrade_oh_my_zsh@.
8992

9093
h3. Uninstalling
9194

92-
If you want to uninstall it, just run @uninstall_oh_my_zsh@ from the command line and it'll remove itself and revert you to bash (or your previous zsh config).
95+
If you want to uninstall @oh-my-zsh@, just run @uninstall_oh_my_zsh@ from the command-line and it'll remove itself and revert you to @bash@ (or your previous "Zsh":http://www.zsh.org/ configuration).
9396

9497
h2. Help out!
9598

96-
I'm far from being a zsh-expert and suspect there are many ways to improve. If you have ideas on how to make the configuration easier to maintain (and faster), don't hesitate to fork and send pull requests!
99+
I'm far from being a "Zsh":http://www.zsh.org/ expert and suspect there are many ways to improve – if you have ideas on how to make the configuration easier to maintain (and faster), don't hesitate to fork and send pull requests!
97100

98-
h3. (Don't) Send us your theme! (for now)
101+
h3. (Don't) send us your theme (for now)!
99102

100-
-I'm hoping to collect a bunch of themes for our command prompts. You can see existing ones in the @themes/@ directory.-
103+
-I'm hoping to collect a bunch of themes – you can see existing ones in the @themes/@ directory.-
101104

102-
We have enough themes for the time being. Please fork the project and add on in there, you can let people know how to grab it from there.
105+
We have enough themes for the time being. Please fork the project and add on in there you can let people know how to grab it from there.
103106

104107
h2. Contributors
105108

106-
This project wouldn't exist without all of our awesome users and contributors.
107-
108-
* "View our growing list of contributors":https://github.com/robbyrussell/oh-my-zsh/contributors
109+
This project wouldn't exist without all of our awesome users and contributors: "view our growing list of contributors":https://github.com/robbyrussell/oh-my-zsh/contributors
109110

110111
Thank you so much!

cache/.easter-egg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
This file is only here so that Git will keep a cache directory as .gitignore is ignoring all the files within it.
2+
3+
Feel free to add love notes for people here.
4+

lib/aliases.zsh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ alias lsa='ls -lah'
3030
alias l='ls -lah'
3131
alias ll='ls -lh'
3232
alias la='ls -lAh'
33-
alias sl=ls # often screw this up
3433

3534
alias afind='ack-grep -il'
3635

lib/completion.zsh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ zstyle ':completion:*:*:*:users' ignored-patterns \
4444
named netdump news nfsnobody nobody nscd ntp nut nx obsrun openvpn \
4545
operator pcap polkitd postfix postgres privoxy pulse pvm quagga radvd \
4646
rpc rpcuser rpm rtkit scard shutdown squid sshd statd svn sync tftp \
47-
usbmux uucp vcsa wwwrun xfs
47+
usbmux uucp vcsa wwwrun xfs '_*'
4848

4949
# ... unless we really want to.
5050
zstyle '*' single-ignored show

lib/correction.zsh

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
alias man='nocorrect man'
2-
alias mv='nocorrect mv'
3-
alias mysql='nocorrect mysql'
4-
alias mkdir='nocorrect mkdir'
5-
alias gist='nocorrect gist'
6-
alias heroku='nocorrect heroku'
7-
alias ebuild='nocorrect ebuild'
8-
alias hpodder='nocorrect hpodder'
9-
alias sudo='nocorrect sudo'
10-
111
if [[ "$ENABLE_CORRECTION" == "true" ]]; then
2+
alias ebuild='nocorrect ebuild'
3+
alias gist='nocorrect gist'
4+
alias heroku='nocorrect heroku'
5+
alias hpodder='nocorrect hpodder'
6+
alias man='nocorrect man'
7+
alias mkdir='nocorrect mkdir'
8+
alias mv='nocorrect mv'
9+
alias mysql='nocorrect mysql'
10+
alias sudo='nocorrect sudo'
11+
1212
setopt correct_all
1313
fi

lib/functions.zsh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ function zsh_stats() {
33
}
44

55
function uninstall_oh_my_zsh() {
6-
/usr/bin/env ZSH=$ZSH /bin/sh $ZSH/tools/uninstall.sh
6+
env ZSH=$ZSH /bin/sh $ZSH/tools/uninstall.sh
77
}
88

99
function upgrade_oh_my_zsh() {
10-
/usr/bin/env ZSH=$ZSH /bin/sh $ZSH/tools/upgrade.sh
10+
env ZSH=$ZSH /bin/sh $ZSH/tools/upgrade.sh
1111
}
1212

1313
function take() {

lib/git.zsh

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# get the name of the branch we are on
22
function git_prompt_info() {
3-
if [[ "$(git config --get oh-my-zsh.hide-status)" != "1" ]]; then
3+
if [[ "$(command git config --get oh-my-zsh.hide-status 2>/dev/null)" != "1" ]]; then
44
ref=$(command git symbolic-ref HEAD 2> /dev/null) || \
5-
ref=$(command git rev-parse --short HEAD 2> /dev/null) || return
5+
ref=$(command git rev-parse --short HEAD 2> /dev/null) || return 0
66
echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_SUFFIX"
77
fi
88
}
@@ -54,11 +54,19 @@ git_remote_status() {
5454

5555
# Checks if there are commits ahead from remote
5656
function git_prompt_ahead() {
57-
if $(echo "$(command git log origin/$(current_branch)..HEAD 2> /dev/null)" | grep '^commit' &> /dev/null); then
57+
if $(echo "$(command git log @{upstream}..HEAD 2> /dev/null)" | grep '^commit' &> /dev/null); then
5858
echo "$ZSH_THEME_GIT_PROMPT_AHEAD"
5959
fi
6060
}
6161

62+
# Gets the number of commits ahead from remote
63+
function git_commits_ahead() {
64+
if $(echo "$(command git log @{upstream}..HEAD 2> /dev/null)" | grep '^commit' &> /dev/null); then
65+
COMMITS=$(command git log @{upstream}..HEAD | grep '^commit' | wc -l | tr -d ' ')
66+
echo "$ZSH_THEME_GIT_COMMITS_AHEAD_PREFIX$COMMITS$ZSH_THEME_GIT_COMMITS_AHEAD_SUFFIX"
67+
fi
68+
}
69+
6270
# Formats prompt string for current git commit short SHA
6371
function git_prompt_short_sha() {
6472
SHA=$(command git rev-parse --short HEAD 2> /dev/null) && echo "$ZSH_THEME_GIT_PROMPT_SHA_BEFORE$SHA$ZSH_THEME_GIT_PROMPT_SHA_AFTER"

lib/termsupport.zsh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,5 @@ function omz_termsupport_preexec {
3434
title '$CMD' '%100>...>$LINE%<<'
3535
}
3636

37-
autoload -U add-zsh-hook
38-
add-zsh-hook precmd omz_termsupport_precmd
39-
add-zsh-hook preexec omz_termsupport_preexec
37+
precmd_functions+=(omz_termsupport_precmd)
38+
preexec_functions+=(omz_termsupport_preexec)

oh-my-zsh.sh

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

66
# Initializes Oh My Zsh
@@ -38,15 +38,17 @@ for plugin ($plugins); do
3838
done
3939

4040
# Figure out the SHORT hostname
41-
if [ -n "$commands[scutil]" ]; then
42-
# OS X
43-
SHORT_HOST=$(scutil --get ComputerName)
41+
if [[ "$OSTYPE" = darwin* ]]; then
42+
# OS X's $HOST changes with dhcp, etc. Use ComputerName if possible.
43+
SHORT_HOST=$(scutil --get ComputerName 2>/dev/null) || SHORT_HOST=${HOST/.*/}
4444
else
4545
SHORT_HOST=${HOST/.*/}
4646
fi
4747

4848
# Save the location of the current completion dump file.
49-
ZSH_COMPDUMP="${ZDOTDIR:-${HOME}}/.zcompdump-${SHORT_HOST}-${ZSH_VERSION}"
49+
if [ -z "$ZSH_COMPDUMP" ]; then
50+
ZSH_COMPDUMP="${ZDOTDIR:-${HOME}}/.zcompdump-${SHORT_HOST}-${ZSH_VERSION}"
51+
fi
5052

5153
# Load and run compinit
5254
autoload -U compinit

plugins/adb/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# adb autocomplete plugin
2+
3+
* Adds autocomplete options for all adb commands.
4+
5+
6+
## Requirements
7+
8+
In order to make this work, you will need to have the Android adb tools set up in your path.

plugins/adb/_adb

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#compdef adb
2+
#autoload
3+
4+
# in order to make this work, you will need to have the android adb tools
5+
6+
# adb zsh completion, based on homebrew completion
7+
8+
local -a _1st_arguments
9+
_1st_arguments=(
10+
'bugreport:return all information from the device that should be included in a bug report.'
11+
'connect:connect to a device via TCP/IP Port 5555 is default.'
12+
'devices:list all connected devices'
13+
'disconnect:disconnect from a TCP/IP device. Port 5555 is default.'
14+
'emu:run emulator console command'
15+
'forward:forward socket connections'
16+
'help:show the help message'
17+
'install:push this package file to the device and install it'
18+
'jdwp:list PIDs of processes hosting a JDWP transport'
19+
'logcat:View device log'
20+
'pull:copy file/dir from device'
21+
'push:copy file/dir to device'
22+
'shell:run remote shell interactively'
23+
'sync:copy host->device only if changed (-l means list but dont copy)'
24+
'uninstall:remove this app package from the device'
25+
'version:show version num'
26+
)
27+
28+
local expl
29+
local -a pkgs installed_pkgs
30+
31+
_arguments \
32+
'*:: :->subcmds' && return 0
33+
34+
if (( CURRENT == 1 )); then
35+
_describe -t commands "adb subcommand" _1st_arguments
36+
return
37+
fi
38+
39+
_files

plugins/archlinux/archlinux.plugin.zsh

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,14 @@ if [[ -x `which yaourt` ]]; then
2121
alias yalst='yaourt -Qe' # List installed packages, even those installed from AUR (they're tagged as "local")
2222
alias yaorph='yaourt -Qtd' # Remove orphans using yaourt
2323
# Additional yaourt alias examples
24-
if [[ -x `which abs` ]]; then
24+
if [[ -x `which abs` && -x `which aur` ]]; then
25+
alias yaupd='yaourt -Sy && sudo abs && sudo aur' # Update and refresh the local package, ABS and AUR databases against repositories
26+
elif [[ -x `which abs` ]]; then
2527
alias yaupd='yaourt -Sy && sudo abs' # Update and refresh the local package and ABS databases against repositories
28+
elif [[ -x `which aur` ]]; then
29+
alias yaupd='yaourt -Sy && sudo aur' # Update and refresh the local package and AUR databases against repositories
2630
else
27-
alias yaupd='yaourt -Sy' # Update and refresh the local package and ABS databases against repositories
31+
alias yaupd='yaourt -Sy' # Update and refresh the local package database against repositories
2832
fi
2933
alias yainsd='yaourt -S --asdeps' # Install given package(s) as dependencies of another package
3034
alias yamir='yaourt -Syy' # Force refresh of all package lists after updating /etc/pacman.d/mirrorlist
@@ -45,10 +49,14 @@ alias pacreps='pacman -Ss' # Search for package(s) in the repositori
4549
alias pacloc='pacman -Qi' # Display information about a given package in the local database
4650
alias paclocs='pacman -Qs' # Search for package(s) in the local database
4751
# Additional pacman alias examples
48-
if [[ -x `which abs` ]]; then
49-
alias pacupd='sudo pacman -Sy && sudo abs' # Update and refresh the local package and ABS databases against repositories
52+
if [[ -x `which abs` && -x `which aur` ]]; then
53+
alias pacupd='sudo pacman -Sy && sudo abs && sudo aur' # Update and refresh the local package, ABS and AUR databases against repositories
54+
elif [[ -x `which abs` ]]; then
55+
alias pacupd='sudo pacman -Sy && sudo abs' # Update and refresh the local package and ABS databases against repositories
56+
elif [[ -x `which aur` ]]; then
57+
alias pacupd='sudo pacman -Sy && sudo aur' # Update and refresh the local package and AUR databases against repositories
5058
else
51-
alias pacupd='sudo pacman -Sy' # Update and refresh the local package and ABS databases against repositories
59+
alias pacupd='sudo pacman -Sy' # Update and refresh the local package database against repositories
5260
fi
5361
alias pacinsd='sudo pacman -S --asdeps' # Install given package(s) as dependencies of another package
5462
alias pacmir='sudo pacman -Syy' # Force refresh of all package lists after updating /etc/pacman.d/mirrorlist

plugins/autojump/autojump.plugin.zsh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
if [ $commands[autojump] ]; then # check if autojump is installed
2-
if [ -f /usr/share/autojump/autojump.zsh ]; then # debian and ubuntu package
2+
if [ -f $HOME/.autojump/etc/profile.d/autojump.zsh ]; then # manual user-local installation
3+
. $HOME/.autojump/etc/profile.d/autojump.zsh
4+
elif [ -f /usr/share/autojump/autojump.zsh ]; then # debian and ubuntu package
35
. /usr/share/autojump/autojump.zsh
46
elif [ -f /etc/profile.d/autojump.zsh ]; then # manual installation
57
. /etc/profile.d/autojump.zsh
68
elif [ -f /etc/profile.d/autojump.sh ]; then # gentoo installation
79
. /etc/profile.d/autojump.sh
810
elif [ -f /usr/local/share/autojump/autojump.zsh ]; then # freebsd installation
911
. /usr/local/share/autojump/autojump.zsh
10-
elif [ -f $HOME/.autojump/etc/profile.d/autojump.zsh ]; then # manual user-local installation
11-
. $HOME/.autojump/etc/profile.d/autojump.zsh
1212
elif [ -f /opt/local/etc/profile.d/autojump.zsh ]; then # mac os x with ports
1313
. /opt/local/etc/profile.d/autojump.zsh
1414
elif [ $commands[brew] -a -f `brew --prefix`/etc/autojump.zsh ]; then # mac os x with brew

0 commit comments

Comments
 (0)