From 4f55fafd2cefbd0dcec6accb25f3bfcfbd2602c6 Mon Sep 17 00:00:00 2001 From: Brian Guthrie Date: Fri, 16 Apr 2010 16:19:43 +0530 Subject: [PATCH 1/7] Added personal zsh theme. --- themes/bguthrie.zsh-theme | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 themes/bguthrie.zsh-theme diff --git a/themes/bguthrie.zsh-theme b/themes/bguthrie.zsh-theme new file mode 100644 index 000000000..1820c4751 --- /dev/null +++ b/themes/bguthrie.zsh-theme @@ -0,0 +1,24 @@ +# Found on the ZshWiki +# http://zshwiki.org/home/config/prompt +# + +# As lifted from http://stevelosh.com/blog/2010/02/my-extravagant-zsh-prompt/ +function collapse_pwd { + echo $(pwd | sed -e "s,^$HOME,~,") +} + +function prompt_char { + git branch >/dev/null 2>/dev/null && echo 'λ' && return + hg root >/dev/null 2>/dev/null && echo 'λ' && return + svn info >/dev/null 2>/dev/null && echo 'λ' && return + echo '$' +} + +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_UNTRACKED="%{$fg[green]%}?" +ZSH_THEME_GIT_PROMPT_CLEAN="" + +PROMPT='[%{$fg[magenta]%}%n%{$reset_color%}@%{$fg[yellow]%}%m%{$reset_color%}:%{$fg_bold[green]%}$(collapse_pwd)%{$reset_color%}$(git_prompt_info)] +$(prompt_char) ' From 56fd856c84489591d03cca2152a11ebfa65d7a60 Mon Sep 17 00:00:00 2001 From: Brian Guthrie Date: Mon, 13 Dec 2010 06:45:09 -0500 Subject: [PATCH 2/7] Added personal theme. --- themes/bguthrie.zsh-theme | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/themes/bguthrie.zsh-theme b/themes/bguthrie.zsh-theme index 1820c4751..86c49fb4c 100644 --- a/themes/bguthrie.zsh-theme +++ b/themes/bguthrie.zsh-theme @@ -1,16 +1,13 @@ + +setopt nocorrect + # Found on the ZshWiki # http://zshwiki.org/home/config/prompt -# - -# As lifted from http://stevelosh.com/blog/2010/02/my-extravagant-zsh-prompt/ -function collapse_pwd { - echo $(pwd | sed -e "s,^$HOME,~,") -} - function prompt_char { - git branch >/dev/null 2>/dev/null && echo 'λ' && return - hg root >/dev/null 2>/dev/null && echo 'λ' && return - svn info >/dev/null 2>/dev/null && echo 'λ' && return + git branch >/dev/null 2>/dev/null && echo "%{$fg[blue]%}λ" && return + # These are slow and have therefore been killed: + # svn info >/dev/null 2>/dev/null && echo 'λ' && return + # hg root >/dev/null 2>/dev/null && echo 'λ' && return echo '$' } @@ -20,5 +17,17 @@ ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%}!" ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[green]%}?" ZSH_THEME_GIT_PROMPT_CLEAN="" -PROMPT='[%{$fg[magenta]%}%n%{$reset_color%}@%{$fg[yellow]%}%m%{$reset_color%}:%{$fg_bold[green]%}$(collapse_pwd)%{$reset_color%}$(git_prompt_info)] -$(prompt_char) ' +# Parsing git dirty status slows down my prompt tremendously without adding much value. +# This variant of git_prompt_info just grabs the branch. +function git_current_branch() { + ref=$(git symbolic-ref HEAD 2> /dev/null) || return + echo "$ZSH_THEME_GIT_PROMPT_PREFIX%{$fg[blue]%}${ref#refs/heads/}$ZSH_THEME_GIT_PROMPT_SUFFIX" +} + +# PROMPT='[%{$fg[magenta]%}%n%{$reset_color%}@%{$fg[yellow]%}%m%{$reset_color%}:%{$fg_bold[green]%}$(collapse_pwd)%{$reset_color%}$(git_prompt_info)] +# $(prompt_char) ' +# PROMPT='[%{$fg[magenta]%}%n%{$reset_color%}@%{$fg[yellow]%}%m%{$reset_color%}:%{$fg_bold[green]%}$(collapse_pwd)%{$reset_color%}$(git_prompt_info)] +# λ ' +# PROMPT='[%{$fg[magenta]%}%n%{$reset_color%}@%{$fg[yellow]%}%m%{$reset_color%}:%{$fg_bold[green]%}%~%{$reset_color%}] +# λ ' +PROMPT='[%{$fg[magenta]%}%n%{$reset_color%}@%{$fg[yellow]%}%m%{$reset_color%}:%{$fg_bold[green]%}%~%{$reset_color%}$(git_current_branch)] $(prompt_char)%{$reset_color%} ' From 39aee0618ded1cdb4c334acf8aa3a4a43f8fc2ac Mon Sep 17 00:00:00 2001 From: Brian Guthrie Date: Mon, 13 Dec 2010 06:51:51 -0500 Subject: [PATCH 3/7] Added new template. I guess? --- templates/zshrc.zsh-template | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template index d905be04b..1c155a880 100644 --- a/templates/zshrc.zsh-template +++ b/templates/zshrc.zsh-template @@ -3,7 +3,7 @@ export ZSH=$HOME/.oh-my-zsh # Set to the name theme to load. # Look in ~/.oh-my-zsh/themes/ -export ZSH_THEME="robbyrussell" +export ZSH_THEME="bguthrie" # Set to this to use case-sensitive completion # export CASE_SENSITIVE="true" @@ -14,6 +14,11 @@ 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 rails textmate ruby gem github osx vi-mode) + source $ZSH/oh-my-zsh.sh +source ~/.profile # Customize to your needs... From 2bdcd34e085eac2ed9e25fb64a6da313f309099f Mon Sep 17 00:00:00 2001 From: Brian Guthrie Date: Fri, 30 Sep 2011 11:34:04 -0500 Subject: [PATCH 4/7] Removed vi-mode. --- templates/zshrc.zsh-template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template index 74bce055a..251705b36 100644 --- a/templates/zshrc.zsh-template +++ b/templates/zshrc.zsh-template @@ -21,7 +21,7 @@ export ZSH_THEME="bguthrie" # 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 rails textmate ruby gem github osx vi-mode) +plugins=(git rails textmate ruby gem github osx) source $ZSH/oh-my-zsh.sh source ~/.profile From 06a973b4ee738238c44b826b6616056eb64ebd4e Mon Sep 17 00:00:00 2001 From: Brian Guthrie Date: Sat, 24 Dec 2011 17:21:08 +1100 Subject: [PATCH 5/7] Disabling auto-update. --- templates/zshrc.zsh-template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template index cfdf09e67..0ec332dd6 100644 --- a/templates/zshrc.zsh-template +++ b/templates/zshrc.zsh-template @@ -11,7 +11,7 @@ ZSH_THEME="bguthrie" # CASE_SENSITIVE="true" # Comment this out to disable weekly auto-update checks -# DISABLE_AUTO_UPDATE="true" +DISABLE_AUTO_UPDATE="true" # Uncomment following line if you want to disable colors in ls # DISABLE_LS_COLORS="true" From 7976a91efc9e2681e84cffed6bae3a4d7cfc700f Mon Sep 17 00:00:00 2001 From: Brian Guthrie Date: Sat, 24 Dec 2011 17:29:49 +1100 Subject: [PATCH 6/7] Checking in updated copy of my theme. --- themes/bguthrie.zsh-theme | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/themes/bguthrie.zsh-theme b/themes/bguthrie.zsh-theme index 86c49fb4c..28b55161d 100644 --- a/themes/bguthrie.zsh-theme +++ b/themes/bguthrie.zsh-theme @@ -1,8 +1,7 @@ - +# I hate ZSH's correction feature. setopt nocorrect -# Found on the ZshWiki -# http://zshwiki.org/home/config/prompt +# Found on the ZshWiki: http://zshwiki.org/home/config/prompt function prompt_char { git branch >/dev/null 2>/dev/null && echo "%{$fg[blue]%}λ" && return # These are slow and have therefore been killed: @@ -24,10 +23,5 @@ function git_current_branch() { echo "$ZSH_THEME_GIT_PROMPT_PREFIX%{$fg[blue]%}${ref#refs/heads/}$ZSH_THEME_GIT_PROMPT_SUFFIX" } -# PROMPT='[%{$fg[magenta]%}%n%{$reset_color%}@%{$fg[yellow]%}%m%{$reset_color%}:%{$fg_bold[green]%}$(collapse_pwd)%{$reset_color%}$(git_prompt_info)] -# $(prompt_char) ' -# PROMPT='[%{$fg[magenta]%}%n%{$reset_color%}@%{$fg[yellow]%}%m%{$reset_color%}:%{$fg_bold[green]%}$(collapse_pwd)%{$reset_color%}$(git_prompt_info)] -# λ ' -# PROMPT='[%{$fg[magenta]%}%n%{$reset_color%}@%{$fg[yellow]%}%m%{$reset_color%}:%{$fg_bold[green]%}%~%{$reset_color%}] -# λ ' -PROMPT='[%{$fg[magenta]%}%n%{$reset_color%}@%{$fg[yellow]%}%m%{$reset_color%}:%{$fg_bold[green]%}%~%{$reset_color%}$(git_current_branch)] $(prompt_char)%{$reset_color%} ' +PROMPT='[%{$fg[magenta]%}%n%{$reset_color%}@%{$fg[yellow]%}%m%{$reset_color%}:%{$fg_bold[green]%}%~%{$reset_color%}$(git_prompt_info)] +$(prompt_char)%{$reset_color%} ' From 44b028a152e6f7abb44078b801e89a7bf90aaa22 Mon Sep 17 00:00:00 2001 From: Brian Guthrie Date: Tue, 20 Mar 2012 18:58:52 -0400 Subject: [PATCH 7/7] Disabling correct_all, which is annoying and never works (for me). --- templates/zshrc.zsh-template | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template index 0ec332dd6..9503e21c3 100644 --- a/templates/zshrc.zsh-template +++ b/templates/zshrc.zsh-template @@ -28,5 +28,6 @@ plugins=(git rails textmate ruby gem github osx) source $ZSH/oh-my-zsh.sh source ~/.profile +unsetopt correct_all # Customize to your needs...