Permalink
Browse files

Merge with upstream.

  • Loading branch information...
sjl committed Jun 3, 2011
2 parents 3e67320 + 3ed19c4 commit b17f99763dc3096cc4702be8933921f1c72d1808
Showing with 2,631 additions and 127 deletions.
  1. +1 −1 .gitignore
  2. +12 −8 README.textile
  3. +0 −3 lib/completion.zsh
  4. +5 −1 lib/directories.zsh
  5. +36 −0 lib/functions.zsh
  6. +23 −2 lib/git.zsh
  7. +9 −2 lib/key-bindings.zsh
  8. +29 −0 lib/termsupport.zsh
  9. +0 −2 lib/{appearance.zsh → theme-and-appearance.zsh}
  10. +32 −4 oh-my-zsh.sh
  11. +26 −0 plugins/ant/ant.plugin.zsh
  12. +6 −0 plugins/apache2-macports/apache2-macports.plugin.zsh
  13. +3 −0 plugins/autojump/autojump.plugin.zsh
  14. +18 −7 plugins/brew/_brew
  15. +1 −4 plugins/brew/brew.plugin.zsh
  16. +3 −0 plugins/bundler/bundler.plugin.zsh
  17. +1 −1 plugins/cap/cap.plugin.zsh
  18. +20 −0 plugins/compleat/compleat.plugin.zsh
  19. +67 −0 plugins/cpanm/_cpanm
  20. +13 −0 plugins/deb/deb.plugin.zsh
  21. +60 −0 plugins/debian/debian.plugin.zsh
  22. +0 −4 plugins/gem/gem.plugin.zsh
  23. +332 −0 plugins/git-flow/git-flow.plugin.zsh
  24. +22 −4 plugins/git/git.plugin.zsh
  25. +6 −4 plugins/github/github.plugin.zsh
  26. +26 −0 plugins/gpg-agent/gpg-agent.plugin.zsh
  27. +27 −0 plugins/lein/lein.plugin.zsh
  28. +26 −0 plugins/lol/lol.plugin.zsh
  29. +89 −0 plugins/macports/_port
  30. +1 −0 plugins/macports/macports.plugin.zsh
  31. +8 −0 plugins/mysql-macports/mysql-macports.plugin.zsh
  32. +0 −6 plugins/mysql/mysql-macports.plugin.zsh
  33. +5 −0 plugins/node/node.plugin.zsh
  34. +19 −0 plugins/npm/_npm
  35. +58 −6 plugins/osx/osx.plugin.zsh
  36. +62 −0 plugins/perl/perl.plugin.zsh
  37. +0 −1 plugins/phing/phing.plugin.zsh
  38. +0 −4 plugins/pip/pip.plugin.zsh
  39. +10 −0 plugins/pow/pow.plugin.zsh
  40. +30 −0 plugins/rails3/rails3.plugin.zsh
  41. +142 −0 plugins/redis-cli/_redis-cli
  42. +3 −1 plugins/ruby/ruby.plugin.zsh
  43. +147 −0 plugins/rvm/_rvm
  44. +44 −0 plugins/rvm/rvm.plugin.zsh
  45. +1 −1 plugins/ssh-agent/ssh-agent.plugin.zsh
  46. +42 −0 plugins/svn/svn.plugin.zsh
  47. +5 −7 plugins/textmate/textmate.plugin.zsh
  48. +4 −0 plugins/thor/_thor
  49. +0 −3 plugins/vagrant/vagrant.plugin.zsh
  50. +12 −0 plugins/yum/yum.plugin.zsh
  51. +6 −1 templates/zshrc.zsh-template
  52. +83 −3 themes/Soliah.zsh-theme
  53. +1 −1 themes/afowler.zsh-theme
  54. +22 −0 themes/alanpeabody.zsh-theme
  55. +1 −1 themes/arrow.zsh-theme
  56. +18 −0 themes/awesomepanda.zsh-theme
  57. +1 −1 themes/bira.zsh-theme
  58. +1 −1 themes/clean.zsh-theme
  59. +56 −0 themes/dieter.zsh-theme
  60. +85 −0 themes/dogenpunk.zsh-theme
  61. +1 −1 themes/dst.zsh-theme
  62. +20 −0 themes/fishy.zsh-theme
  63. +19 −0 themes/flazz.zsh-theme
  64. +10 −0 themes/frisk.zsh-theme
  65. +6 −0 themes/fwalch.zsh-theme
  66. +19 −0 themes/gallois.zsh-theme
  67. +26 −0 themes/humza.zsh-theme
  68. +4 −0 themes/jispwoso.zsh-theme
  69. +137 −0 themes/jonathan.zsh-theme
  70. +1 −1 themes/jreese.zsh-theme
  71. +8 −0 themes/jtriley.zsh-theme
  72. +46 −0 themes/juanghurtado.zsh-theme
  73. +21 −0 themes/kolo.zsh-theme
  74. +50 −0 themes/kphoen.zsh-theme
  75. +6 −0 themes/lambda.zsh-theme
  76. +8 −0 themes/miloshadzic.zsh-theme
  77. +15 −0 themes/minimal.zsh-theme
  78. +14 −0 themes/murilasso.zsh-theme
  79. +30 −0 themes/muse.zsh-theme
  80. +7 −0 themes/nanotech.zsh-theme
  81. +17 −0 themes/nebirhos.zsh-theme
  82. +43 −0 themes/nicoulaj.zsh-theme
  83. +11 −0 themes/obraun.zsh-theme
  84. +1 −1 themes/philips.zsh-theme
  85. +1 −1 themes/pmcgee.zsh-theme
  86. +15 −0 themes/re5et.zsh-theme
  87. +24 −0 themes/rixius.zsh-theme
  88. +6 −0 themes/simple.zsh-theme
  89. +48 −0 themes/sorin.zsh-theme
  90. +100 −0 themes/steeef.zsh-theme
  91. +26 −0 themes/sunaku.zsh-theme
  92. +14 −4 themes/theunraveler.zsh-theme
  93. +0 −29 themes/thomasjbradley.zsh-theme
  94. +15 −0 themes/tjkirch.zsh-theme
  95. +95 −0 themes/trapd00r.zsh-theme
  96. +6 −5 tools/check_for_upgrade.sh
  97. +1 −1 tools/install.sh
