Permalink
Browse files

Merge in recent stuff

  • Loading branch information...
2 parents a15a8c4 + a738ca9 commit 0ba398f9e1aaf05e72406d5c840f013eebb6b260 @loopj committed Aug 1, 2011
Showing with 4,084 additions and 272 deletions.
  1. +4 −1 .gitignore
  2. +13 −9 README.textile
  3. +2 −0 custom/example/example.plugin.zsh
  4. +0 −1 lib/aliases.zsh
  5. +0 −4 lib/completion.zsh
  6. +3 −0 lib/edit-command-line.zsh
  7. +0 −35 lib/functions.zsh
  8. +22 −3 lib/git.zsh
  9. +6 −2 lib/key-bindings.zsh
  10. +1 −1 lib/misc.zsh
  11. +8 −0 lib/spectrum.zsh
  12. +8 −5 lib/termsupport.zsh
  13. +36 −11 oh-my-zsh.sh
  14. +26 −0 plugins/ant/ant.plugin.zsh
  15. +6 −0 plugins/apache2-macports/apache2-macports.plugin.zsh
  16. +76 −0 plugins/archlinux/archlinux.plugin.zsh
  17. +3 −0 plugins/autojump/autojump.plugin.zsh
  18. +18 −7 plugins/brew/_brew
  19. +1 −4 plugins/brew/brew.plugin.zsh
  20. +34 −0 plugins/bundler/bundler.plugin.zsh
  21. +32 −0 plugins/cake/cake.plugin.zsh
  22. +1 −1 plugins/cap/cap.plugin.zsh
  23. +2 −0 plugins/cloudapp/cloudapp.plugin.zsh
  24. +60 −0 plugins/cloudapp/cloudapp.rb
  25. +20 −0 plugins/compleat/compleat.plugin.zsh
  26. +0 −4 plugins/cpanm/cpanm.plugin.zsh
  27. +1 −0 plugins/deb/deb.plugin.zsh
  28. +222 −0 plugins/django/django.plugin.zsh
  29. +8 −0 plugins/extract/_extract
  30. +85 −0 plugins/extract/extract.plugin.zsh
  31. +34 −0 plugins/gas/_gas
  32. +0 −4 plugins/gem/gem.plugin.zsh
  33. +332 −0 plugins/git-flow/git-flow.plugin.zsh
  34. +23 −2 plugins/git/git.plugin.zsh
  35. +6 −4 plugins/github/github.plugin.zsh
  36. +26 −0 plugins/gpg-agent/gpg-agent.plugin.zsh
  37. +7 −0 plugins/history-substring-search/README
  38. +12 −0 plugins/history-substring-search/history-substring-search.plugin.zsh
  39. +642 −0 plugins/history-substring-search/history-substring-search.zsh
  40. +9 −0 plugins/kate/kate.plugin.zsh
  41. +174 −0 plugins/knife/_knife
  42. +27 −0 plugins/lein/lein.plugin.zsh
  43. +0 −4 plugins/macports/macports.plugin.zsh
  44. +8 −0 plugins/mysql-macports/mysql-macports.plugin.zsh
  45. +0 −6 plugins/mysql/mysql-macports.plugin.zsh
  46. +5 −0 plugins/node/node.plugin.zsh
  47. +19 −0 plugins/npm/_npm
  48. +5 −0 plugins/osx/_man-preview
  49. +86 −44 plugins/osx/osx.plugin.zsh
  50. +0 −1 plugins/phing/phing.plugin.zsh
  51. +0 −4 plugins/pip/pip.plugin.zsh
  52. +10 −0 plugins/pow/pow.plugin.zsh
  53. +17 −8 plugins/rails3/rails3.plugin.zsh
  54. +142 −0 plugins/redis-cli/_redis-cli
  55. +3 −1 plugins/ruby/ruby.plugin.zsh
  56. +147 −0 plugins/rvm/_rvm
  57. +44 −0 plugins/rvm/rvm.plugin.zsh
  58. +52 −13 plugins/ssh-agent/ssh-agent.plugin.zsh
  59. +6 −6 plugins/svn/svn.plugin.zsh
  60. +280 −0 plugins/taskwarrior/_task
  61. +21 −0 plugins/taskwarrior/taskwarrior.plugin.zsh
  62. +5 −7 plugins/textmate/textmate.plugin.zsh
  63. +4 −0 plugins/thor/_thor
  64. +0 −3 plugins/vagrant/vagrant.plugin.zsh
  65. +12 −0 plugins/yum/yum.plugin.zsh
  66. +11 −6 templates/zshrc.zsh-template
  67. +28 −5 themes/Soliah.zsh-theme
  68. +22 −0 themes/alanpeabody.zsh-theme
  69. +1 −1 themes/bira.zsh-theme
  70. +20 −0 themes/blinks.zsh-theme
  71. +85 −0 themes/dogenpunk.zsh-theme
  72. +14 −0 themes/dpoggi.zsh-theme
  73. +14 −3 themes/fishy.zsh-theme
  74. +10 −0 themes/frisk.zsh-theme
  75. +6 −0 themes/fwalch.zsh-theme
  76. +19 −0 themes/gallois.zsh-theme
  77. +26 −0 themes/humza.zsh-theme
  78. +4 −0 themes/jispwoso.zsh-theme
  79. +137 −0 themes/jonathan.zsh-theme
  80. +8 −0 themes/jtriley.zsh-theme
  81. +46 −0 themes/juanghurtado.zsh-theme
  82. +21 −0 themes/kolo.zsh-theme
  83. +50 −0 themes/kphoen.zsh-theme
  84. +15 −1 themes/lukerandall.zsh-theme
  85. +8 −0 themes/miloshadzic.zsh-theme
  86. +15 −0 themes/minimal.zsh-theme
  87. +14 −0 themes/murilasso.zsh-theme
  88. +30 −0 themes/muse.zsh-theme
  89. +17 −0 themes/nebirhos.zsh-theme
  90. +11 −0 themes/obraun.zsh-theme
  91. +2 −2 themes/philips.zsh-theme
  92. +15 −0 themes/re5et.zsh-theme
  93. +6 −0 themes/simple.zsh-theme
  94. +91 −0 themes/smt.zsh-theme
  95. +100 −0 themes/steeef.zsh-theme
  96. +26 −0 themes/sunaku.zsh-theme
  97. +96 −0 themes/sunrise.zsh-theme
  98. +18 −0 themes/superjarin.zsh-theme
  99. +9 −0 themes/terminalparty.zsh-theme
  100. +0 −29 themes/thomasjbradley.zsh-theme
  101. +95 −0 themes/trapd00r.zsh-theme
  102. +107 −0 themes/wedisagree.zsh-theme
  103. +5 −4 tools/check_for_upgrade.sh
  104. +16 −16 tools/install.sh
  105. +10 −10 tools/upgrade.sh
