Skip to content
Browse files

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

  • Loading branch information...
2 parents 7ab8155 + 7c27985 commit 677c8454e7313bd3231293b9e097fae950e12bde @sjl committed Jul 21, 2010
View
24 README.textile
@@ -4,6 +4,8 @@ bq. "OH MY ZSHELL!"
h2. Setup
+@oh-my-zsh@ should work with any recent release of "zsh":http://www.zsh.org/, the minimum recommended version is 4.3.9.
+
h3. The automatic installer... (do you trust me?)
@wget http://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh@
@@ -25,22 +27,19 @@ h3. The manual way
@chsh -s /bin/zsh@
-4. Start / restart zsh (open a new terminal is easy enough..)
+4. Start / restart zsh (open a new terminal is easy enough...)
h3. Problems?
-You _might_ need to modify your PATH in ~/.zshrc if you're not able to find some commands after switching to oh-my-zsh.
+You _might_ need to modify your PATH in ~/.zshrc if you're not able to find some commands after switching to _Oh My Zsh_.
h2. Usage
-TODO: Update this..
-
-* Rake autocomplete: @rake (tab)@. Will generate a cache of all your rake tasks and then let you auto-complete and/or select the task to run.
-* ssh autocomplete: @ssh (tab)@ or @scp (tab)@
-* Git branch, it'll tell you which branch you're in when you're in a git repository directory.
+* enable the plugins you want in your @~/.zshrc@ (take a look at @plugins/@ to see what's possible)
+** example: @plugins=(git osx ruby)@
* Theme support: Change the @ZSH_THEME@ environment variable in @~/.zshrc@.
-** Take a look at the "current themes":http://wiki.github.com/robbyrussell/oh-my-zsh/themes that come bundled with Oh My Zsh.
-* much much more..
+** Take a look at the "current themes":http://wiki.github.com/robbyrussell/oh-my-zsh/themes that come bundled with _Oh My Zsh_.
+* much much more... take a look at @lib/@ what _Oh My Zsh_ offers...
h2. Useful
@@ -49,6 +48,7 @@ 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.
h3. Uninstalling
@@ -66,8 +66,4 @@ I'm far from being a zsh-expert and suspect there are many ways to improve. If y
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.
-
-h3. Todo from imajes:
-
-* need to make the title bar support git folder
+I'm hoping to collect a bunch of themes for our command prompts. You can see existing ones in the @themes/@ directory.
View
8 lib/aliases.zsh
@@ -1,17 +1,9 @@
-#!/bin/zsh
-
# Push and pop directories on directory stack
alias pu='pushd'
alias po='popd'
-alias ss='thin --stats "/thin/stats" start'
-alias devlog='tail -f log/development.log'
-
# Super user
alias _='sudo'
# Show history
alias history='fc -l 1'
-
-# TextMate
-alias et='mate . &'
View
2 lib/completion.zsh
@@ -25,8 +25,6 @@ zstyle ':completion:*' list-colors ''
bindkey -M menuselect '^o' accept-and-infer-next-history
zstyle ':completion:*:*:*:*:*' menu select
-# zstyle ':completion:*:*:*:*:processes' force-list always
-
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;34=0=01'
zstyle ':completion:*:*:*:*:processes' command "ps -u `whoami` -o pid,user,comm -w -w"
View
2 lib/correction.zsh
@@ -6,3 +6,5 @@ alias mysql='nocorrect mysql'
alias mkdir='nocorrect mkdir'
alias gist='nocorrect gist'
alias heroku='nocorrect heroku'
+alias ebuild='nocorrect ebuild'
+alias hpodder='nocorrect hpodder'
View
10 lib/functions.zsh
@@ -44,13 +44,3 @@ function tab() {
end tell
EOF
}
-
-function take() {
- mkdir -p $1
- cd $1
-}
-
-function tm() {
- cd $1
- mate $1
-}
View
1 lib/history.zsh
@@ -10,6 +10,7 @@ setopt hist_verify
setopt inc_append_history
setopt extended_history
setopt hist_expire_dups_first
+setopt hist_ignore_space
setopt SHARE_HISTORY
setopt APPEND_HISTORY
View
4 oh-my-zsh.sh
@@ -10,6 +10,10 @@ 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
+# Load all of the plugins that were defined in ~/.zshrc
+plugin=${plugin:=()}
+for plugin ($plugins) source $ZSH/plugins/$plugin.plugin.zsh
+
# Check for updates on initial load...
if [ "$DISABLE_AUTO_UPDATE" = "true" ]
then
View
0 functions/_brew → plugins/brew.plugin.zsh
File renamed without changes.
View
32 plugins/git.plugin.zsh
@@ -0,0 +1,32 @@
+# Aliases
+alias g='git'
+alias gst='git status'
+alias gl='git pull'
+alias gup='git fetch && git rebase'
+alias gp='git push'
+alias gd='git diff | mate'
+alias gdv='git diff -w "$@" | vim -R -'
+alias gc='git commit -v'
+alias gca='git commit -v -a'
+alias gb='git branch'
+alias gba='git branch -a'
+alias gcount='git shortlog -sn'
+alias gcp='git cherry-pick'
+
+
+# Git and svn mix
+alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk'
+
+#
+# Will return the current branch name
+# Usage example: git pull origin $(current_branch)
+#
+function current_branch() {
+ ref=$(git symbolic-ref HEAD 2> /dev/null) || return
+ echo ${ref#refs/heads/}
+}
+
+# these aliases take advangate of the previous function
+alias ggpull='git pull origin $(current_branch)'
+alias ggpush='git push origin $(current_branch)'
+alias ggpnp='git pull origin $(current_branch) && git push origin $(current_branch)'
View
16 plugins/lighthouse.plugin.zsh
@@ -0,0 +1,16 @@
+# To use: add a .lighthouse file into your directory with the URL to the
+# individual project. For example:
+# https://rails.lighthouseapp.com/projects/8994
+# Example usage: http://screencast.com/t/ZDgwNDUwNT
+open_lighthouse_ticket () {
+ if [ ! -f .lighthouse-url ]; then
+ echo "There is no .lighthouse file in the current directory..."
+ return 0;
+ else
+ lighthouse_url=$(cat .lighthouse-url);
+ echo "Opening ticket #$1";
+ `open $lighthouse_url/tickets/$1`;
+ fi
+}
+
+alias lho='open_lighthouse_ticket'
View
6 plugins/mysql-macports.plugin.zsh
@@ -0,0 +1,6 @@
+# commands to control local mysql-server installation
+# paths are for osx installtion via macports
+
+alias mysqlstart='sudo /opt/local/bin/mysqld_safe5'
+alias mysqlstop='/opt/local/bin/mysqladmin5 -u root -p shutdown'
+alias mysqlstatus='mysqladmin5 -u root -p ping'
View
11 plugins/osx.plugin.zsh
@@ -0,0 +1,11 @@
+function tab() {
+ osascript 2>/dev/null <<EOF
+ tell application "System Events"
+ tell process "Terminal" to keystroke "t" using command down
+ end
+ tell application "Terminal"
+ activate
+ do script with command "cd \"$PWD\"; $*" in window 1
+ end tell
+EOF
+}
View
36 plugins/rails.plugin.zsh
@@ -0,0 +1,36 @@
+
+alias ss='thin --stats "/thin/stats" start'
+alias sg='ruby script/generate'
+alias sd='ruby script/destroy'
+alias sp='ruby script/plugin'
+alias ssp='ruby script/spec'
+alias rdbm='rake db:migrate'
+alias sc='ruby script/console'
+alias sd='ruby script/server --debugger'
+alias devlog='tail -f log/development.log'
+
+function _cap_does_task_list_need_generating () {
+ if [ ! -f .cap_tasks~ ]; then return 0;
+ else
+ accurate=$(stat -f%m .cap_tasks~)
+ changed=$(stat -f%m config/deploy.rb)
+ return $(expr $accurate '>=' $changed)
+ fi
+}
+
+function _cap () {
+ if [ -f config/deploy.rb ]; then
+ if _cap_does_task_list_need_generating; then
+ echo "\nGenerating .cap_tasks~..." > /dev/stderr
+ cap show_tasks -q | cut -d " " -f 1 | sed -e '/^ *$/D' -e '1,2D'
+> .cap_tasks~
+ fi
+ compadd `cat .cap_tasks~`
+ fi
+}
+
+compctl -K _cap cap
+
+function remote_console() {
+ /usr/bin/env ssh $1 "( cd $2 && ruby script/console production )"
+}
View
4 plugins/ruby.plugin.zsh
@@ -0,0 +1,4 @@
+alias sgem='sudo gem'
+
+# Find ruby file
+alias rfind='find . -name *.rb | xargs grep -n'
View
14 plugins/textmate.plugin.zsh
@@ -0,0 +1,14 @@
+
+# TextMate
+alias et='mate . &'
+alias ett='mate app config lib db public spec test Rakefile Capfile Todo &'
+alias etp='mate app config lib db public spec test vendor/plugins vendor/gems Rakefile Capfile Todo &'
+alias etts='mate app config lib db public script spec test vendor/plugins vendor/gems Rakefile Capfile Todo &'
+
+# Editor Ruby file in TextMate
+alias mr='mate CHANGELOG app config db lib public script spec test'
+
+function tm() {
+ cd $1
+ mate $1
+}
View
4 templates/zshrc.zsh-template
@@ -14,6 +14,10 @@ export ZSH_THEME="prose"
# Uncomment following line if you want to disable colors in ls
# export DISABLE_LS_COLORS="true"
+# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
+# Example format: plugins=(rails git textmate ruby lighthouse)
+plugins=(git)
+
source $ZSH/oh-my-zsh.sh
# Customize to your needs...
View
19 themes/eastwood.zsh-theme
@@ -0,0 +1,19 @@
+#RVM settings
+if [[ -s ~/.rvm/scripts/rvm ]] ; then
+ RPS1="%{$fg[yellow]%}rvm:%{$reset_color%}%{$fg[red]%}\$(~/.rvm/bin/rvm-prompt)%{$reset_color%} $EPS1"
+fi
+
+ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[green]%}["
+ZSH_THEME_GIT_PROMPT_SUFFIX="]%{$reset_color%}"
+ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}*%{$reset_color%}"
+ZSH_THEME_GIT_PROMPT_CLEAN=""
+
+#Customized git status, oh-my-zsh currently does not allow render dirty status before branch
+git_custom_status() {
+ local cb=$(current_branch)
+ if [ -n "$cb" ]; then
+ echo "$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_PREFIX$(current_branch)$ZSH_THEME_GIT_PROMPT_SUFFIX"
+ fi
+}
+
+PROMPT='$(git_custom_status)%{$fg[cyan]%}[%~% ]%{$reset_color%}%B$%b '
View
27 themes/takashiyoshida.zsh-theme
@@ -0,0 +1,27 @@
+#
+# PROMPT
+#
+PROMPT_BRACKET_BEGIN='%{$fg_bold[white]%}['
+PROMPT_HOST='%{$fg_bold[cyan]%}%m'
+PROMPT_SEPARATOR='%{$reset_color%}:'
+PROMPT_DIR='%{$fg_bold[yellow]%}%c'
+PROMPT_BRACKET_END='%{$fg_bold[white]%}]'
+
+PROMPT_USER='%{$fg_bold[white]%}%n'
+PROMPT_SIGN='%{$reset_color%}%#'
+
+GIT_PROMPT_INFO='$(git_prompt_info)'
+
+# My current prompt looks like:
+# [host:current_dir] (git_prompt_info)
+# [username]%
+PROMPT="${PROMPT_BRACKET_BEGIN}${PROMPT_HOST}${PROMPT_SEPARATOR}${PROMPT_DIR}${PROMPT_BRACKET_END}${GIT_PROMPT_INFO}
+${PROMPT_BRACKET_BEGIN}${PROMPT_USER}${PROMPT_BRACKET_END}${PROMPT_SIGN} "
+
+#
+# Git repository
+#
+ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[magenta]%}"
+ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
+ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%}!"
+ZSH_THEME_GIT_PROMPT_CLEAN=''
View
6 tools/upgrade.sh
@@ -1,6 +1,12 @@
current_path=`pwd`
echo "Upgrading Oh My Zsh"
( cd $ZSH && git pull origin master )
+echo ' __ __ '
+echo ' ____ / /_ ____ ___ __ __ ____ _____/ /_ '
+echo ' / __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \ '
+echo '/ /_/ / / / / / / / / / / /_/ / / /_(__ ) / / / '
+echo '\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ '
+echo ' /____/'
echo "Hooray! Oh My Zsh has been updated and/or is at the current version. \nAny new updates will be reflected when you start your next terminal session."
echo "To keep up on the latest, be sure to follow Oh My Zsh on twitter: http://twitter.com/ohmyzsh"
cd $current_path

0 comments on commit 677c845

Please sign in to comment.
Something went wrong with that request. Please try again.