View
@@ -3,7 +3,7 @@ log/.zsh_history
projects.zsh
custom
custom/*.zsh
-!custom/example.zsh
*.un~
+cache
.DS_Store
View
@@ -48,22 +48,26 @@ the "refcard":http://www.bash2zsh.com/zsh_refcard/refcard.pdf is pretty tasty fo
h3. Customization
If you want to override any of the default behavior, just add a new file (ending in @.zsh@) into the @custom/@ directory.
-If you have many functions which go good together you can put them as a *.plugin.zsh file in the @plugin/@ directory and then enable this plugin.
+If you have many functions which go good together you can put them as a *.plugin.zsh file in the @custom/plugins/@ directory and then enable this plugin.
+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/@.
+
h3. Uninstalling
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).
-h2. Thanks
-
-* Rick Olson (technoweenie) might remember some of the configuration, which I took from a pastie a few years ago.
-* Marcel (noradio) provided Rick the original zsh configuration.
-* Nicholas (ulysses) for the "rake autocompletion code":http://weblog.rubyonrails.org/2006/3/9/fast-rake-task-completion-for-zsh.
-
h2. Help out!
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!
h3. Send us your theme!
-I'm hoping to collect a bunch of themes for our command prompts. You can see existing ones in the @themes/@ directory.
+I'm hoping to collect a bunch of themes for our command prompts. You can see existing ones in the @themes/@ directory.
+
+h2. Contributors
+
+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
+
+Thank you so much!
View
@@ -6,9 +6,6 @@ unsetopt always_to_end
WORDCHARS=''
-autoload -U compinit
-compinit -i
-
zmodload -i zsh/complist
# case-insensitive (all), partial-word and then substring completion
View
@@ -30,7 +30,6 @@ cd () {
alias md='mkdir -p'
alias rd=rmdir
-
alias d='dirs -v'
# List direcory contents
@@ -44,3 +43,8 @@ alias ll3='tree --dirsfirst -ChFupDaL 3'
alias l='l1'
alias ll='ll1'
+
+# mkdir & cd to it
+function mcd() {
+ mkdir -p "$1" && cd "$1";
+}
View
@@ -9,3 +9,39 @@ function uninstall_oh_my_zsh() {
function upgrade_oh_my_zsh() {
/bin/sh $ZSH/tools/upgrade.sh
}
+
+function extract() {
+ unset REMOVE_ARCHIVE
+
+ if test "$1" = "-r"; then
+ REMOVE=1
+ shift
+ fi
+ if [[ -f $1 ]]; then
+ case $1 in
+ *.tar.bz2) tar xvjf $1;;
+ *.tar.gz) tar xvzf $1;;
+ *.tar.xz) tar xvJf $1;;
+ *.tar.lzma) tar --lzma -xvf $1;;
+ *.bz2) bunzip $1;;
+ *.rar) unrar x $1;;
+ *.gz) gunzip $1;;
+ *.tar) tar xvf $1;;
+ *.tbz2) tar xvjf $1;;
+ *.tgz) tar xvzf $1;;
+ *.zip) unzip $1;;
+ *.Z) uncompress $1;;
+ *.7z) 7z x $1;;
+ *) echo "'$1' cannot be extracted via >extract<";;
+ esac
+
+ if [[ $REMOVE_ARCHIVE -eq 1 ]]; then
+ echo removing "$1";
+ /bin/rm "$1";
+ fi
+
+ else
+ echo "'$1' is not a valid file"
+ fi
+}
+
View
@@ -20,6 +20,13 @@ parse_git_dirty () {
fi
}
+# Checks if there are commits ahead from remote
+function git_prompt_ahead() {
+ if $(echo "$(git log origin/$(current_branch)..HEAD 2> /dev/null)" | grep '^commit' &> /dev/null); then
+ echo "$ZSH_THEME_GIT_PROMPT_AHEAD"
+ fi
+}
+
#
# Will return the current branch name
# Usage example: git pull origin $(current_branch)
@@ -29,7 +36,17 @@ function current_branch() {
echo ${ref#refs/heads/}
}
-# get the status of the working tree
+# Formats prompt string for current git commit short SHA
+function git_prompt_short_sha() {
+ SHA=$(git rev-parse --short HEAD 2> /dev/null) && echo "$ZSH_THEME_GIT_PROMPT_SHA_BEFORE$SHA$ZSH_THEME_GIT_PROMPT_SHA_AFTER"
+}
+
+# Formats prompt string for current git commit long SHA
+function git_prompt_long_sha() {
+ SHA=$(git rev-parse HEAD 2> /dev/null) && echo "$ZSH_THEME_GIT_PROMPT_SHA_BEFORE$SHA$ZSH_THEME_GIT_PROMPT_SHA_AFTER"
+}
+
+# Get the status of the working tree
git_prompt_status() {
INDEX=$(git status --porcelain 2> /dev/null)
STATUS=""
@@ -43,11 +60,15 @@ git_prompt_status() {
fi
if $(echo "$INDEX" | grep '^ M ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_MODIFIED$STATUS"
+ elif $(echo "$INDEX" | grep '^AM ' &> /dev/null); then
+ STATUS="$ZSH_THEME_GIT_PROMPT_MODIFIED$STATUS"
+ elif $(echo "$INDEX" | grep '^ T ' &> /dev/null); then
+ STATUS="$ZSH_THEME_GIT_PROMPT_MODIFIED$STATUS"
fi
if $(echo "$INDEX" | grep '^R ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_RENAMED$STATUS"
fi
- if $(echo "$INDEX" | grep '^ D ' &> /dev/null); then
+ if $(echo "$INDEX" | grep '^D ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS"
fi
if $(echo "$INDEX" | grep '^UU ' &> /dev/null); then
View
@@ -1,6 +1,4 @@
# TODO: Explain what some of this does..
-autoload -U compinit
-compinit -i
bindkey -e
bindkey '\ew' kill-region
@@ -21,3 +19,12 @@ bindkey "^[[4~" end-of-line
bindkey ' ' magic-space # also do history expansion on space
bindkey '^[[Z' reverse-menu-complete
+
+# Make the delete key (or Fn + Delete on the Mac) work instead of outputting a ~
+bindkey "^[[3~" delete-char
+bindkey "^[3;5~" delete-char
+bindkey "\e[3~" delete-char
+
+## Fix weird sequence that rxvt produces
+#bindkey -s '^[[Z' '\t'
+#
View
@@ -0,0 +1,29 @@
+#usage: title short_tab_title looooooooooooooooooooooggggggg_windows_title
+#http://www.faqs.org/docs/Linux-mini/Xterm-Title.html#ss3.1
+#Fully support screen, iterm, and probably most modern xterm and rxvt
+#Limited support for Apple Terminal (Terminal can't set window or tab separately)
+function title {
+ [ "$DISABLE_AUTO_TITLE" != "true" ] || return
+ if [[ "$TERM" == screen* ]]; then
+ print -Pn "\ek$1:q\e\\" #set screen hardstatus, usually truncated at 20 chars
+ 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)
+ fi
+}
+
+ZSH_THEME_TERM_TAB_TITLE_IDLE="%15<..<%~%<<" #15 char left truncated PWD
+ZSH_THEME_TERM_TITLE_IDLE="%n@%m: %~"
+
+#Appears when you have the prompt
+function precmd {
+ title $ZSH_THEME_TERM_TAB_TITLE_IDLE $ZSH_THEME_TERM_TITLE_IDLE
+}
+
+#Appears at the beginning of (and during) of command execution
+function 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%<<"
+}
@@ -33,5 +33,3 @@ ZSH_THEME_GIT_PROMPT_CLEAN="" # Text to display if the branch is c
# Setup the prompt with pretty colors
setopt prompt_subst
-# Load the theme
-source "$ZSH/themes/$ZSH_THEME.zsh-theme"
View
@@ -1,18 +1,46 @@
# Initializes Oh My Zsh
# add a function path
-fpath=($ZSH/functions $fpath)
+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
+# Add all defined plugins to fpath
+plugin=${plugin:=()}
+for plugin ($plugins) fpath=($ZSH/plugins/$plugin $fpath)
+
+# Load and run compinit
+autoload -U compinit
+compinit -i
+
+# Load all of the plugins that were defined in ~/.zshrc
+for plugin ($plugins); do
+ if [ -f $ZSH/custom/plugins/$plugin/$plugin.plugin.zsh ]; then
+ source $ZSH/custom/plugins/$plugin/$plugin.plugin.zsh
+ elif [ -f $ZSH/plugins/$plugin/$plugin.plugin.zsh ]; then
+ source $ZSH/plugins/$plugin/$plugin.plugin.zsh
+ fi
+done
+
# Load all of your custom configurations from custom/
for config_file ($ZSH/custom/*.zsh) source $config_file
-# Load all of the plugins that were defined in ~/.zshrc
-plugin=${plugin:=()}
-for plugin ($plugins) source $ZSH/plugins/$plugin/$plugin.plugin.zsh
+# Load the theme
+# Check for updates on initial load...
+if [ "$ZSH_THEME" = "random" ]
+then
+ themes=($ZSH/themes/*zsh-theme)
+ N=${#themes[@]}
+ ((N=(RANDOM%N)+1))
+ RANDOM_THEME=${themes[$N]}
+ source "$RANDOM_THEME"
+ echo "[oh-my-zsh] Random theme '$RANDOM_THEME' loaded..."
+else
+ source "$ZSH/themes/$ZSH_THEME.zsh-theme"
+fi
+
# Check for updates on initial load...
if [ "$DISABLE_AUTO_UPDATE" = "true" ]
View
@@ -0,0 +1,26 @@
+stat -f%m . > /dev/null 2>&1
+if [ "$?" = 0 ]; then
+ stat_cmd=(stat -f%m)
+else
+ stat_cmd=(stat -L --format=%Y)
+fi
+
+_ant_does_target_list_need_generating () {
+ if [ ! -f .ant_targets ]; then return 0;
+ else
+ accurate=$($stat_cmd .ant_targets)
+ changed=$($stat_cmd build.xml)
+ return $(expr $accurate '>=' $changed)
+ fi
+}
+
+_ant () {
+ if [ -f build.xml ]; then
+ if _ant_does_target_list_need_generating; then
+ sed -n '/<target/s/<target.*name="\([^"]*\).*$/\1/p' build.xml > .ant_targets
+ fi
+ compadd `cat .ant_targets`
+ fi
+}
+
+compdef _ant ant
@@ -0,0 +1,6 @@
+# commands to control local apache2 server installation
+# paths are for osx installation via macports
+
+alias apache2start='sudo /opt/local/etc/LaunchDaemons/org.macports.apache2/apache2.wrapper start'
+alias apache2stop='sudo /opt/local/etc/LaunchDaemons/org.macports.apache2/apache2.wrapper stop'
+alias apache2restart='sudo /opt/local/etc/LaunchDaemons/org.macports.apache2/apache2.wrapper restart'
@@ -0,0 +1,3 @@
+if [ -f `brew --prefix`/etc/autojump ]; then
+ . `brew --prefix`/etc/autojump
+fi
View
@@ -25,20 +25,27 @@ _1st_arguments=(
'link:link a formula'
'list:list files in a formula or not-installed formulae'
'log:git commit log for a formula'
+ 'missing:check all installed formuale for missing dependencies.'
'outdated:list formulas for which a newer version is available'
'prune:remove dead links'
'remove:remove a formula'
'search:search for a formula (/regex/ or string)'
+ 'server:start a local web app that lets you browse formulae (requires Sinatra)'
'unlink:unlink a formula'
'update:freshen up links'
+ 'upgrade:upgrade outdated formulae'
'uses:show formulas which depend on a formula'
)
local expl
-local -a formula installed_formulae
+local -a formulae installed_formulae
_arguments \
- '(-v --verbose)'{-v,--verbose}'[verbose]' \
+ '(-v)-v[verbose]' \
+ '(--cellar)--cellar[brew cellar]' \
+ '(--config)--config[brew configuration]' \
+ '(--env)--env[brew environment]' \
+ '(--repository)--repository[brew repository]' \
'(--version)--version[version information]' \
'(--prefix)--prefix[where brew lives on this system]' \
'(--cache)--cache[brew cache]' \
@@ -50,20 +57,24 @@ if (( CURRENT == 1 )); then
fi
case "$words[1]" in
- list)
+ search|-S)
+ _arguments \
+ '(--macports)--macports[search the macports repository]' \
+ '(--fink)--fink[search the fink repository]' ;;
+ list|ls)
_arguments \
'(--unbrewed)--unbrewed[files in brew --prefix not controlled by brew]' \
+ '(--versions)--versions[list all installed versions of a formula]' \
'1: :->forms' && return 0
if [[ "$state" == forms ]]; then
_brew_installed_formulae
- _requested installed_formulae expl 'installed formulae' compadd -a installed_formulae
+ _wanted installed_formulae expl 'installed formulae' compadd -a installed_formulae
fi ;;
- install|home|log|info|uses|cat|deps)
+ install|home|homepage|log|info|abv|uses|cat|deps|edit|options)
_brew_all_formulae
_wanted formulae expl 'all formulae' compadd -a formulae ;;
- remove|edit|xo)
+ remove|rm|uninstall|unlink|cleanup|link|ln)
_brew_installed_formulae
_wanted installed_formulae expl 'installed formulae' compadd -a installed_formulae ;;
esac
-
@@ -1,4 +1 @@
-# add brew completion function to path
-fpath=($ZSH/plugins/brew $fpath)
-autoload -U compinit
-compinit -i
+alias brews='brew list -1'
@@ -0,0 +1,3 @@
+alias be="bundle exec"
+alias bi="bundle install"
+alias bu="bundle update"
@@ -18,4 +18,4 @@ function _cap () {
fi
}
-compctl -K _cap cap
+compctl -K _cap cap
Oops, something went wrong.

0 comments on commit b17f997

Please sign in to comment.