View
@@ -2,4 +2,7 @@ locals.zsh
log/.zsh_history
projects.zsh
custom/*
-!custom/example.zsh
+!custom/example
+!custom/example.zsh
+cache
+*.swp
View
@@ -8,7 +8,7 @@ h2. Setup
h3. The automatic installer... (do you trust me?)
-@wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh@
+@wget --no-check-certificate https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh@
h3. The manual way
@@ -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!
@@ -0,0 +1,2 @@
+# Add your own custom plugins in the custom/plugins directory. Plugins placed
+# here will override ones with the same name in the main plugins directory.
View
@@ -22,4 +22,3 @@ alias sl=ls # often screw this up
alias afind='ack-grep -il'
-alias x=extract
View
@@ -4,14 +4,10 @@ unsetopt menu_complete # do not autoselect the first completion entry
unsetopt flowcontrol
setopt auto_menu # show completion menu on succesive tab press
setopt complete_in_word
-setopt complete_aliases
setopt always_to_end
WORDCHARS=''
-autoload -U compinit
-compinit -i
-
zmodload -i zsh/complist
## case-insensitive (all),partial-word and then substring completion
@@ -0,0 +1,3 @@
+autoload -U edit-command-line
+zle -N edit-command-line
+bindkey '\C-x\C-e' edit-command-line
View
@@ -15,38 +15,3 @@ function take() {
cd $1
}
-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 $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
@@ -4,8 +4,8 @@ function git_prompt_info() {
echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_SUFFIX"
}
-# get dirty status of the current working tree
-parse_git_dirty () {
+# Checks if working tree is dirty
+parse_git_dirty() {
if [[ -n $(git status -s 2> /dev/null) ]]; then
echo "$ZSH_THEME_GIT_PROMPT_DIRTY"
else
@@ -33,7 +33,24 @@ git_remote_status() {
fi
}
-# get the status of the working tree
+# 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
+}
+
+# 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=""
@@ -57,6 +74,8 @@ git_prompt_status() {
fi
if $(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 $(echo "$INDEX" | grep '^UU ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_UNMERGED$STATUS"
View
@@ -1,6 +1,4 @@
# TODO: Explain what some of this does..
-autoload -U compinit
-compinit -i
bindkey -e
bindkey '\ew' kill-region
@@ -22,6 +20,12 @@ 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 '^?' backward-delete-char
+bindkey "^[[3~" delete-char
+bindkey "^[3;5~" delete-char
+bindkey "\e[3~" delete-char
+
# consider emacs keybindings:
#bindkey -e ## emacs key bindings
View
@@ -10,4 +10,4 @@ setopt long_list_jobs
## pager
export PAGER=less
-export LC_CTYPE=en_US.UTF-8
+export LC_CTYPE=$LANG
View
@@ -18,3 +18,11 @@ for color in {000..255}; do
FG[$color]="%{[38;5;${color}m%}"
BG[$color]="%{[48;5;${color}m%}"
done
+
+# Show all 256 colors with color number
+function spectrum_ls() {
+ for code in {000..255}; do
+ print -P -- "$code: %F{$code}Test%f"
+ done
+}
+
View
@@ -3,11 +3,12 @@
#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 {
- if [[ "$TERM" == "screen" ]]; then
- print -Pn "\ek$1\e\\" #set screen hardstatus, usually truncated at 20 chars
- elif [[ ($TERM =~ "^xterm") ]] || [[ ($TERM == "rxvt") ]] || [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then
- print -Pn "\e]2;$2\a" #set window name
- print -Pn "\e]1;$1\a" #set icon (=tab) name (will override window name on broken terminal)
+ [ "$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
}
@@ -21,6 +22,8 @@ function precmd {
#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%<<"
}
View
@@ -1,26 +1,51 @@
+# Check for updates on initial load...
+if [ "$DISABLE_AUTO_UPDATE" != "true" ]
+then
+ /usr/bin/env zsh $ZSH/tools/check_for_upgrade.sh
+fi
+
# 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
-# Load all of your custom configurations from custom/
-for config_file ($ZSH/custom/*.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
-plugin=${plugin:=()}
-for plugin ($plugins) source $ZSH/plugins/$plugin/$plugin.plugin.zsh
+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 the theme
-source "$ZSH/themes/$ZSH_THEME.zsh-theme"
+# Load all of your custom configurations from custom/
+for config_file ($ZSH/custom/*.zsh) source $config_file
-# Check for updates on initial load...
-if [ "$DISABLE_AUTO_UPDATE" = "true" ]
+# Load the theme
+if [ "$ZSH_THEME" = "random" ]
then
- return
+ 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
- /usr/bin/env zsh $ZSH/tools/check_for_upgrade.sh
+ if [ ! "$ZSH_THEME" = "" ]
+ then
+ source "$ZSH/themes/$ZSH_THEME.zsh-theme"
+ fi
fi
+
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'
Oops, something went wrong.

0 comments on commit 0ba398f

Please sign in to comment.