Permalink
Browse files

Merge branch 'master' of https://github.com/robbyrussell/oh-my-zsh

Conflicts:
	plugins/git/git.plugin.zsh
  • Loading branch information...
2 parents c5219a3 + 397c085 commit 3c9e351af4c028d0ff6acc2d10de0f8b18fbbef6 @kipanshi committed Dec 18, 2012
Showing with 4,896 additions and 370 deletions.
  1. +7 −4 README.textile
  2. +3 −1 lib/aliases.zsh
  3. +1 −1 lib/completion.zsh
  4. +2 −7 lib/directories.zsh
  5. +1 −1 lib/functions.zsh
  6. +37 −3 lib/git.zsh
  7. +3 −1 lib/misc.zsh
  8. +6 −3 lib/rvm.zsh
  9. +4 −2 lib/termsupport.zsh
  10. +7 −2 oh-my-zsh.sh
  11. +18 −2 plugins/archlinux/archlinux.plugin.zsh
  12. +4 −2 plugins/autojump/autojump.plugin.zsh
  13. +67 −16 plugins/battery/battery.plugin.zsh
  14. +1 −1 plugins/bundler/bundler.plugin.zsh
  15. +13 −0 plugins/bwana/bwana.plugin.zsh
  16. +0 −41 plugins/cap/cap.plugin.zsh
  17. +10 −0 plugins/capistrano/_capistrano
  18. +71 −0 plugins/coffee/_coffee
  19. +1 −1 plugins/command-not-found/command-not-found.plugin.zsh
  20. +14 −0 plugins/cp/cp.plugin.zsh
  21. +8 −6 plugins/debian/debian.plugin.zsh
  22. +44 −0 plugins/forklift/forklift.plugin.zsh
  23. +285 −0 plugins/git-extras/git-extras.plugin.zsh
  24. +6 −5 plugins/git-flow/git-flow.plugin.zsh
  25. +348 −0 plugins/git-hubflow/git-hubflow.plugin.zsh
  26. +18 −0 plugins/git-remote-branch/git-remote-branch.plugin.zsh
  27. +29 −6 plugins/git/git.plugin.zsh
  28. +78 −0 plugins/gitfast/_git
  29. +2,483 −0 plugins/gitfast/git-completion.bash
  30. +290 −0 plugins/gitfast/git-prompt.sh
  31. +7 −0 plugins/gitfast/gitfast.plugin.zsh
  32. +1 −0 plugins/github/github.plugin.zsh
  33. +1 −0 plugins/heroku/_heroku
  34. +8 −0 plugins/history/history.plugin.zsh
  35. +25 −9 plugins/jira/jira.plugin.zsh
  36. +5 −1 plugins/knife/_knife
  37. +24 −0 plugins/last-working-dir/last-working-dir.plugin.zsh
  38. +1 −0 plugins/lol/lol.plugin.zsh
  39. +6 −0 plugins/mercurial/mercurial.plugin.zsh
  40. +167 −3 plugins/mvn/mvn.plugin.zsh
  41. +1 −1 plugins/node/node.plugin.zsh
  42. +60 −3 plugins/osx/osx.plugin.zsh
  43. +119 −0 plugins/pass/_pass
  44. +4 −3 plugins/per-directory-history/per-directory-history.plugin.zsh
  45. +6 −2 plugins/python/python.plugin.zsh
  46. +2 −0 plugins/rails/rails.plugin.zsh
  47. +4 −0 plugins/rsync/rsync.plugin.zsh
  48. +0 −147 plugins/rvm/_rvm
  49. +8 −1 plugins/rvm/rvm.plugin.zsh
  50. +1 −1 plugins/screen/screen.plugin.zsh
  51. +14 −2 plugins/sublime/sublime.plugin.zsh
  52. +25 −5 plugins/svn/svn.plugin.zsh
  53. +13 −0 plugins/symfony/symfony.plugin.zsh
  54. +3 −1 plugins/symfony2/symfony2.plugin.zsh
  55. +11 −0 plugins/systemd/systemd.plugin.zsh
  56. +35 −7 plugins/terminalapp/terminalapp.plugin.zsh
  57. +3 −0 plugins/themes/_theme
  58. +24 −0 plugins/themes/themes.plugin.zsh
  59. +29 −2 plugins/urltools/urltools.plugin.zsh
  60. +7 −0 plugins/vagrant/_vagrant
  61. +19 −6 plugins/vi-mode/vi-mode.plugin.zsh
  62. +35 −41 plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh
  63. +4 −1 templates/zshrc.zsh-template
  64. +26 −0 themes/adben.zsh-theme
  65. +1 −1 themes/agnoster.zsh-theme
  66. +37 −0 themes/candy-kingdom.zsh-theme
  67. +5 −1 themes/cloud.zsh-theme
  68. +1 −1 themes/fino-time.zsh-theme
  69. +5 −1 themes/fishy.zsh-theme
  70. +14 −2 themes/frisk.zsh-theme
  71. +12 −0 themes/frontcube.zsh-theme
  72. +5 −1 themes/gentoo.zsh-theme
  73. +24 −0 themes/intheloop.zsh-theme
  74. +2 −0 themes/jonathan.zsh-theme
  75. +34 −0 themes/junkfood.zsh-theme
  76. +6 −0 themes/kafeitu.zsh-theme
  77. +14 −11 themes/minimal.zsh-theme
  78. +2 −1 themes/mortalscumbag.zsh-theme
  79. +1 −1 themes/norm.zsh-theme
  80. +141 −0 themes/simonoff.zsh-theme
  81. +13 −0 themes/tjkirch_mod.zsh-theme
  82. +7 −1 tools/check_for_upgrade.sh
  83. +2 −3 tools/install.sh
  84. +13 −5 tools/uninstall.sh
