From 81aa74b73cc221b5050e28ccf35d29317812edf9 Mon Sep 17 00:00:00 2001 From: MasterLambaster Date: Mon, 31 May 2010 17:09:45 +0800 Subject: [PATCH 01/19] Eastwood theme with optional RVM support --- themes/eastwood.zsh-theme | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 themes/eastwood.zsh-theme diff --git a/themes/eastwood.zsh-theme b/themes/eastwood.zsh-theme new file mode 100644 index 000000000000..83664515adf7 --- /dev/null +++ b/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 ' From 3cf9ab722e7c0829727f548c7d05a0d96055f707 Mon Sep 17 00:00:00 2001 From: Robby Russell Date: Thu, 3 Jun 2010 12:03:26 -0700 Subject: [PATCH 02/19] Initial implementation of a new plugin system, so that people can managed which aliases/functions they want. --- lib/aliases.zsh | 28 ---------------------------- lib/functions.zsh | 21 --------------------- lib/git.zsh | 15 --------------- oh-my-zsh.sh | 4 ++++ plugins/git.plugin.zsh | 21 +++++++++++++++++++++ plugins/lighthouse.plugin.zsh | 16 ++++++++++++++++ plugins/rails.plugin.zsh | 10 ++++++++++ plugins/ruby.plugin.zsh | 4 ++++ plugins/textmate.plugin.zsh | 14 ++++++++++++++ 9 files changed, 69 insertions(+), 64 deletions(-) create mode 100644 plugins/git.plugin.zsh create mode 100644 plugins/lighthouse.plugin.zsh create mode 100644 plugins/rails.plugin.zsh create mode 100644 plugins/ruby.plugin.zsh create mode 100644 plugins/textmate.plugin.zsh diff --git a/lib/aliases.zsh b/lib/aliases.zsh index d891cc0a8b28..89c904a7e5f9 100644 --- a/lib/aliases.zsh +++ b/lib/aliases.zsh @@ -1,19 +1,7 @@ -#!/bin/zsh - # Push and pop directories on directory stack alias pu='pushd' alias po='popd' -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' - # Basic directory operations alias .='pwd' alias ...='cd ../..' @@ -33,20 +21,4 @@ alias l='ls -la' alias ll='ls -alr' alias sl=ls # often screw this up -alias sgem='sudo gem' - -# Find ruby file -alias rfind='find . -name *.rb | xargs grep -n' alias afind='ack-grep -il' - -# Git and svn mix -alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk' - -# 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' diff --git a/lib/functions.zsh b/lib/functions.zsh index 74b93f00e862..35c3f3ce711b 100644 --- a/lib/functions.zsh +++ b/lib/functions.zsh @@ -54,24 +54,3 @@ function take() { cd $1 } -function tm() { - cd $1 - mate $1 -} - -# 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' diff --git a/lib/git.zsh b/lib/git.zsh index 1d1d24deb6db..a54e5bcbbf58 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -20,18 +20,3 @@ function current_branch() { ref=$(git symbolic-ref HEAD 2> /dev/null) || return echo ${ref#refs/heads/} } - -# 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' diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index a41f3d89e0d9..bb45c71eb6f4 100644 --- a/oh-my-zsh.sh +++ b/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 diff --git a/plugins/git.plugin.zsh b/plugins/git.plugin.zsh new file mode 100644 index 000000000000..26777a62a2ba --- /dev/null +++ b/plugins/git.plugin.zsh @@ -0,0 +1,21 @@ +# 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' + +alias ggpull='git pull origin $(current_branch)' +alias ggpush='git push origin $(current_branch)' diff --git a/plugins/lighthouse.plugin.zsh b/plugins/lighthouse.plugin.zsh new file mode 100644 index 000000000000..4eb06a997100 --- /dev/null +++ b/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' \ No newline at end of file diff --git a/plugins/rails.plugin.zsh b/plugins/rails.plugin.zsh new file mode 100644 index 000000000000..fb21da846060 --- /dev/null +++ b/plugins/rails.plugin.zsh @@ -0,0 +1,10 @@ + +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' \ No newline at end of file diff --git a/plugins/ruby.plugin.zsh b/plugins/ruby.plugin.zsh new file mode 100644 index 000000000000..82bf5d49d442 --- /dev/null +++ b/plugins/ruby.plugin.zsh @@ -0,0 +1,4 @@ +alias sgem='sudo gem' + +# Find ruby file +alias rfind='find . -name *.rb | xargs grep -n' \ No newline at end of file diff --git a/plugins/textmate.plugin.zsh b/plugins/textmate.plugin.zsh new file mode 100644 index 000000000000..7b73e275152b --- /dev/null +++ b/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 +} From 31dace882969e04e0256dac4ddb333f648707106 Mon Sep 17 00:00:00 2001 From: Robby Russell Date: Thu, 3 Jun 2010 12:05:12 -0700 Subject: [PATCH 03/19] Updating default .zshrc template file to include plugins declaration --- templates/zshrc.zsh-template | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template index d905be04b220..8022b3506869 100644 --- a/templates/zshrc.zsh-template +++ b/templates/zshrc.zsh-template @@ -14,6 +14,10 @@ export ZSH_THEME="robbyrussell" # 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... From c21d3775a9663daf69133ae8dcd0a2697ef694fa Mon Sep 17 00:00:00 2001 From: Robby Russell Date: Thu, 3 Jun 2010 12:32:55 -0700 Subject: [PATCH 04/19] Moving capistrano functions to rails plugin --- plugins/rails.plugin.zsh | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/plugins/rails.plugin.zsh b/plugins/rails.plugin.zsh index fb21da846060..b7f62a0c613e 100644 --- a/plugins/rails.plugin.zsh +++ b/plugins/rails.plugin.zsh @@ -7,4 +7,26 @@ 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' \ No newline at end of file +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 From ab2c0744abc648da9c35dc52f4c0b3c0623b989d Mon Sep 17 00:00:00 2001 From: Robby Russell Date: Thu, 3 Jun 2010 12:33:15 -0700 Subject: [PATCH 05/19] Removing rake completion from lib/ as it was moved to rails plugin --- lib/rake_completion.zsh | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100644 lib/rake_completion.zsh diff --git a/lib/rake_completion.zsh b/lib/rake_completion.zsh deleted file mode 100644 index 8336182d5d86..000000000000 --- a/lib/rake_completion.zsh +++ /dev/null @@ -1,21 +0,0 @@ -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 From 455669e97606bb512b9f69fc1ed9b8fea5105a33 Mon Sep 17 00:00:00 2001 From: Robby Russell Date: Thu, 3 Jun 2010 12:54:40 -0700 Subject: [PATCH 06/19] Removing legacy completion code --- lib/completion.zsh | 8 -------- 1 file changed, 8 deletions(-) diff --git a/lib/completion.zsh b/lib/completion.zsh index b627ef878590..cba90179f28d 100644 --- a/lib/completion.zsh +++ b/lib/completion.zsh @@ -27,8 +27,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" @@ -37,9 +35,3 @@ if [ -f ~/.ssh/known_hosts ]; then zstyle ':completion:*' hosts $( sed 's/[, ].*$//' $HOME/.ssh/known_hosts ) zstyle ':completion:*:*:(ssh|scp):*:*' hosts `sed 's/^\([^ ,]*\).*$/\1/' ~/.ssh/known_hosts` fi - -# Complete on history -#zstyle ':completion:*:history-words' stop yes -#zstyle ':completion:*:history-words' remove-all-dups yes -#zstyle ':completion:*:history-words' list false -#zstyle ':completion:*:history-words' menu yes From 89bd2bf317fe458c6a6154824823670dd2d32660 Mon Sep 17 00:00:00 2001 From: Robby Russell Date: Thu, 3 Jun 2010 12:55:07 -0700 Subject: [PATCH 07/19] Moving some rails and osx-specific functions to their corresponding plugin files --- lib/functions.zsh | 16 ---------------- plugins/osx.plugin.zsh | 11 +++++++++++ plugins/rails.plugin.zsh | 4 ++++ 3 files changed, 15 insertions(+), 16 deletions(-) create mode 100644 plugins/osx.plugin.zsh diff --git a/lib/functions.zsh b/lib/functions.zsh index 35c3f3ce711b..fcbe994be3ef 100644 --- a/lib/functions.zsh +++ b/lib/functions.zsh @@ -21,10 +21,6 @@ function preexec { title $cmd[1]:t "$cmd[2,-1]" } -function remote_console() { - /usr/bin/env ssh $1 "( cd $2 && ruby script/console production )" -} - function zsh_stats() { history | awk '{print $2}' | sort | uniq -c | sort -rn | head } @@ -37,18 +33,6 @@ function upgrade_oh_my_zsh() { /bin/sh $ZSH/tools/upgrade.sh } -function tab() { - osascript 2>/dev/null </dev/null < Date: Thu, 3 Jun 2010 12:56:11 -0700 Subject: [PATCH 08/19] Moving current_branch() to git plugin --- lib/git.zsh | 9 --------- plugins/git.plugin.zsh | 10 ++++++++++ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/lib/git.zsh b/lib/git.zsh index a54e5bcbbf58..889dd98dff0f 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -11,12 +11,3 @@ parse_git_dirty () { echo "$ZSH_THEME_GIT_PROMPT_CLEAN" fi } - -# -# 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/} -} diff --git a/plugins/git.plugin.zsh b/plugins/git.plugin.zsh index 26777a62a2ba..e0d96705640d 100644 --- a/plugins/git.plugin.zsh +++ b/plugins/git.plugin.zsh @@ -17,5 +17,15 @@ 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)' From dea166411f134b33ae36c4ec4c51e71248dfa2a3 Mon Sep 17 00:00:00 2001 From: Robby Russell Date: Thu, 3 Jun 2010 12:59:49 -0700 Subject: [PATCH 09/19] Moving brew functions to it's own plugin --- functions/_brew => plugins/brew.plugin.zsh | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename functions/_brew => plugins/brew.plugin.zsh (100%) diff --git a/functions/_brew b/plugins/brew.plugin.zsh similarity index 100% rename from functions/_brew rename to plugins/brew.plugin.zsh From 59bfd87e08c127e6aacf473e99d2ebbc20e633ff Mon Sep 17 00:00:00 2001 From: Robby Russell Date: Thu, 3 Jun 2010 13:01:41 -0700 Subject: [PATCH 10/19] Adding some candy to the upgrade script --- tools/upgrade.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/upgrade.sh b/tools/upgrade.sh index 6dee42c25318..6bdd02e3865d 100644 --- a/tools/upgrade.sh +++ b/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 \ No newline at end of file From 6774490a467016db70e9ec1ddd1bab6fe37a722a Mon Sep 17 00:00:00 2001 From: James Rowe Date: Sun, 9 May 2010 21:17:20 +0800 Subject: [PATCH 11/19] Don't auto-correct ebuild commands. It breaks "ebuild manifest", as there are Manifest files in the directory. --- lib/correction.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/correction.zsh b/lib/correction.zsh index a96f7ffd8d12..043320a6de85 100644 --- a/lib/correction.zsh +++ b/lib/correction.zsh @@ -6,3 +6,4 @@ alias mysql='nocorrect mysql' alias mkdir='nocorrect mkdir' alias gist='nocorrect gist' alias heroku='nocorrect heroku' +alias ebuild='nocorrect ebuild' From edc8e3d092bc758fa9dd4f3472d2c6ec9d03b737 Mon Sep 17 00:00:00 2001 From: James Rowe Date: Sun, 9 May 2010 21:16:33 +0800 Subject: [PATCH 12/19] Ignore commands that start with a space. This is useful when you want to use a dangerous command, as it won't be available with history searching. --- lib/history.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/history.zsh b/lib/history.zsh index 509be8f09aa7..ca6f57079aef 100644 --- a/lib/history.zsh +++ b/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 From f9fbd079832637c192e35fe65532495a37a3e3d3 Mon Sep 17 00:00:00 2001 From: James Rowe Date: Sun, 9 May 2010 22:23:11 +0800 Subject: [PATCH 13/19] Don't display dotfiles or reverse sort with ll alias. The ll alias is a very common default for bash in Linux distributions, so use that definition. --- lib/aliases.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/aliases.zsh b/lib/aliases.zsh index 89c904a7e5f9..80760a1f526e 100644 --- a/lib/aliases.zsh +++ b/lib/aliases.zsh @@ -18,7 +18,7 @@ alias history='fc -l 1' # List direcory contents alias lsa='ls -lah' alias l='ls -la' -alias ll='ls -alr' +alias ll='ls -l' alias sl=ls # often screw this up alias afind='ack-grep -il' From 3bc73012041c8762fa0276c6e02ac46fb3698a32 Mon Sep 17 00:00:00 2001 From: James Rowe Date: Thu, 12 Nov 2009 14:52:53 +0800 Subject: [PATCH 14/19] Added a minimum zsh version note. --- README.textile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.textile b/README.textile index 950f8861bc7e..23d8b5390d73 100644 --- a/README.textile +++ b/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@ From 6efc79c74edbc8cfbb5cdc438332eeae9b950508 Mon Sep 17 00:00:00 2001 From: James Rowe Date: Sun, 22 Nov 2009 01:38:55 +0800 Subject: [PATCH 15/19] Don't correct hpodder commands. --- lib/correction.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/correction.zsh b/lib/correction.zsh index 043320a6de85..fc60dcdbdbea 100644 --- a/lib/correction.zsh +++ b/lib/correction.zsh @@ -7,3 +7,4 @@ alias mkdir='nocorrect mkdir' alias gist='nocorrect gist' alias heroku='nocorrect heroku' alias ebuild='nocorrect ebuild' +alias hpodder='nocorrect hpodder' From 47e9914529e0807681c3c6dd2c11187ee67f0326 Mon Sep 17 00:00:00 2001 From: Takashi Yoshida Date: Mon, 31 May 2010 00:56:26 +0800 Subject: [PATCH 16/19] Added my own theme. --- themes/takashiyoshida.zsh-theme | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 themes/takashiyoshida.zsh-theme diff --git a/themes/takashiyoshida.zsh-theme b/themes/takashiyoshida.zsh-theme new file mode 100644 index 000000000000..419a8cf3f453 --- /dev/null +++ b/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='' From 6bb13632f538db339520ab2b46794006a405430f Mon Sep 17 00:00:00 2001 From: Tobias Birmili Date: Sun, 6 Jun 2010 18:42:25 +0800 Subject: [PATCH 17/19] added plugin to control macports mysql-server installation --- plugins/mysql-macports.plugin.zsh | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 plugins/mysql-macports.plugin.zsh diff --git a/plugins/mysql-macports.plugin.zsh b/plugins/mysql-macports.plugin.zsh new file mode 100644 index 000000000000..63b881c9f5b7 --- /dev/null +++ b/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' \ No newline at end of file From b26ff059653716fd38d1813b797572bbec718c16 Mon Sep 17 00:00:00 2001 From: toabi Date: Sun, 6 Jun 2010 22:14:13 +0800 Subject: [PATCH 18/19] updated the readme --- README.textile | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/README.textile b/README.textile index 23d8b5390d73..8b1b6875a516 100644 --- a/README.textile +++ b/README.textile @@ -27,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 @@ -51,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 @@ -68,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 \ No newline at end of file +I'm hoping to collect a bunch of themes for our command prompts. You can see existing ones in the @themes/@ directory. \ No newline at end of file From 7f350da5b74c65ed99766c8ebd5137aee9479225 Mon Sep 17 00:00:00 2001 From: Robby Russell Date: Thu, 10 Jun 2010 07:50:13 -0700 Subject: [PATCH 19/19] Adding a ggpnp which does a git pull followed by a git push. --- plugins/git.plugin.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/git.plugin.zsh b/plugins/git.plugin.zsh index e0d96705640d..655eaf728de8 100644 --- a/plugins/git.plugin.zsh +++ b/plugins/git.plugin.zsh @@ -29,3 +29,4 @@ function current_branch() { # 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)' \ No newline at end of file