View
@@ -26,17 +26,20 @@ h3. The manual way
@git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh@
-2. Create a new zsh config by copying the zsh template we've provided.
+2. *OPTIONAL* Backup your existing ~/.zshrc file
- *NOTE*: If you already have a ~/.zshrc file, you should back it up. @cp ~/.zshrc ~/.zshrc.orig@ in case you want to go back to your original settings.
+ @cp ~/.zshrc ~/.zshrc.orig@
+
+3. Create a new zsh config by copying the zsh template we've provided.
@cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc@
-3. Set zsh as your default shell:
+
+4. Set zsh as your default shell:
@chsh -s /bin/zsh@
-4. Start / restart zsh (open a new terminal is easy enough...)
+5. Start / restart zsh (open a new terminal is easy enough...)
h3. Problems?
View
@@ -8,6 +8,7 @@ alias -- -='cd -'
# Super user
alias _='sudo'
+alias please='sudo'
#alias g='grep -in'
@@ -16,8 +17,9 @@ alias history='fc -l 1'
# List direcory contents
alias lsa='ls -lah'
-alias l='ls -la'
+alias l='ls -lA1'
alias ll='ls -l'
+alias la='ls -lA'
alias sl=ls # often screw this up
alias afind='ack-grep -il'
View
@@ -32,7 +32,7 @@ zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-dir
cdpath=(.)
# use /etc/hosts and known_hosts for hostname completion
-[ -r /etc/ssh/ssh_known_hosts ] && _global_ssh_hosts=(${${${${(f)"$(</etc/ssh/ssh_known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _ssh_hosts=()
+[ -r /etc/ssh/ssh_known_hosts ] && _global_ssh_hosts=(${${${${(f)"$(</etc/ssh/ssh_known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _global_ssh_hosts=()
[ -r ~/.ssh/known_hosts ] && _ssh_hosts=(${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _ssh_hosts=()
[ -r /etc/hosts ] && : ${(A)_etc_hosts:=${(s: :)${(ps:\t:)${${(f)~~"$(</etc/hosts)"}%%\#*}##[:blank:]#[^[:blank:]]#}}} || _etc_hosts=()
hosts=(
View
@@ -26,9 +26,9 @@ cd () {
elif [[ "x$*" == "x...." ]]; then
cd ../../..
elif [[ "x$*" == "x....." ]]; then
- cd ../../..
- elif [[ "x$*" == "x......" ]]; then
cd ../../../..
+ elif [[ "x$*" == "x......" ]]; then
+ cd ../../../../..
else
builtin cd "$@"
fi
@@ -37,8 +37,3 @@ cd () {
alias md='mkdir -p'
alias rd=rmdir
alias d='dirs -v | head -10'
-
-# mkdir & cd to it
-function mcd() {
- mkdir -p "$1" && cd "$1";
-}
View
@@ -1,5 +1,5 @@
function zsh_stats() {
- history | awk '{print $2}' | sort | uniq -c | sort -rn | head
+ history | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n20
}
function uninstall_oh_my_zsh() {
View
@@ -1,6 +1,7 @@
# get the name of the branch we are on
function git_prompt_info() {
- ref=$(git symbolic-ref HEAD 2> /dev/null) || return
+ ref=$(git symbolic-ref HEAD 2> /dev/null) || \
+ ref=$(git rev-parse --short HEAD 2> /dev/null) || return
echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_SUFFIX"
}
@@ -18,6 +19,25 @@ parse_git_dirty() {
fi
}
+# get the difference between the local and remote branches
+git_remote_status() {
+ remote=${$(git rev-parse --verify ${hook_com[branch]}@{upstream} --symbolic-full-name 2>/dev/null)/refs\/remotes\/}
+ if [[ -n ${remote} ]] ; then
+ ahead=$(git rev-list ${hook_com[branch]}@{upstream}..HEAD 2>/dev/null | wc -l)
+ behind=$(git rev-list HEAD..${hook_com[branch]}@{upstream} 2>/dev/null | wc -l)
+
+ if [ $ahead -eq 0 ] && [ $behind -gt 0 ]
+ then
+ echo "$ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE"
+ elif [ $ahead -gt 0 ] && [ $behind -eq 0 ]
+ then
+ echo "$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE"
+ elif [ $ahead -gt 0 ] && [ $behind -gt 0 ]
+ then
+ echo "$ZSH_THEME_GIT_PROMPT_DIVERGED_REMOTE"
+ fi
+ fi
+}
# Checks if there are commits ahead from remote
function git_prompt_ahead() {
@@ -38,7 +58,7 @@ function git_prompt_long_sha() {
# Get the status of the working tree
git_prompt_status() {
- INDEX=$(git status --porcelain 2> /dev/null)
+ INDEX=$(git status --porcelain -b 2> /dev/null)
STATUS=""
if $(echo "$INDEX" | grep '^?? ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_UNTRACKED$STATUS"
@@ -60,18 +80,32 @@ git_prompt_status() {
fi
if $(echo "$INDEX" | grep '^ D ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS"
+ elif $(echo "$INDEX" | grep '^D ' &> /dev/null); then
+ STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS"
elif $(echo "$INDEX" | grep '^AD ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS"
fi
+ if $(git rev-parse --verify refs/stash >/dev/null 2>&1); then
+ STATUS="$ZSH_THEME_GIT_PROMPT_STASHED$STATUS"
+ fi
if $(echo "$INDEX" | grep '^UU ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_UNMERGED$STATUS"
fi
+ if $(echo "$INDEX" | grep '^## .*ahead' &> /dev/null); then
+ STATUS="$ZSH_THEME_GIT_PROMPT_AHEAD$STATUS"
+ fi
+ if $(echo "$INDEX" | grep '^## .*behind' &> /dev/null); then
+ STATUS="$ZSH_THEME_GIT_PROMPT_BEHIND$STATUS"
+ fi
+ if $(echo "$INDEX" | grep '^## .*diverged' &> /dev/null); then
+ STATUS="$ZSH_THEME_GIT_PROMPT_DIVERGED$STATUS"
+ fi
echo $STATUS
}
#compare the provided version of git to the version installed and on path
#prints 1 if input version <= installed version
-#prints -1 otherwise
+#prints -1 otherwise
function git_compare_version() {
local INPUT_GIT_VERSION=$1;
local INSTALLED_GIT_VERSION
View
@@ -9,5 +9,7 @@ bindkey "^[m" copy-prev-shell-word
setopt long_list_jobs
## pager
-export PAGER="less -R"
+export PAGER="less"
+export LESS="-R"
+
export LC_CTYPE=$LANG
View
@@ -1,5 +1,8 @@
-# get the name of the branch we are on
+# get the name of the ruby version
function rvm_prompt_info() {
- ruby_version=$(~/.rvm/bin/rvm-prompt 2> /dev/null) || return
- [[ ! -z $ruby_version ]] && echo "($ruby_version)"
+ [ -f $HOME/.rvm/bin/rvm-prompt ] || return
+ local rvm_prompt
+ rvm_prompt=$($HOME/.rvm/bin/rvm-prompt ${ZSH_THEME_RVM_PROMPT_OPTIONS} 2>/dev/null)
+ [[ "${rvm_prompt}x" == "x" ]] && return
+ echo "${ZSH_THEME_RVM_PROMPT_PREFIX:=(}${rvm_prompt}${ZSH_THEME_RVM_PROMPT_SUFFIX:=)}"
}
View
@@ -8,6 +8,8 @@ function title {
fi
if [[ "$TERM" == screen* ]]; then
print -Pn "\ek$1:q\e\\" #set screen hardstatus, usually truncated at 20 chars
+ elif [[ "$TERM_PROGRAM" == "Apple_Terminal" ]]; then
+ print -Pn "\e]1;$1:q\a" #set icon (=tab) name (will override window name on broken terminal)
elif [[ "$TERM" == xterm* ]] || [[ $TERM == rxvt* ]] || [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then
print -Pn "\e]2;$2:q\a" #set window name
print -Pn "\e]1;$1:q\a" #set icon (=tab) name (will override window name on broken terminal)
@@ -26,8 +28,8 @@ function omz_termsupport_precmd {
function omz_termsupport_preexec {
emulate -L zsh
setopt extended_glob
- local CMD=${1[(wr)^(*=*|sudo|ssh|-*)]} #cmd name only, or if this is sudo or ssh, the next cmd
- title "$CMD" "%100>...>$2%<<"
+ local CMD=${1[(wr)^(*=*|sudo|ssh|rake|-*)]} #cmd name only, or if this is sudo or ssh, the next cmd
+ title "$CMD" "%100>...>${2:gs/%/%%}%<<"
}
autoload -U add-zsh-hook
View
@@ -11,7 +11,9 @@ fpath=($ZSH/functions $ZSH/completions $fpath)
# Load all of the config files in ~/oh-my-zsh that end in .zsh
# TIP: Add files you don't want in git to .gitignore
-for config_file ($ZSH/lib/*.zsh) source $config_file
+for config_file ($ZSH/lib/*.zsh); do
+ source $config_file
+done
# Set ZSH_CUSTOM to the path where your custom config files
# and plugins exists, or else we will use the default custom/
@@ -51,7 +53,10 @@ for plugin ($plugins); do
done
# Load all of your custom configurations from custom/
-for config_file ($ZSH_CUSTOM/*.zsh(N)) source $config_file
+for config_file ($ZSH_CUSTOM/*.zsh(N)); do
+ source $config_file
+done
+unset config_file
# Load the theme
if [ "$ZSH_THEME" = "random" ]
@@ -11,7 +11,7 @@ if [[ -x `which yaourt` ]]; then
alias yaupg='yaourt -Syu' # Synchronize with repositories before upgrading packages that are out of date on the local system.
alias yasu='yaourt --sucre' # Same as yaupg, but without confirmation
alias yain='yaourt -S' # Install specific package(s) from the repositories
- alias yains='yaourt -U' # Install specific package not from the repositories but from a file
+ alias yains='yaourt -U' # Install specific package not from the repositories but from a file
alias yare='yaourt -R' # Remove the specified package(s), retaining its configuration(s) and required dependencies
alias yarem='yaourt -Rns' # Remove the specified package(s), its configuration(s) and unneeded dependencies
alias yarep='yaourt -Si' # Display information about a given package in the repositories
@@ -35,7 +35,7 @@ fi
# Pacman - https://wiki.archlinux.org/index.php/Pacman_Tips
alias pacupg='sudo pacman -Syu' # Synchronize with repositories before upgrading packages that are out of date on the local system.
alias pacin='sudo pacman -S' # Install specific package(s) from the repositories
-alias pacins='sudo pacman -U' # Install specific package not from the repositories but from a file
+alias pacins='sudo pacman -U' # Install specific package not from the repositories but from a file
alias pacre='sudo pacman -R' # Remove the specified package(s), retaining its configuration(s) and required dependencies
alias pacrem='sudo pacman -Rns' # Remove the specified package(s), its configuration(s) and unneeded dependencies
alias pacrep='pacman -Si' # Display information about a given package in the repositories
@@ -75,3 +75,19 @@ pacdisowned() {
comm -23 "$fs" "$db"
}
+
+pacmanallkeys() {
+ # Get all keys for developers and trusted users
+ curl https://www.archlinux.org/{developers,trustedusers}/ |
+ awk -F\" '(/pgp.mit.edu/) {sub(/.*search=0x/,"");print $1}' |
+ xargs sudo pacman-key --recv-keys
+}
+
+pacmansignkeys() {
+ for key in $*; do
+ sudo pacman-key --recv-keys $key
+ sudo pacman-key --lsign-key $key
+ printf 'trust\n3\n' | sudo gpg --homedir /etc/pacman.d/gnupg \
+ --no-permission-warning --command-fd 0 --edit-key $key
+ done
+}
@@ -3,9 +3,11 @@ if [ $commands[autojump] ]; then # check if autojump is installed
. /usr/share/autojump/autojump.zsh
elif [ -f /etc/profile.d/autojump.zsh ]; then # manual installation
. /etc/profile.d/autojump.zsh
+ elif [ -f $HOME/.autojump/etc/profile.d/autojump.zsh ]; then # manual user-local installation
+ . $HOME/.autojump/etc/profile.d/autojump.zsh
elif [ -f /opt/local/etc/profile.d/autojump.zsh ]; then # mac os x with ports
. /opt/local/etc/profile.d/autojump.zsh
- elif [ $commands[brew] -a -f `brew --prefix`/etc/autojump ]; then # mac os x with brew
- . `brew --prefix`/etc/autojump
+ elif [ $commands[brew] -a -f `brew --prefix`/etc/autojump.zsh ]; then # mac os x with brew
+ . `brew --prefix`/etc/autojump.zsh
fi
fi
@@ -1,20 +1,71 @@
-if [[ $(acpi 2&>/dev/null | grep -c '^Battery.*Discharging') -gt 0 ]] ; then
- function battery_pct_remaining() { echo "$(acpi | cut -f2 -d ',' | tr -cd '[:digit:]')" }
- function battery_time_remaining() { echo $(acpi | cut -f3 -d ',') }
- function battery_pct_prompt() {
- b=$(battery_pct_remaining)
- if [ $b -gt 50 ] ; then
- color='green'
- elif [ $b -gt 20 ] ; then
- color='yellow'
+###########################################
+# Battery plugin for oh-my-zsh #
+# Original Author: Peter hoeg (peterhoeg) #
+# Email: peter@speartail.com #
+###########################################
+# Author: Sean Jones (neuralsandwich) #
+# Email: neuralsandwich@gmail.com #
+# Modified to add support for Apple Mac #
+###########################################
+
+if [[ $(uname) == "Darwin" ]] ; then
+
+ function battery_pct_remaining() {
+ if [[ $(ioreg -rc AppleSmartBattery | grep -c '^.*"ExternalConnected"\ =\ No') -eq 1 ]] ; then
+ typeset -F maxcapacity=$(ioreg -rc "AppleSmartBattery"| grep '^.*"MaxCapacity"\ =\ ' | sed -e 's/^.*"MaxCapacity"\ =\ //')
+ typeset -F currentcapacity=$(ioreg -rc "AppleSmartBattery"| grep '^.*"CurrentCapacity"\ =\ ' | sed -e 's/^.*CurrentCapacity"\ =\ //')
+ integer i=$(((currentcapacity/maxcapacity) * 100))
+ echo $i
else
- color='red'
+ echo "External Power"
fi
- echo "%{$fg[$color]%}[$(battery_pct_remaining)%%]%{$reset_color%}"
}
-else
- error_msg='no battery'
- function battery_pct_remaining() { echo $error_msg }
- function battery_time_remaining() { echo $error_msg }
- function battery_pct_prompt() { echo '' }
+
+ function battery_time_remaining() {
+ if [[ $(ioreg -rc AppleSmartBattery | grep -c '^.*"ExternalConnected"\ =\ No') -eq 1 ]] ; then
+ timeremaining=$(ioreg -rc "AppleSmartBattery"| grep '^.*"AvgTimeToEmpty"\ =\ ' | sed -e 's/^.*"AvgTimeToEmpty"\ =\ //')
+ echo "~$((timeremaining / 60)):$((timeremaining % 60))"
+ else
+ echo ""
+ fi
+ }
+
+ function battery_pct_prompt () {
+ if [[ $(ioreg -rc AppleSmartBattery | grep -c '^.*"ExternalConnected"\ =\ No') -eq 1 ]] ; then
+ b=$(battery_pct_remaining)
+ if [ $b -gt 50 ] ; then
+ color='green'
+ elif [ $b -gt 20 ] ; then
+ color='yellow'
+ else
+ color='red'
+ fi
+ echo "%{$fg[$color]%}[$(battery_pct_remaining)%%]%{$reset_color%}"
+ else
+ echo ""
+ fi
+ }
+
+elif [[ $(uname) == "Linux" ]] ; then
+
+ if [[ $(acpi 2&>/dev/null | grep -c '^Battery.*Discharging') -gt 0 ]] ; then
+ function battery_pct_remaining() { echo "$(acpi | cut -f2 -d ',' | tr -cd '[:digit:]')" }
+ function battery_time_remaining() { echo $(acpi | cut -f3 -d ',') }
+ function battery_pct_prompt() {
+ b=$(battery_pct_remaining)
+ if [ $b -gt 50 ] ; then
+ color='green'
+ elif [ $b -gt 20 ] ; then
+ color='yellow'
+ else
+ color='red'
+ fi
+ echo "%{$fg[$color]%}[$(battery_pct_remaining)%%]%{$reset_color%}"
+ }
+ else
+ error_msg='no battery'
+ function battery_pct_remaining() { echo $error_msg }
+ function battery_time_remaining() { echo $error_msg }
+ function battery_pct_prompt() { echo '' }
+ fi
fi
@@ -6,7 +6,7 @@ alias bu="bundle update"
# The following is based on https://github.com/gma/bundler-exec
-bundled_commands=(annotate cap capify cucumber foreman guard middleman nanoc rackup rainbows rake rspec ruby shotgun spec spork thin thor unicorn unicorn_rails puma)
+bundled_commands=(annotate cap capify cucumber foreman guard middleman nanoc rackup rainbows rake rspec ruby shotgun spec spork thin thor unicorn unicorn_rails puma zeus)
## Functions
@@ -0,0 +1,13 @@
+#
+# Requires http://www.bruji.com/bwana/
+#
+if [[ -e /Applications/Bwana.app ]] ||
+ ( system_profiler -detailLevel mini SPApplicationsDataType | grep -q Bwana )
+then
+ function man() {
+ open "man:$1"
+ }
+else
+ echo "Bwana lets you read man files in Safari through a man: URI scheme"
+ echo "To use it within Zsh, install it from http://www.bruji.com/bwana/"
+fi
Oops, something went wrong.

0 comments on commit 3c9e351

Please sign in to comment.