From a15a8c4a98bc1aff024c3ef44dec48309ff4f90b Mon Sep 17 00:00:00 2001 From: James Smith Date: Sat, 19 Mar 2011 17:51:22 -0700 Subject: New theme 'intheloop' which demonstrates the git_remote_status function --- themes/intheloop.zsh-theme | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 themes/intheloop.zsh-theme (limited to 'themes') diff --git a/themes/intheloop.zsh-theme b/themes/intheloop.zsh-theme new file mode 100644 index 000000000..c4736422d --- /dev/null +++ b/themes/intheloop.zsh-theme @@ -0,0 +1,18 @@ +# ZSH theme by James Smith (http://loopj.com) +# A multiline prompt with username, hostname, full path, return status, git branch, git dirty status, git remote status + +local return_status="%{$fg[red]%}%(?..⏎)%{$reset_color%}" + +PROMPT=' +%{$fg_bold[grey]%}[%{$reset_color%}%{$fg_bold[green]%}%n@%m%{$reset_color%}%{$fg_bold[grey]%}]%{$reset_color%} %{$fg_bold[blue]%}%10c%{$reset_color%} $(git_prompt_info) $(git_remote_status) +%{$fg_bold[cyan]%}❯%{$reset_color%} ' + +RPROMPT='${return_status}%{$reset_color%}' + +ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[grey]%}(%{$fg[red]%}" +ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[grey]%}) %{$fg[yellow]%}⚡%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[grey]%})" +ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE="%{$fg_bold[magenta]%}↓%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE="%{$fg_bold[magenta]%}↑%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_DIVERGED_REMOTE="%{$fg_bold[magenta]%}↕%{$reset_color%}" \ No newline at end of file -- cgit v1.2.3-70-g09d2 From f0451195f63b3607461bda1570c5fb2a4e429b3e Mon Sep 17 00:00:00 2001 From: Maxim Filatov Date: Sun, 5 Jun 2011 16:57:21 -0700 Subject: Dollar sign instead of percent in unprivileged user prompt (as in real gentoo) --- themes/gentoo.zsh-theme | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'themes') diff --git a/themes/gentoo.zsh-theme b/themes/gentoo.zsh-theme index cba143d42..ee205d248 100644 --- a/themes/gentoo.zsh-theme +++ b/themes/gentoo.zsh-theme @@ -1,4 +1,8 @@ -PROMPT='%(!.%{$fg_bold[red]%}.%{$fg_bold[green]%}%n@)%m %{$fg_bold[blue]%}%(!.%1~.%~) $(git_prompt_info)%#%{$reset_color%} ' +function prompt_char { + if [ $UID -eq 0 ]; then echo "#"; else echo $; fi +} + +PROMPT='%(!.%{$fg_bold[red]%}.%{$fg_bold[green]%}%n@)%m %{$fg_bold[blue]%}%(!.%1~.%~) $(git_prompt_info)%_$(prompt_char)%{$reset_color%} ' ZSH_THEME_GIT_PROMPT_PREFIX="(" ZSH_THEME_GIT_PROMPT_SUFFIX=") " -- cgit v1.2.3-70-g09d2 From b727e337adb0264b3d03ffdd0a4af3ba9802572a Mon Sep 17 00:00:00 2001 From: Sagie Maoz Date: Mon, 27 Jun 2011 01:37:27 -0700 Subject: Updated the frisk theme to display Bazaar branch information as well (based on zedtux.zsh-theme http://j.mp/ikTZJj) --- themes/frisk.zsh-theme | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'themes') diff --git a/themes/frisk.zsh-theme b/themes/frisk.zsh-theme index f181aec90..2c999a6a6 100644 --- a/themes/frisk.zsh-theme +++ b/themes/frisk.zsh-theme @@ -1,10 +1,22 @@ PROMPT=$' -%{$fg[blue]%}%/%{$reset_color%} $(git_prompt_info)%{$fg[white]%}[%n@%m]%{$reset_color%} %{$fg[white]%}[%T]%{$reset_color%} +%{$fg[blue]%}%/%{$reset_color%} $(git_prompt_info)$(bzr_prompt_info)%{$fg[white]%}[%n@%m]%{$reset_color%} %{$fg[white]%}[%T]%{$reset_color%} %{$fg_bold[black]%}>%{$reset_color%} ' PROMPT2="%{$fg_blod[black]%}%_> %{$reset_color%}" -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}[" +GIT_CB="git::" +ZSH_THEME_SCM_PROMPT_PREFIX="%{$fg[green]%}[" +ZSH_THEME_GIT_PROMPT_PREFIX=$ZSH_THEME_SCM_PROMPT_PREFIX$GIT_CB ZSH_THEME_GIT_PROMPT_SUFFIX="]%{$reset_color%} " ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}*%{$fg[green]%}" ZSH_THEME_GIT_PROMPT_CLEAN="" + +## Bazaar integration +bzr_prompt_info() { + BZR_CB=`bzr nick 2> /dev/null | grep -v "ERROR" | cut -d ":" -f2 | awk -F / '{print "bzr::"$1}'` + if [ -n "$BZR_CB" ]; then + BZR_DIRTY="" + [[ -n `bzr status` ]] && BZR_DIRTY="%{$fg[red]%} *%{$reset_color%}" + echo "$ZSH_THEME_SCM_PROMPT_PREFIX$BZR_CB$BZR_DIRTY$ZSH_THEME_GIT_PROMPT_SUFFIX" + fi +} -- cgit v1.2.3-70-g09d2 From 3bc32eef6dbad942fd137a7c7d04050d9b87fed4 Mon Sep 17 00:00:00 2001 From: Adolfo Benedetti Date: Tue, 2 Aug 2011 09:42:23 +0200 Subject: add theme with command-line tips support --- themes/adben.zsh-theme | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 themes/adben.zsh-theme (limited to 'themes') diff --git a/themes/adben.zsh-theme b/themes/adben.zsh-theme new file mode 100644 index 000000000..9f777e847 --- /dev/null +++ b/themes/adben.zsh-theme @@ -0,0 +1,26 @@ +#!/usr/bin/env zsh +local USER_HOST='%{$terminfo[bold]$fg[yellow]%}%n@%m%{$reset_color%}' +local RETURN_CODE="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" +local GIT_BRANCH='%{$terminfo[bold]$fg[red]%}$(git_prompt_info)%{$reset_color%}' +local CURRENT_DIR='%{$terminfo[bold]$fg[green]%} %~%{$reset_color%}' +local RUBY_RVM='%{$fg[gray]%}‹$(rvm-prompt i v g)›%{$reset_color%}' +local COMMAND_TIP='%{$terminfo[bold]$fg[blue]%}$(wget -qO - http://www.commandlinefu.com/commands/random/plaintext | sed 1d | sed '/^$/d' | sed 's/^/║/g')%{$reset_color%}' +######### PROMPT ######### +PROMPT="%{$terminfo[bold]$fg[blue]%}╔═ %{$reset_color%}${USER_HOST} ${CURRENT_DIR} ${RUBY_RVM} ${GIT_BRANCH} +${COMMAND_TIP} +%{$terminfo[bold]$fg[blue]%}╚═ %{$reset_color%}%B%{$terminfo[bold]$fg[white]%}$%b%{$reset_color%} " +RPS1='${RETURN_CODE}' +RPROMPT='%{$fg[green]%}[%*]%{$reset_color%}' +######### PROMPT ######### +########## GIT ########### +ZSH_THEME_GIT_PROMPT_PREFIX="‹" +ZSH_THEME_GIT_PROMPT_SUFFIX="%{$GIT_PROMPT_INFO%}›" +ZSH_THEME_GIT_PROMPT_DIRTY=" %{$GIT_DIRTY_COLOR%}✘" +ZSH_THEME_GIT_PROMPT_CLEAN=" %{$GIT_CLEAN_COLOR%}✔" +ZSH_THEME_GIT_PROMPT_ADDED="%{$FG[082]%}✚%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_MODIFIED="%{$FG[166]%}✹%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_DELETED="%{$FG[160]%}✖%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_RENAMED="%{$FG[220]%}➜%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_UNMERGED="%{$FG[082]%}═%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$FG[190]%}✭%{$reset_color%}" +########## GIT ########### -- cgit v1.2.3-70-g09d2 From 878d569c6845198005dacc4e9a56b6610e46ffd9 Mon Sep 17 00:00:00 2001 From: Aslam Najeebdeen Date: Mon, 4 Jul 2011 15:37:11 +0530 Subject: FrontCube theme with git status --- themes/frontcube.zsh-theme | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 themes/frontcube.zsh-theme (limited to 'themes') diff --git a/themes/frontcube.zsh-theme b/themes/frontcube.zsh-theme new file mode 100644 index 000000000..081fa2f29 --- /dev/null +++ b/themes/frontcube.zsh-theme @@ -0,0 +1,10 @@ +PROMPT=' +%{$fg_bold[gray]%}%~%{$fg_bold[blue]%}%{$fg_bold[blue]%} % %{$reset_color%} +%{$fg[green]%}➞ %{$reset_color%' + +RPROMPT='$(git_prompt_info)' + +ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}[git:" +ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}] %{$fg[red]%}✖ %{$reset_color%}" +ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%}] %{$fg[green]%}✔%{$reset_color%}" -- cgit v1.2.3-70-g09d2 From ebbead82abe59663cedd9f0ade4627e01548b4c1 Mon Sep 17 00:00:00 2001 From: Aslam Najeebdeen Date: Sat, 16 Jul 2011 17:31:57 +0530 Subject: RVM info --- themes/frontcube.zsh-theme | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'themes') diff --git a/themes/frontcube.zsh-theme b/themes/frontcube.zsh-theme index 081fa2f29..d9f5b6d9c 100644 --- a/themes/frontcube.zsh-theme +++ b/themes/frontcube.zsh-theme @@ -1,8 +1,10 @@ +local rvm="%{$fg[green]%}[$(rvm-prompt i v g)]%{$reset_color%}" + PROMPT=' %{$fg_bold[gray]%}%~%{$fg_bold[blue]%}%{$fg_bold[blue]%} % %{$reset_color%} %{$fg[green]%}➞ %{$reset_color%' -RPROMPT='$(git_prompt_info)' +RPROMPT='$(git_prompt_info) $(rvm)' ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}[git:" ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" -- cgit v1.2.3-70-g09d2 From e3c34b4f9aee666ea5446a975b4a70cdbab3239c Mon Sep 17 00:00:00 2001 From: Mark Drago Date: Sat, 31 Dec 2011 12:13:31 -0500 Subject: add ability to set custom prefix for cloud theme --- themes/cloud.zsh-theme | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'themes') diff --git a/themes/cloud.zsh-theme b/themes/cloud.zsh-theme index ad5e2834b..4efbf9776 100644 --- a/themes/cloud.zsh-theme +++ b/themes/cloud.zsh-theme @@ -1,4 +1,8 @@ -PROMPT='%{$fg_bold[cyan]%}☁ %{$fg_bold[green]%}%p %{$fg[green]%}%c %{$fg_bold[cyan]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}' +if [[ -z $ZSH_THEME_CLOUD_PREFIX ]]; then + ZSH_THEME_CLOUD_PREFIX='☁' +fi + +PROMPT='%{$fg_bold[cyan]%}$ZSH_THEME_CLOUD_PREFIX %{$fg_bold[green]%}%p %{$fg[green]%}%c %{$fg_bold[cyan]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}' ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}[%{$fg[cyan]%}" ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" -- cgit v1.2.3-70-g09d2 From c1e9d9226c106aaf973712b1a700dd045aeff9bc Mon Sep 17 00:00:00 2001 From: Henry Yan Date: Mon, 5 Mar 2012 21:39:09 +0800 Subject: move kafeitu.zsh-theme to themes folder --- kafeitu.zsh-theme | 6 ------ themes/kafeitu.zsh-theme | 6 ++++++ 2 files changed, 6 insertions(+), 6 deletions(-) delete mode 100644 kafeitu.zsh-theme create mode 100644 themes/kafeitu.zsh-theme (limited to 'themes') diff --git a/kafeitu.zsh-theme b/kafeitu.zsh-theme deleted file mode 100644 index 60c0303b9..000000000 --- a/kafeitu.zsh-theme +++ /dev/null @@ -1,6 +0,0 @@ -PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%n %{$fg[blue]%}%D{[%I:%M:%S]} %{$fg_bold[green]%}%p %{$fg[cyan]%}%~ %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}' - -ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$fg[red]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})" diff --git a/themes/kafeitu.zsh-theme b/themes/kafeitu.zsh-theme new file mode 100644 index 000000000..60c0303b9 --- /dev/null +++ b/themes/kafeitu.zsh-theme @@ -0,0 +1,6 @@ +PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%n %{$fg[blue]%}%D{[%I:%M:%S]} %{$fg_bold[green]%}%p %{$fg[cyan]%}%~ %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}' + +ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$fg[red]%}" +ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})" -- cgit v1.2.3-70-g09d2 From bd4f1eeca2d1430029153f7be0aa432ef5d2fce9 Mon Sep 17 00:00:00 2001 From: Henry Yan Date: Tue, 6 Mar 2012 14:09:11 +0800 Subject: add hostname behind username, example: henryyan [02:07:20] ~/.oh-my-zsh git:(master) ✗ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/kafeitu.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'themes') diff --git a/themes/kafeitu.zsh-theme b/themes/kafeitu.zsh-theme index 60c0303b9..18e941601 100644 --- a/themes/kafeitu.zsh-theme +++ b/themes/kafeitu.zsh-theme @@ -1,4 +1,4 @@ -PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%n %{$fg[blue]%}%D{[%I:%M:%S]} %{$fg_bold[green]%}%p %{$fg[cyan]%}%~ %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}' +PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%n%{$fg[blue]%}@%{$fg_bold[green]%}%m %{$fg[blue]%}%D{[%I:%M:%S]} %{$fg_bold[green]%}%p %{$fg[cyan]%}%~ %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}' ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$fg[red]%}" ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" -- cgit v1.2.3-70-g09d2 From 7ffc3e745fa7ab020ec45e4ffe7a069c823e386a Mon Sep 17 00:00:00 2001 From: Henry Yan Date: Tue, 6 Mar 2012 14:14:17 +0800 Subject: change color of @ to cyan --- themes/kafeitu.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'themes') diff --git a/themes/kafeitu.zsh-theme b/themes/kafeitu.zsh-theme index 18e941601..a89a899aa 100644 --- a/themes/kafeitu.zsh-theme +++ b/themes/kafeitu.zsh-theme @@ -1,4 +1,4 @@ -PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%n%{$fg[blue]%}@%{$fg_bold[green]%}%m %{$fg[blue]%}%D{[%I:%M:%S]} %{$fg_bold[green]%}%p %{$fg[cyan]%}%~ %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}' +PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%n%{$fg[cyan]%}@%{$fg_bold[green]%}%m %{$fg[blue]%}%D{[%I:%M:%S]} %{$fg_bold[green]%}%p %{$fg[cyan]%}%~ %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}' ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$fg[red]%}" ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" -- cgit v1.2.3-70-g09d2 From 814ecfc60daffc1eac250d41643d05fb1f43bd4c Mon Sep 17 00:00:00 2001 From: Henry Yan Date: Wed, 7 Mar 2012 23:52:51 +0800 Subject: delete time filed --- themes/kafeitu.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'themes') diff --git a/themes/kafeitu.zsh-theme b/themes/kafeitu.zsh-theme index a89a899aa..c4720b24d 100644 --- a/themes/kafeitu.zsh-theme +++ b/themes/kafeitu.zsh-theme @@ -1,4 +1,4 @@ -PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%n%{$fg[cyan]%}@%{$fg_bold[green]%}%m %{$fg[blue]%}%D{[%I:%M:%S]} %{$fg_bold[green]%}%p %{$fg[cyan]%}%~ %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}' +PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%n%{$fg[cyan]%}@%{$fg_bold[green]%}%m %{$fg_bold[green]%}%p %{$fg[cyan]%}%~ %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}' ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$fg[red]%}" ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" -- cgit v1.2.3-70-g09d2 From 6a2e04fefbd794f050d45e7a717d009e39204431 Mon Sep 17 00:00:00 2001 From: clutton Date: Mon, 16 Jul 2012 02:59:30 +0300 Subject: modify themes/jnrowe.zsh-theme, add host directive "Ξ (mbsd) ~ →" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/jnrowe.zsh-theme | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'themes') diff --git a/themes/jnrowe.zsh-theme b/themes/jnrowe.zsh-theme index 7c8a7082e..0ade9cc60 100644 --- a/themes/jnrowe.zsh-theme +++ b/themes/jnrowe.zsh-theme @@ -1,3 +1,4 @@ +autoload -U colors && colors autoload -U add-zsh-hook autoload -Uz vcs_info @@ -8,9 +9,10 @@ zstyle ':vcs_info:*' formats \ zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r' zstyle ':vcs_info:*' enable git -add-zsh-hook precmd prompt_jnrowe_precmd +add-zsh-hook precmd prompt_vcs +add-zsh-hook precmd prompt_host -prompt_jnrowe_precmd () { +prompt_vcs () { vcs_info if [ "${vcs_info_msg_0_}" = "" ]; then @@ -24,8 +26,17 @@ prompt_jnrowe_precmd () { fi } +prompt_host () { + if [[ -n "$SSH_CLIENT" ]]; then + host=" ($HOST)" + else + host='' + fi +} + + local ret_status="%(?:%{$fg_bold[green]%}Ξ:%{$fg_bold[red]%}%S↑%s%?)" -PROMPT='${ret_status}%{$fg_bold[green]%}%p %{$fg_bold[yellow]%}%2~ ${vcs_info_msg_0_}${dir_status}%{$reset_color%} ' +PROMPT='${ret_status}%{$fg[blue]%}${host}%{$fg_bold[green]%}%p %{$fg_bold[yellow]%}%2~ ${vcs_info_msg_0_}${dir_status}%{$reset_color%} ' # vim: set ft=zsh ts=4 sw=4 et: -- cgit v1.2.3-70-g09d2 From d5bfbf05d16634fa3c2834c7097edb1cf2487d96 Mon Sep 17 00:00:00 2001 From: clutton Date: Tue, 24 Jul 2012 05:36:18 +0300 Subject: improvement: define PROMPT_HOST once on startup --- themes/jnrowe.zsh-theme | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'themes') diff --git a/themes/jnrowe.zsh-theme b/themes/jnrowe.zsh-theme index 0ade9cc60..a1478be31 100644 --- a/themes/jnrowe.zsh-theme +++ b/themes/jnrowe.zsh-theme @@ -1,16 +1,14 @@ -autoload -U colors && colors autoload -U add-zsh-hook autoload -Uz vcs_info +zstyle ':vcs_info:*' disable-patterns "/usr/(ports|src)(|/*)" zstyle ':vcs_info:*' actionformats \ - '%F{5}(%f%s%F{5})%F{3}-%F{5}[%F{2}%b%F{3}|%F{1}%a%F{5}]%f ' -zstyle ':vcs_info:*' formats \ - '%F{2}%s%F{7}:%F{2}(%F{1}%b%F{2})%f ' + '%F{5}(%f%s%F{5})%F{3}-%F{5}[%F{2}%b%F{3}|%F{1}%a%F{5}]%f ' +zstyle ':vcs_info:*' formats '%F{2}%s%F{7}:%F{2}(%F{1}%b%F{2})%f ' zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r' zstyle ':vcs_info:*' enable git add-zsh-hook precmd prompt_vcs -add-zsh-hook precmd prompt_host prompt_vcs () { vcs_info @@ -26,17 +24,16 @@ prompt_vcs () { fi } -prompt_host () { +function { if [[ -n "$SSH_CLIENT" ]]; then - host=" ($HOST)" + PROMPT_HOST=" ($HOST)" else - host='' + PROMPT_HOST='' fi } - local ret_status="%(?:%{$fg_bold[green]%}Ξ:%{$fg_bold[red]%}%S↑%s%?)" -PROMPT='${ret_status}%{$fg[blue]%}${host}%{$fg_bold[green]%}%p %{$fg_bold[yellow]%}%2~ ${vcs_info_msg_0_}${dir_status}%{$reset_color%} ' +PROMPT='${ret_status}%{$fg[blue]%}${PROMPT_HOST}%{$fg_bold[green]%}%p %{$fg_bold[yellow]%}%2~ ${vcs_info_msg_0_}${dir_status}%{$reset_color%} ' # vim: set ft=zsh ts=4 sw=4 et: -- cgit v1.2.3-70-g09d2 From decb9c82b5392d66e157ceef9c3b41466bdcbafd Mon Sep 17 00:00:00 2001 From: clutton Date: Tue, 24 Jul 2012 14:16:03 +0300 Subject: delete os specific disable-patterns --- themes/jnrowe.zsh-theme | 1 - 1 file changed, 1 deletion(-) (limited to 'themes') diff --git a/themes/jnrowe.zsh-theme b/themes/jnrowe.zsh-theme index a1478be31..bae88f7ab 100644 --- a/themes/jnrowe.zsh-theme +++ b/themes/jnrowe.zsh-theme @@ -1,7 +1,6 @@ autoload -U add-zsh-hook autoload -Uz vcs_info -zstyle ':vcs_info:*' disable-patterns "/usr/(ports|src)(|/*)" zstyle ':vcs_info:*' actionformats \ '%F{5}(%f%s%F{5})%F{3}-%F{5}[%F{2}%b%F{3}|%F{1}%a%F{5}]%f ' zstyle ':vcs_info:*' formats '%F{2}%s%F{7}:%F{2}(%F{1}%b%F{2})%f ' -- cgit v1.2.3-70-g09d2 From 76f2429e8ec30afacd3a913018c8c573962e214c Mon Sep 17 00:00:00 2001 From: Marcelo Eden Date: Tue, 14 Aug 2012 12:23:11 -0300 Subject: new 3den theme with RVM and GIT --- themes/3den.zsh-theme | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 themes/3den.zsh-theme (limited to 'themes') diff --git a/themes/3den.zsh-theme b/themes/3den.zsh-theme new file mode 100644 index 000000000..1d2c7db7f --- /dev/null +++ b/themes/3den.zsh-theme @@ -0,0 +1,7 @@ +PROMPT=$'%{$fg[white]%}$(~/.rvm/bin/rvm-prompt) %{$fg_bold[cyan]%}%~%{$reset_color%}$(git_prompt_info) %{$fg[cyan]%}%D{[%I:%M:%S]}\ +%{$fg_bold[green]%}%n$%{$reset_color%} ' + +ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[white]%}(" +ZSH_THEME_GIT_PROMPT_SUFFIX=")%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_DIRTY="*" +ZSH_THEME_GIT_PROMPT_CLEAN="" -- cgit v1.2.3-70-g09d2 From 28d3b80db1d5d976a809bc01da191be5b1768fcb Mon Sep 17 00:00:00 2001 From: Xavier Lacoste Date: Thu, 30 Aug 2012 16:25:36 +0200 Subject: Add empty function rbenv_prompt_info() if doesn't exists --- themes/jonathan.zsh-theme | 2 ++ 1 file changed, 2 insertions(+) (limited to 'themes') diff --git a/themes/jonathan.zsh-theme b/themes/jonathan.zsh-theme index 2f0c4b917..9f0f30271 100644 --- a/themes/jonathan.zsh-theme +++ b/themes/jonathan.zsh-theme @@ -1,3 +1,5 @@ +functions rbenv_prompt_info >& /dev/null || rbenv_prompt_info(){} + function theme_precmd { local TERMWIDTH (( TERMWIDTH = ${COLUMNS} - 1 )) -- cgit v1.2.3-70-g09d2 From 2643ac975bff9513753b6e3d99a34164e48955f7 Mon Sep 17 00:00:00 2001 From: Nicholas Hutchinson Date: Sun, 2 Sep 2012 10:38:08 +1200 Subject: Update fishy theme to collapse working directory in PROMPT. For non-trailing path components, we show only the first character. So, as in Fish proper, we convert ~/some/really/really/really/long/path/name to ~/s/r/r/r/l/p/name. --- themes/fishy.zsh-theme | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'themes') diff --git a/themes/fishy.zsh-theme b/themes/fishy.zsh-theme index f9e506cae..e9f78a54e 100644 --- a/themes/fishy.zsh-theme +++ b/themes/fishy.zsh-theme @@ -1,7 +1,11 @@ # ZSH Theme emulating the Fish shell's default prompt. +_fishy_collapsed_wd() { + echo $(pwd | perl -pe "s|^$HOME|~|g; s|/([^/])[^/]*(?=/)|/\$1|g") +} + local user_color='green'; [ $UID -eq 0 ] && user_color='red' -PROMPT='%n@%m %{$fg[$user_color]%}%~%{$reset_color%}%(!.#.>) ' +PROMPT='%n@%m %{$fg[$user_color]%}$(_fishy_collapsed_wd)%{$reset_color%}%(!.#.>) ' PROMPT2='%{$fg[red]%}\ %{$reset_color%}' local return_status="%{$fg_bold[red]%}%(?..%?)%{$reset_color%}" -- cgit v1.2.3-70-g09d2 From b11e28914139fb585c0a4de4ddb6a55f19a5493d Mon Sep 17 00:00:00 2001 From: Isaac Wolkerstorfer Date: Thu, 13 Sep 2012 14:02:09 +0200 Subject: Add agnoster.zsh-theme --- themes/agnoster.zsh-theme | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 themes/agnoster.zsh-theme (limited to 'themes') diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme new file mode 100644 index 000000000..15848979e --- /dev/null +++ b/themes/agnoster.zsh-theme @@ -0,0 +1,28 @@ +# Theme by [agnoster](https://github.com/agnoster) +# See https://gist.github.com/3712874 + +ZSH_THEME_GIT_PROMPT_DIRTY='±' + +function _git_prompt_info() { + ref=$(git symbolic-ref HEAD 2> /dev/null) || ref="➦ $(git show-ref --head -s --abbrev |head -n1 2> /dev/null)" + echo "${ref/refs\/heads\//⭠ }$(parse_git_dirty)" +} + +function _git_info() { + if $(git rev-parse --is-inside-work-tree >/dev/null 2>&1); then + local BG_COLOR=green + if [[ -n $(parse_git_dirty) ]]; then + BG_COLOR=yellow + fi + echo "%{%K{$BG_COLOR}%}⮀%{%F{black}%} $(_git_prompt_info) %{%F{$BG_COLOR}%K{blue}%}⮀" + else + echo "%{%K{blue}%}⮀" + fi +} + +PROMPT_HOST='%{%b%F{gray}%K{black}%} %(?.%{%F{green}%}✔.%{%F{red}%}✘)%{%F{gray}%} %m %{%F{black}%}' +PROMPT_DIR='%{%F{white}%} %1~ ' +PROMPT_SU='%(!.%{%k%F{blue}%K{black}%}⮀%{%F{yellow}%} ⚡ %{%k%F{black}%}.%{%k%F{blue}%})⮀%{%f%k%b%}' + +PROMPT='%{%f%b%k%} +$PROMPT_HOST$(_git_info)$PROMPT_DIR$PROMPT_SU ' -- cgit v1.2.3-70-g09d2 From 11a4c67f340b400a3d9cc9913b4f49d708e01a57 Mon Sep 17 00:00:00 2001 From: Tyler Cipriani Date: Mon, 17 Sep 2012 10:19:37 -0600 Subject: Added junkfood theme --- themes/junkfood.zsh-theme | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 themes/junkfood.zsh-theme (limited to 'themes') diff --git a/themes/junkfood.zsh-theme b/themes/junkfood.zsh-theme new file mode 100644 index 000000000..a265f29f1 --- /dev/null +++ b/themes/junkfood.zsh-theme @@ -0,0 +1,34 @@ +# ------------------------------------------------------------------------ +# Tyler Cipriani +# oh-my-zsh theme +# Totally ripped off Dallas theme +# ------------------------------------------------------------------------ + +# Grab the current date (%W) and time (%t): +JUNKFOOD_TIME_="%{$fg_bold[white]%}#%t%{$fg_bold[white]%} – %{$fg_bold[yellow]%}%W%{$fg_bold[white]%} – %{$reset_color%}" + +# Grab the current machine name +JUNKFOOD_MACHINE_="%{$fg_bold[blue]%}%m%{$fg[white]%}:%{$reset_color%}" + +# Grab the current username +JUNKFOOD_CURRENT_USER_="%{$fg_bold[green]%}%n%{$reset_color%}" + +# Grab the current filepath, use shortcuts: ~/Desktop +# Append the current git branch, if in a git repository: ~aw@master +JUNKFOOD_LOCA_="%{$fg[cyan]%}%~\$(git_prompt_info)%{$reset_color%}" + +# For the git prompt, use a white @ and blue text for the branch name +ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[white]%}@%{$fg_bold[white]%}" + +# Close it all off by resetting the color and styles. +ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" + +# Do nothing if the branch is clean (no changes). +ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg_bold[green]%}✔" + +# Add 3 cyan ✗s if this branch is diiirrrty! Dirty branch! +ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[red]%}✗✗✗" + +# Put it all together! +PROMPT="$JUNKFOOD_TIME_$JUNKFOOD_CURRENT_USER_@$JUNKFOOD_MACHINE_$JUNKFOOD_LOCA_ + " -- cgit v1.2.3-70-g09d2 From 00e11991e0fec9e4db783550a1c849c48920f02a Mon Sep 17 00:00:00 2001 From: Tyler Cipriani Date: Mon, 17 Sep 2012 10:25:19 -0600 Subject: Added space to prompt --- themes/junkfood.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'themes') diff --git a/themes/junkfood.zsh-theme b/themes/junkfood.zsh-theme index a265f29f1..bfe3913de 100644 --- a/themes/junkfood.zsh-theme +++ b/themes/junkfood.zsh-theme @@ -5,7 +5,7 @@ # ------------------------------------------------------------------------ # Grab the current date (%W) and time (%t): -JUNKFOOD_TIME_="%{$fg_bold[white]%}#%t%{$fg_bold[white]%} – %{$fg_bold[yellow]%}%W%{$fg_bold[white]%} – %{$reset_color%}" +JUNKFOOD_TIME_="%{$fg_bold[white]%}# %t%{$fg_bold[white]%} – %{$fg_bold[yellow]%}%W%{$fg_bold[white]%} – %{$reset_color%}" # Grab the current machine name JUNKFOOD_MACHINE_="%{$fg_bold[blue]%}%m%{$fg[white]%}:%{$reset_color%}" -- cgit v1.2.3-70-g09d2 From bf4157514f8880ac04ba328f7f1b74c34f1b39d7 Mon Sep 17 00:00:00 2001 From: Isaac Wolkerstorfer Date: Mon, 17 Sep 2012 11:44:25 -0500 Subject: Refactored theme --- themes/agnoster.zsh-theme | 92 ++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 75 insertions(+), 17 deletions(-) (limited to 'themes') diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme index 15848979e..9cfcff3d0 100644 --- a/themes/agnoster.zsh-theme +++ b/themes/agnoster.zsh-theme @@ -1,28 +1,86 @@ -# Theme by [agnoster](https://github.com/agnoster) -# See https://gist.github.com/3712874 +### Segment drawing +# A few utility functions to make it easy and re-usable to draw segmented prompts -ZSH_THEME_GIT_PROMPT_DIRTY='±' +CURRENT_BG='' +SEGMENT_SEPARATOR='⮀' +function segment_start() { + local bg=$1 + local fg=$2 + if [[ -n $CURRENT_BG && $bg != $CURRENT_BG ]]; then + echo -n " %{%K{$bg}%F{$CURRENT_BG}%}$SEGMENT_SEPARATOR" + else + echo -n "%{%K{$bg}%}" + fi + [[ -n $fg ]] && fg="%F{$fg}" || fg="%f" + echo -n "%{$fg%} " + CURRENT_BG=$bg +} -function _git_prompt_info() { - ref=$(git symbolic-ref HEAD 2> /dev/null) || ref="➦ $(git show-ref --head -s --abbrev |head -n1 2> /dev/null)" - echo "${ref/refs\/heads\//⭠ }$(parse_git_dirty)" +function segment_stop() { + if [[ -n $CURRENT_BG ]]; then + echo -n " %{%k%F{$CURRENT_BG}%}$SEGMENT_SEPARATOR" + else + echo -n "%{%k%}" + fi + echo -n "%{%f%}" + CURRENT_BG='' } -function _git_info() { +### Prompt components +# Each component will draw itself, and hide itself if no information needs to be shown + +function prompt_context() { + local user=`whoami` + + if [[ ("$user" != "$DEFAULT_USER") || (-n "$SSH_CLIENT") ]]; then + segment_start black + #echo -n "%{%F{yellow}%}$user%{%F{gray}%}@%{%F{green}%}%m%{%f%}" + echo -n "%(!.%{%F{yellow}%}.)$user@%m" + fi +} + +function prompt_git() { if $(git rev-parse --is-inside-work-tree >/dev/null 2>&1); then - local BG_COLOR=green - if [[ -n $(parse_git_dirty) ]]; then - BG_COLOR=yellow + ZSH_THEME_GIT_PROMPT_DIRTY='±' + local dirty=$(parse_git_dirty) + local ref + ref=$(git symbolic-ref HEAD 2> /dev/null) || ref="➦ $(git show-ref --head -s --abbrev |head -n1 2> /dev/null)" + if [[ -n $dirty ]]; then + segment_start yellow black + else + segment_start green black fi - echo "%{%K{$BG_COLOR}%}⮀%{%F{black}%} $(_git_prompt_info) %{%F{$BG_COLOR}%K{blue}%}⮀" - else - echo "%{%K{blue}%}⮀" + echo -n "${ref/refs\/heads\//⭠ }$dirty" + fi +} + +function prompt_dir() { + segment_start blue white + echo -n '%~' +} + +function prompt_status() { + local symbols + symbols=() + [[ $RETVAL -ne 0 ]] && symbols+="%{%F{red}%}✘" + [[ $UID -eq 0 ]] && symbols+="%{%F{yellow}%}⚡" + jobs=$(jobs -l | wc -l) + [[ $jobs -gt 0 ]] && symbols+="%{%F{cyan}%}⚙" + if [[ -n "$symbols" ]]; then + segment_start black white + echo -n "${symbols}" fi } -PROMPT_HOST='%{%b%F{gray}%K{black}%} %(?.%{%F{green}%}✔.%{%F{red}%}✘)%{%F{gray}%} %m %{%F{black}%}' -PROMPT_DIR='%{%F{white}%} %1~ ' -PROMPT_SU='%(!.%{%k%F{blue}%K{black}%}⮀%{%F{yellow}%} ⚡ %{%k%F{black}%}.%{%k%F{blue}%})⮀%{%f%k%b%}' +## Main prompt +function build_prompt() { + RETVAL=$? + prompt_status + prompt_context + prompt_dir + prompt_git + segment_stop +} PROMPT='%{%f%b%k%} -$PROMPT_HOST$(_git_info)$PROMPT_DIR$PROMPT_SU ' +$(build_prompt) ' -- cgit v1.2.3-70-g09d2 From b534b3806357492a19b25841c7c0ad6a416f33aa Mon Sep 17 00:00:00 2001 From: Tyler Cipriani Date: Mon, 17 Sep 2012 12:16:06 -0600 Subject: Added fat arrow the theme --- themes/junkfood.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'themes') diff --git a/themes/junkfood.zsh-theme b/themes/junkfood.zsh-theme index bfe3913de..a3631a2b0 100644 --- a/themes/junkfood.zsh-theme +++ b/themes/junkfood.zsh-theme @@ -5,7 +5,7 @@ # ------------------------------------------------------------------------ # Grab the current date (%W) and time (%t): -JUNKFOOD_TIME_="%{$fg_bold[white]%}# %t%{$fg_bold[white]%} – %{$fg_bold[yellow]%}%W%{$fg_bold[white]%} – %{$reset_color%}" +JUNKFOOD_TIME_="%{$fg_bold[red]%}#➜%{$fg_bold[white]%}%t – %{$fg_bold[yellow]%}%W%{$fg_bold[white]%} – %{$reset_color%}" # Grab the current machine name JUNKFOOD_MACHINE_="%{$fg_bold[blue]%}%m%{$fg[white]%}:%{$reset_color%}" -- cgit v1.2.3-70-g09d2 From a8d426087bf5f79ee4c8c05e8debca01b4af5fd5 Mon Sep 17 00:00:00 2001 From: Tyler Cipriani Date: Mon, 17 Sep 2012 14:12:09 -0600 Subject: modified spacing on junkfood theme --- themes/junkfood.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'themes') diff --git a/themes/junkfood.zsh-theme b/themes/junkfood.zsh-theme index a3631a2b0..bb250e19b 100644 --- a/themes/junkfood.zsh-theme +++ b/themes/junkfood.zsh-theme @@ -31,4 +31,4 @@ ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[red]%}✗✗✗" # Put it all together! PROMPT="$JUNKFOOD_TIME_$JUNKFOOD_CURRENT_USER_@$JUNKFOOD_MACHINE_$JUNKFOOD_LOCA_ - " + " -- cgit v1.2.3-70-g09d2 From 9510eb0e5a2ae7526ac66bec8e01c39322a8b254 Mon Sep 17 00:00:00 2001 From: Tyler Cipriani Date: Tue, 18 Sep 2012 11:13:36 -0600 Subject: Modified spacing one last time --- themes/junkfood.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'themes') diff --git a/themes/junkfood.zsh-theme b/themes/junkfood.zsh-theme index bb250e19b..5022a8d98 100644 --- a/themes/junkfood.zsh-theme +++ b/themes/junkfood.zsh-theme @@ -5,7 +5,7 @@ # ------------------------------------------------------------------------ # Grab the current date (%W) and time (%t): -JUNKFOOD_TIME_="%{$fg_bold[red]%}#➜%{$fg_bold[white]%}%t – %{$fg_bold[yellow]%}%W%{$fg_bold[white]%} – %{$reset_color%}" +JUNKFOOD_TIME_="%{$fg_bold[red]%}#➜ %{$fg_bold[white]%}%t – %{$fg_bold[yellow]%}%W%{$fg_bold[white]%} – %{$reset_color%}" # Grab the current machine name JUNKFOOD_MACHINE_="%{$fg_bold[blue]%}%m%{$fg[white]%}:%{$reset_color%}" -- cgit v1.2.3-70-g09d2 From 8ecc252f0cfd21281be4e4549a8c86248e85a700 Mon Sep 17 00:00:00 2001 From: Tyler Cipriani Date: Wed, 19 Sep 2012 09:34:45 -0600 Subject: Last spacing adjustment...I swear --- themes/junkfood.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'themes') diff --git a/themes/junkfood.zsh-theme b/themes/junkfood.zsh-theme index 5022a8d98..bb250e19b 100644 --- a/themes/junkfood.zsh-theme +++ b/themes/junkfood.zsh-theme @@ -5,7 +5,7 @@ # ------------------------------------------------------------------------ # Grab the current date (%W) and time (%t): -JUNKFOOD_TIME_="%{$fg_bold[red]%}#➜ %{$fg_bold[white]%}%t – %{$fg_bold[yellow]%}%W%{$fg_bold[white]%} – %{$reset_color%}" +JUNKFOOD_TIME_="%{$fg_bold[red]%}#➜%{$fg_bold[white]%}%t – %{$fg_bold[yellow]%}%W%{$fg_bold[white]%} – %{$reset_color%}" # Grab the current machine name JUNKFOOD_MACHINE_="%{$fg_bold[blue]%}%m%{$fg[white]%}:%{$reset_color%}" -- cgit v1.2.3-70-g09d2 From 00bff0a9963d4b36e6afc968449781c727bfef3b Mon Sep 17 00:00:00 2001 From: James Smith Date: Thu, 20 Sep 2012 19:35:09 -0700 Subject: Red prompt for remote hosts --- themes/intheloop.zsh-theme | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'themes') diff --git a/themes/intheloop.zsh-theme b/themes/intheloop.zsh-theme index c4736422d..85b4a4d95 100644 --- a/themes/intheloop.zsh-theme +++ b/themes/intheloop.zsh-theme @@ -3,10 +3,16 @@ local return_status="%{$fg[red]%}%(?..⏎)%{$reset_color%}" +local host_color="green" +if [ -n "$SSH_CLIENT" ]; then + local host_color="red" +fi + PROMPT=' -%{$fg_bold[grey]%}[%{$reset_color%}%{$fg_bold[green]%}%n@%m%{$reset_color%}%{$fg_bold[grey]%}]%{$reset_color%} %{$fg_bold[blue]%}%10c%{$reset_color%} $(git_prompt_info) $(git_remote_status) +%{$fg_bold[grey]%}[%{$reset_color%}%{$fg_bold[${host_color}]%}%n@%m%{$reset_color%}%{$fg_bold[grey]%}]%{$reset_color%} %{$fg_bold[blue]%}%10c%{$reset_color%} $(git_prompt_info) $(git_remote_status) %{$fg_bold[cyan]%}❯%{$reset_color%} ' + RPROMPT='${return_status}%{$reset_color%}' ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[grey]%}(%{$fg[red]%}" -- cgit v1.2.3-70-g09d2 From 6e85ff5b44e81f5b9d743b6ba1df7ed7b62dc2df Mon Sep 17 00:00:00 2001 From: Isaac Wolkerstorfer Date: Tue, 25 Sep 2012 18:35:08 -0500 Subject: Updated documentation for agnoster theme --- themes/agnoster.zsh-theme | 99 ++++++++++++++++++++++++++++++----------------- 1 file changed, 64 insertions(+), 35 deletions(-) (limited to 'themes') diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme index 9cfcff3d0..71bc25fc2 100644 --- a/themes/agnoster.zsh-theme +++ b/themes/agnoster.zsh-theme @@ -1,22 +1,51 @@ +# vim:ft=zsh ts=2 sw=2 sts=2 +# +# agnoster's Theme +# A Powerline-inspired theme for ZSH +# +# # README +# +# In order for this theme to render correctly, you will need a +# [Powerline-patched font](https://gist.github.com/1595572). +# +# In addition, I recommend the +# [Solarized theme](https://github.com/altercation/solarized/) and, if you're +# using it on Mac OS X, [iTerm 2](http://www.iterm2.com/) over Terminal.app - +# it has significantly better color fidelity. +# +# # Goals +# +# The aim of this theme is to only show you *relevant* information. Like most +# prompts, it will only show git information when in a git working directory. +# However, it goes a step further: everything from the current user and +# hostname to whether the last call exited with an error to whether background +# jobs are running in this shell will all be displayed automatically when +# appropriate. + ### Segment drawing # A few utility functions to make it easy and re-usable to draw segmented prompts -CURRENT_BG='' +CURRENT_BG='NONE' SEGMENT_SEPARATOR='⮀' -function segment_start() { - local bg=$1 - local fg=$2 - if [[ -n $CURRENT_BG && $bg != $CURRENT_BG ]]; then - echo -n " %{%K{$bg}%F{$CURRENT_BG}%}$SEGMENT_SEPARATOR" + +# Begin a segment +# Takes two arguments, background and foreground. Both can be omitted, +# rendering default background/foreground. +prompt_segment() { + local bg fg + [[ -n $1 ]] && bg="%K{$1}" || bg="%k" + [[ -n $2 ]] && fg="%F{$2}" || fg="%f" + if [[ $CURRENT_BG != 'NONE' && $1 != $CURRENT_BG ]]; then + echo -n " %{$bg%F{$CURRENT_BG}%}$SEGMENT_SEPARATOR%{$fg%} " else - echo -n "%{%K{$bg}%}" + echo -n "%{$bg%}%{$fg%} " fi - [[ -n $fg ]] && fg="%F{$fg}" || fg="%f" - echo -n "%{$fg%} " - CURRENT_BG=$bg + CURRENT_BG=$1 + [[ -n $3 ]] && echo -n $3 } -function segment_stop() { +# End the prompt, closing any open segments +prompt_end() { if [[ -n $CURRENT_BG ]]; then echo -n " %{%k%F{$CURRENT_BG}%}$SEGMENT_SEPARATOR" else @@ -29,58 +58,58 @@ function segment_stop() { ### Prompt components # Each component will draw itself, and hide itself if no information needs to be shown -function prompt_context() { +# Context: user@hostname (who am I and where am I) +prompt_context() { local user=`whoami` - if [[ ("$user" != "$DEFAULT_USER") || (-n "$SSH_CLIENT") ]]; then - segment_start black - #echo -n "%{%F{yellow}%}$user%{%F{gray}%}@%{%F{green}%}%m%{%f%}" - echo -n "%(!.%{%F{yellow}%}.)$user@%m" + if [[ "$user" != "$DEFAULT_USER" || -n "$SSH_CLIENT" ]]; then + prompt_segment black default "%(!.%{%F{yellow}%}.)$user@%m" fi } -function prompt_git() { +# Git: branch/detached head, dirty status +prompt_git() { + local ref dirty if $(git rev-parse --is-inside-work-tree >/dev/null 2>&1); then ZSH_THEME_GIT_PROMPT_DIRTY='±' - local dirty=$(parse_git_dirty) - local ref + dirty=$(parse_git_dirty) ref=$(git symbolic-ref HEAD 2> /dev/null) || ref="➦ $(git show-ref --head -s --abbrev |head -n1 2> /dev/null)" if [[ -n $dirty ]]; then - segment_start yellow black + prompt_segment yellow black else - segment_start green black + prompt_segment green black fi echo -n "${ref/refs\/heads\//⭠ }$dirty" fi } -function prompt_dir() { - segment_start blue white - echo -n '%~' +# Dir: current working directory +prompt_dir() { + prompt_segment blue black '%~' } -function prompt_status() { +# Status: +# - was there an error +# - am I root +# - are there background jobs? +prompt_status() { local symbols symbols=() [[ $RETVAL -ne 0 ]] && symbols+="%{%F{red}%}✘" [[ $UID -eq 0 ]] && symbols+="%{%F{yellow}%}⚡" - jobs=$(jobs -l | wc -l) - [[ $jobs -gt 0 ]] && symbols+="%{%F{cyan}%}⚙" - if [[ -n "$symbols" ]]; then - segment_start black white - echo -n "${symbols}" - fi + [[ $(jobs -l | wc -l) -gt 0 ]] && symbols+="%{%F{cyan}%}⚙" + + [[ -n "$symbols" ]] && prompt_segment black default "$symbols" } ## Main prompt -function build_prompt() { +build_prompt() { RETVAL=$? prompt_status prompt_context prompt_dir prompt_git - segment_stop + prompt_end } -PROMPT='%{%f%b%k%} -$(build_prompt) ' +PROMPT='%{%f%b%k%}$(build_prompt) ' -- cgit v1.2.3-70-g09d2 From b207792f30f523e2fc82a70e75893bf1124bf7a8 Mon Sep 17 00:00:00 2001 From: Isaac Wolkerstorfer Date: Tue, 25 Sep 2012 19:06:13 -0500 Subject: Add link to gist --- themes/agnoster.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'themes') diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme index 71bc25fc2..c3107c06c 100644 --- a/themes/agnoster.zsh-theme +++ b/themes/agnoster.zsh-theme @@ -1,6 +1,6 @@ # vim:ft=zsh ts=2 sw=2 sts=2 # -# agnoster's Theme +# agnoster's Theme - https://gist.github.com/3712874 # A Powerline-inspired theme for ZSH # # # README -- cgit v1.2.3-70-g09d2 From 8d86bb298d51d619c88d2aad400007b67c4d438b Mon Sep 17 00:00:00 2001 From: Tyler Cipriani Date: Thu, 11 Oct 2012 09:26:39 -0600 Subject: moved spacing --- themes/junkfood.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'themes') diff --git a/themes/junkfood.zsh-theme b/themes/junkfood.zsh-theme index bb250e19b..1d574664d 100644 --- a/themes/junkfood.zsh-theme +++ b/themes/junkfood.zsh-theme @@ -5,7 +5,7 @@ # ------------------------------------------------------------------------ # Grab the current date (%W) and time (%t): -JUNKFOOD_TIME_="%{$fg_bold[red]%}#➜%{$fg_bold[white]%}%t – %{$fg_bold[yellow]%}%W%{$fg_bold[white]%} – %{$reset_color%}" +JUNKFOOD_TIME_="%{$fg_bold[red]%}#➜%{$fg_bold[white]%}%t–%{$fg_bold[yellow]%}%W%{$fg_bold[white]%}–%{$reset_color%}" # Grab the current machine name JUNKFOOD_MACHINE_="%{$fg_bold[blue]%}%m%{$fg[white]%}:%{$reset_color%}" -- cgit v1.2.3-70-g09d2 From bb5db62314b0fb31b21326d8483c5e97405c07bb Mon Sep 17 00:00:00 2001 From: Tyler Cipriani Date: Thu, 11 Oct 2012 13:48:38 -0600 Subject: removed weird characters --- themes/junkfood.zsh-theme | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'themes') diff --git a/themes/junkfood.zsh-theme b/themes/junkfood.zsh-theme index 1d574664d..f9bb28fad 100644 --- a/themes/junkfood.zsh-theme +++ b/themes/junkfood.zsh-theme @@ -5,10 +5,10 @@ # ------------------------------------------------------------------------ # Grab the current date (%W) and time (%t): -JUNKFOOD_TIME_="%{$fg_bold[red]%}#➜%{$fg_bold[white]%}%t–%{$fg_bold[yellow]%}%W%{$fg_bold[white]%}–%{$reset_color%}" +JUNKFOOD_TIME_="%{$fg_bold[red]%}#(%{$fg_bold[white]%}%t on %{$fg_bold[yellow]%}%W%{$fg_bold[white]%})%{$reset_color%}" # Grab the current machine name -JUNKFOOD_MACHINE_="%{$fg_bold[blue]%}%m%{$fg[white]%}:%{$reset_color%}" +JUNKFOOD_MACHINE_="%{$fg_bold[blue]%}%m%{$fg[white]%}):%{$reset_color%}" # Grab the current username JUNKFOOD_CURRENT_USER_="%{$fg_bold[green]%}%n%{$reset_color%}" -- cgit v1.2.3-70-g09d2 From 2ba668b91ccfdf6dd273d5b1358ee9cafa302534 Mon Sep 17 00:00:00 2001 From: Tyler Cipriani Date: Thu, 11 Oct 2012 13:57:21 -0600 Subject: parens tweak --- themes/junkfood.zsh-theme | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'themes') diff --git a/themes/junkfood.zsh-theme b/themes/junkfood.zsh-theme index f9bb28fad..835103532 100644 --- a/themes/junkfood.zsh-theme +++ b/themes/junkfood.zsh-theme @@ -5,10 +5,10 @@ # ------------------------------------------------------------------------ # Grab the current date (%W) and time (%t): -JUNKFOOD_TIME_="%{$fg_bold[red]%}#(%{$fg_bold[white]%}%t on %{$fg_bold[yellow]%}%W%{$fg_bold[white]%})%{$reset_color%}" +JUNKFOOD_TIME_="%{$fg_bold[red]%}#%{$fg_bold[white]%}( %t on %{$fg_bold[yellow]%}%W%{$fg_bold[white]%} )( %{$reset_color%}" # Grab the current machine name -JUNKFOOD_MACHINE_="%{$fg_bold[blue]%}%m%{$fg[white]%}):%{$reset_color%}" +JUNKFOOD_MACHINE_="%{$fg_bold[blue]%}%m%{$fg[white]%} ):%{$reset_color%}" # Grab the current username JUNKFOOD_CURRENT_USER_="%{$fg_bold[green]%}%n%{$reset_color%}" -- cgit v1.2.3-70-g09d2 From 5872daea49104607efd64208a314aba10823af0b Mon Sep 17 00:00:00 2001 From: Tyler Cipriani Date: Thu, 11 Oct 2012 13:59:08 -0600 Subject: spacing makes me something --- themes/junkfood.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'themes') diff --git a/themes/junkfood.zsh-theme b/themes/junkfood.zsh-theme index 835103532..c2a96ed7b 100644 --- a/themes/junkfood.zsh-theme +++ b/themes/junkfood.zsh-theme @@ -31,4 +31,4 @@ ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[red]%}✗✗✗" # Put it all together! PROMPT="$JUNKFOOD_TIME_$JUNKFOOD_CURRENT_USER_@$JUNKFOOD_MACHINE_$JUNKFOOD_LOCA_ - " + " -- cgit v1.2.3-70-g09d2 From 53412de75c982a07fac902e8deec929c4fe32abc Mon Sep 17 00:00:00 2001 From: Tyler Cipriani Date: Thu, 11 Oct 2012 14:02:55 -0600 Subject: Something to be said for symmetry --- themes/junkfood.zsh-theme | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'themes') diff --git a/themes/junkfood.zsh-theme b/themes/junkfood.zsh-theme index c2a96ed7b..57b4070dc 100644 --- a/themes/junkfood.zsh-theme +++ b/themes/junkfood.zsh-theme @@ -5,7 +5,7 @@ # ------------------------------------------------------------------------ # Grab the current date (%W) and time (%t): -JUNKFOOD_TIME_="%{$fg_bold[red]%}#%{$fg_bold[white]%}( %t on %{$fg_bold[yellow]%}%W%{$fg_bold[white]%} )( %{$reset_color%}" +JUNKFOOD_TIME_="%{$fg_bold[red]%}#%{$fg_bold[white]%}( %{$fg_bold[yellow]%}%W%{$reset_color%}@%{$fg_bold[white]%}%t )( %{$reset_color%}" # Grab the current machine name JUNKFOOD_MACHINE_="%{$fg_bold[blue]%}%m%{$fg[white]%} ):%{$reset_color%}" @@ -31,4 +31,4 @@ ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[red]%}✗✗✗" # Put it all together! PROMPT="$JUNKFOOD_TIME_$JUNKFOOD_CURRENT_USER_@$JUNKFOOD_MACHINE_$JUNKFOOD_LOCA_ - " + " -- cgit v1.2.3-70-g09d2 From 8f7b126d2f7369dde512f61f9351809ebf27649e Mon Sep 17 00:00:00 2001 From: Alexander Berezovsky Date: Sat, 13 Oct 2012 13:33:28 -0700 Subject: updated symbol --- themes/fino-time.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'themes') diff --git a/themes/fino-time.zsh-theme b/themes/fino-time.zsh-theme index 22c7a0981..7154e09f1 100644 --- a/themes/fino-time.zsh-theme +++ b/themes/fino-time.zsh-theme @@ -16,7 +16,7 @@ function virtualenv_info { } function prompt_char { - git branch >/dev/null 2>/dev/null && echo '±' && return + git branch >/dev/null 2>/dev/null && echo '⠠⠵' && return echo '○' } -- cgit v1.2.3-70-g09d2 From f09af5717923cca4e5c538e14846ea4816295949 Mon Sep 17 00:00:00 2001 From: Fuad Saud Date: Sat, 3 Nov 2012 05:05:38 -0200 Subject: agnoster theme shows error code instead of an "x" --- themes/agnoster.zsh-theme | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'themes') diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme index c3107c06c..84b9649a6 100644 --- a/themes/agnoster.zsh-theme +++ b/themes/agnoster.zsh-theme @@ -73,7 +73,7 @@ prompt_git() { if $(git rev-parse --is-inside-work-tree >/dev/null 2>&1); then ZSH_THEME_GIT_PROMPT_DIRTY='±' dirty=$(parse_git_dirty) - ref=$(git symbolic-ref HEAD 2> /dev/null) || ref="➦ $(git show-ref --head -s --abbrev |head -n1 2> /dev/null)" + ref=$(git symbolic-Fref HEAD 2> /dev/null) || ref="➦ $(git show-ref --head -s --abbrev |head -n1 2> /dev/null)" if [[ -n $dirty ]]; then prompt_segment yellow black else @@ -95,7 +95,7 @@ prompt_dir() { prompt_status() { local symbols symbols=() - [[ $RETVAL -ne 0 ]] && symbols+="%{%F{red}%}✘" + [[ $RETVAL -ne 0 ]] && symbols+="%{%F{red}%}$RETVAL" [[ $UID -eq 0 ]] && symbols+="%{%F{yellow}%}⚡" [[ $(jobs -l | wc -l) -gt 0 ]] && symbols+="%{%F{cyan}%}⚙" @@ -106,10 +106,10 @@ prompt_status() { build_prompt() { RETVAL=$? prompt_status - prompt_context + prompt_contextx prompt_dir prompt_git prompt_end } -PROMPT='%{%f%b%k%}$(build_prompt) ' +PROMPT='%{%f%b%k%}$(build_prompt) ' \ No newline at end of file -- cgit v1.2.3-70-g09d2 From 99468cb4ec38f11b78ac71cae0c9ac70ac0a516e Mon Sep 17 00:00:00 2001 From: Brian Hartvigsen Date: Wed, 7 Nov 2012 23:53:44 -0700 Subject: Update themes/minimal.zsh-theme Cleans up minimal theme by not using a custom prompt function Removed case of 2 spaces showing if not in a version controlled folder Adds support for svn_prompt_info --- themes/minimal.zsh-theme | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'themes') diff --git a/themes/minimal.zsh-theme b/themes/minimal.zsh-theme index ee3ab6b22..a2a16031f 100644 --- a/themes/minimal.zsh-theme +++ b/themes/minimal.zsh-theme @@ -1,15 +1,18 @@ ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[white]%}[" -ZSH_THEME_GIT_PROMPT_SUFFIX="]%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}●%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_CLEAN="" +ZSH_THEME_GIT_PROMPT_SUFFIX="" +ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}●%{$reset_color%}]%{$reset_color%} " +ZSH_THEME_GIT_PROMPT_CLEAN="]%{$reset_color%} " +ZSH_THEME_SVN_PROMPT_PREFIX=$ZSH_THEME_GIT_PROMPT_PREFIX +ZSH_THEME_SVN_PROMPT_SUFFIX=$ZSH_THEME_GIT_PROMPT_SUFFIX +ZSH_THEME_SVN_PROMPT_DIRTY=$ZSH_THEME_GIT_PROMPT_DIRTY +ZSH_THEME_SVN_PROMPT_CLEAN=$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 "- $ZSH_THEME_GIT_PROMPT_PREFIX$(current_branch)$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_SUFFIX" - fi +vcs_status() { + if [[ ( $(whence in_svn) != "" ) && ( $(in_svn) == 1 ) ]]; then + svn_prompt_info + else + git_prompt_info + fi } - -PROMPT='%2~ $(git_custom_status) »%b ' \ No newline at end of file +PROMPT='%2~ $(vcs_status)»%b ' \ No newline at end of file -- cgit v1.2.3-70-g09d2 From 6c45d217af77552a4f0b09542985520a577af3d5 Mon Sep 17 00:00:00 2001 From: Tiago Ribeiro Date: Mon, 27 Aug 2012 17:20:07 +0100 Subject: Added host to prompt --- themes/norm.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'themes') diff --git a/themes/norm.zsh-theme b/themes/norm.zsh-theme index 5f0ad03ee..13077ccf5 100644 --- a/themes/norm.zsh-theme +++ b/themes/norm.zsh-theme @@ -1,4 +1,4 @@ -PROMPT='%{$fg[yellow]%}λ %{$fg[green]%}%c %{$fg[yellow]%}→ $(git_prompt_info)%{$reset_color%}' +PROMPT='%{$fg[yellow]%}λ %m %{$fg[green]%}%c %{$fg[yellow]%}→ $(git_prompt_info)%{$reset_color%}' ZSH_THEME_GIT_PROMPT_PREFIX="λ %{$fg[blue]%}git %{$fg[red]%}" ZSH_THEME_GIT_PROMPT_SUFFIX="%{$fg[yellow]%} → %{$reset_color%}" -- cgit v1.2.3-70-g09d2 From 7c768543df965ce5102b34e83fab78cf5e73b626 Mon Sep 17 00:00:00 2001 From: Cristian Măgherușan-Stanciu Date: Sat, 24 Nov 2012 20:33:25 +0100 Subject: Added a small mod of the tjkirch theme - single-line prompt - removed the extra line after each command output --- themes/tjkirch_mod.zsh-theme | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 themes/tjkirch_mod.zsh-theme (limited to 'themes') diff --git a/themes/tjkirch_mod.zsh-theme b/themes/tjkirch_mod.zsh-theme new file mode 100644 index 000000000..1b206a7e1 --- /dev/null +++ b/themes/tjkirch_mod.zsh-theme @@ -0,0 +1,13 @@ +ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[green]%}" +ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}⚡" +ZSH_THEME_GIT_PROMPT_CLEAN="" + +function prompt_char { + if [ $UID -eq 0 ]; then echo "%{$fg[red]%}#%{$reset_color%}"; else echo $; fi +} + +PROMPT='%(?,,%{$fg[red]%}FAIL: $?%{$reset_color%} +)%{$fg[magenta]%}%n%{$reset_color%}@%{$fg[yellow]%}%m%{$reset_color%}: %{$fg_bold[blue]%}%~%{$reset_color%}$(git_prompt_info) %_$(prompt_char) ' + +RPROMPT='%{$fg[green]%}[%*]%{$reset_color%}' -- cgit v1.2.3-70-g09d2 From 7fc612bcb991919d561fedc18eeaedfd9c568942 Mon Sep 17 00:00:00 2001 From: Hauke Stange Date: Tue, 27 Nov 2012 21:20:56 +0100 Subject: removed 'x' from prompt_context() function name --- themes/agnoster.zsh-theme | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'themes') diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme index 84b9649a6..5f83b820f 100644 --- a/themes/agnoster.zsh-theme +++ b/themes/agnoster.zsh-theme @@ -106,10 +106,10 @@ prompt_status() { build_prompt() { RETVAL=$? prompt_status - prompt_contextx + prompt_context prompt_dir prompt_git prompt_end } -PROMPT='%{%f%b%k%}$(build_prompt) ' \ No newline at end of file +PROMPT='%{%f%b%k%}$(build_prompt) ' -- cgit v1.2.3-70-g09d2 From 3d7622831fd86a3eaf4bbe3a11102929716d3781 Mon Sep 17 00:00:00 2001 From: Hauke Stange Date: Tue, 27 Nov 2012 21:43:23 +0100 Subject: fixed symbolic-ref git view of agnoster theme --- themes/agnoster.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'themes') diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme index 5f83b820f..bd6f1a6a2 100644 --- a/themes/agnoster.zsh-theme +++ b/themes/agnoster.zsh-theme @@ -73,7 +73,7 @@ prompt_git() { if $(git rev-parse --is-inside-work-tree >/dev/null 2>&1); then ZSH_THEME_GIT_PROMPT_DIRTY='±' dirty=$(parse_git_dirty) - ref=$(git symbolic-Fref HEAD 2> /dev/null) || ref="➦ $(git show-ref --head -s --abbrev |head -n1 2> /dev/null)" + ref=$(git symbolic-ref HEAD 2> /dev/null) || ref="➦ $(git show-ref --head -s --abbrev |head -n1 2> /dev/null)" if [[ -n $dirty ]]; then prompt_segment yellow black else -- cgit v1.2.3-70-g09d2 From f9de64460ce51e105f27d30a9ecb20612ab65d57 Mon Sep 17 00:00:00 2001 From: Alexander Simonov Date: Sun, 22 May 2011 01:29:41 +0200 Subject: Simonoff theme --- themes/simonoff.zsh-theme | 142 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 142 insertions(+) create mode 100644 themes/simonoff.zsh-theme (limited to 'themes') diff --git a/themes/simonoff.zsh-theme b/themes/simonoff.zsh-theme new file mode 100644 index 000000000..01f381c48 --- /dev/null +++ b/themes/simonoff.zsh-theme @@ -0,0 +1,142 @@ +# Prompt +# +# Below are the color init strings for the basic file types. A color init +# string consists of one or more of the following numeric codes: +# Attribute codes: +# 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed +# Text color codes: +# 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white +# Background color codes: +# 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white +function precmd { + + local TERMWIDTH + (( TERMWIDTH = ${COLUMNS} - 1 )) + + + ### + # Truncate the path if it's too long. + + PR_FILLBAR="" + PR_PWDLEN="" + + local promptsize=${#${(%):---(%n@%M:%l)---()}} + local pwdsize=${#${(%):-%~}} + local gitbranch="$(git_prompt_info)" + local rvmprompt="$(rvm_prompt_info)" + local gitbranchsize=${#${gitbranch:-''}} + local rvmpromptsize=${#${rvmprompt:-''}} + + if [[ "$promptsize + $pwdsize + $rvmpromptsize + $gitbranchsize" -gt $TERMWIDTH ]]; then + ((PR_PWDLEN=$TERMWIDTH - $promptsize)) + else + PR_FILLBAR="\${(l.(($TERMWIDTH - ($promptsize + $pwdsize + $rvmpromptsize + $gitbranchsize)))..${PR_SPACE}.)}" + fi +} + + +setopt extended_glob + +preexec () { + if [[ "$TERM" == "screen" ]]; then + local CMD=${1[(wr)^(*=*|sudo|-*)]} + echo -n "\ek$CMD\e\\" + fi + + if [[ "$TERM" == "xterm" ]]; then + print -Pn "\e]0;$1\a" + fi + + if [[ "$TERM" == "rxvt" ]]; then + print -Pn "\e]0;$1\a" + fi + +} + +setprompt () { +### +# Need this so the prompt will work. + + setopt prompt_subst + + +### +# See if we can use colors. + + autoload colors zsh/terminfo + if [[ "$terminfo[colors]" -ge 8 ]]; then + colors + fi + for color in RED GREEN YELLOW BLUE MAGENTA CYAN WHITE; do + eval PR_$color='%{$terminfo[bold]$fg[${(L)color}]%}' + eval PR_LIGHT_$color='%{$fg[${(L)color}]%}' + (( count = $count + 1 )) + done + PR_NO_COLOUR="%{$terminfo[sgr0]%}" + + +### +# See if we can use extended characters to look nicer. + + typeset -A altchar +# set -A altchar "${(s..)terminfo[acsc]}" + PR_SET_CHARSET="%{$terminfo[enacs]%}" + PR_HBAR=${altchar[q]:--} + PR_ULCORNER=${altchar[l]:--} + PR_LLCORNER=${altchar[m]:--} + PR_LRCORNER=${altchar[j]:--} + PR_URCORNER=${altchar[k]:--} + + ### + # Modify Git prompt + ZSH_THEME_GIT_PROMPT_PREFIX=" [" + ZSH_THEME_GIT_PROMPT_SUFFIX="]" + ### + # Modify RVM prompt + ZSH_THEME_RVM_PROMPT_PREFIX=" [" + ZSH_THEME_RVM_PROMPT_SUFFIX="]" + ZSH_THEME_RVM_PROMPT_OPTIONS=(v i) + + +### +# Decide if we need to set titlebar text. + + case $TERM in + xterm*|*rxvt*) + PR_TITLEBAR=$'%{\e]0;%(!.-=*[ROOT]*=- | .)%n@%M:%~ $(git_prompt_info) $(rvm_prompt_info) | ${COLUMNS}x${LINES} | %y\a%}' + ;; + screen) + PR_TITLEBAR=$'%{\e_screen \005 (\005t) | %(!.-=[ROOT]=- | .)%n@%m:%~ | ${COLUMNS}x${LINES} | %y\e\\%}' + ;; + *) + PR_TITLEBAR='' + ;; + esac + + +### +# Decide whether to set a screen title + if [[ "$TERM" == "screen" ]]; then + PR_STITLE=$'%{\ekzsh\e\\%}' + else + PR_STITLE='' + fi + +### +# Finally, the prompt. +# + PROMPT='$PR_SET_CHARSET$PR_STITLE${(e)PR_TITLEBAR}\ +$PR_RED$PR_HBAR<\ +$PR_BLUE%(!.$PR_RED%SROOT%s.%n)$PR_GREEN@$PR_BLUE%M:$PR_GREEN%$PR_PWDLEN<...<%~$PR_CYAN$(git_prompt_info)$(rvm_prompt_info)\ +$PR_RED>$PR_HBAR$PR_SPACE${(e)PR_FILLBAR}\ +$PR_RED$PR_HBAR<\ +$PR_GREEN%l$PR_RED>$PR_HBAR\ + +$PR_RED$PR_HBAR<\ +%(?..$PR_LIGHT_RED%?$PR_BLUE:)\ +$PR_LIGHT_BLUE%(!.$PR_RED.$PR_WHITE)%#$PR_RED>$PR_HBAR\ +$PR_NO_COLOUR ' + +} + +setprompt -- cgit v1.2.3-70-g09d2 From 27841ca7c1bb6bd19e0eb66e1dcc8fa3a6a6ebba Mon Sep 17 00:00:00 2001 From: Alexander Simonov Date: Sun, 2 Dec 2012 20:30:25 +0200 Subject: Set default for rvm prompt prefix/suffix --- lib/rvm.zsh | 5 +---- themes/simonoff.zsh-theme | 1 - 2 files changed, 1 insertion(+), 5 deletions(-) (limited to 'themes') diff --git a/lib/rvm.zsh b/lib/rvm.zsh index a0a48960e..e8744e61e 100644 --- a/lib/rvm.zsh +++ b/lib/rvm.zsh @@ -1,11 +1,8 @@ -# load RVM -[[ -s $HOME/.rvm/scripts/rvm ]] && source $HOME/.rvm/scripts/rvm - # get the name of the ruby version function rvm_prompt_info() { [ -f $HOME/.rvm/bin/rvm-prompt ] || return local rvm_prompt rvm_prompt=$($HOME/.rvm/bin/rvm-prompt ${ZSH_THEME_RVM_PROMPT_OPTIONS} 2>/dev/null) [[ "${rvm_prompt}x" == "x" ]] && return - echo "$ZSH_THEME_RVM_PROMPT_PREFIX$rvm_prompt$ZSH_THEME_RVM_PROMPT_SUFFIX" + echo "${ZSH_THEME_RVM_PROMPT_PREFIX:=(}${rvm_prompt}${ZSH_THEME_RVM_PROMPT_SUFFIX:=)}" } diff --git a/themes/simonoff.zsh-theme b/themes/simonoff.zsh-theme index 01f381c48..fb4d32e24 100644 --- a/themes/simonoff.zsh-theme +++ b/themes/simonoff.zsh-theme @@ -95,7 +95,6 @@ setprompt () { # Modify RVM prompt ZSH_THEME_RVM_PROMPT_PREFIX=" [" ZSH_THEME_RVM_PROMPT_SUFFIX="]" - ZSH_THEME_RVM_PROMPT_OPTIONS=(v i) ### -- cgit v1.2.3-70-g09d2 From 5f62d2c183f93ef02b79675c6a51950cb530dfcb Mon Sep 17 00:00:00 2001 From: Sean Jones Date: Sun, 2 Dec 2012 19:46:53 +0000 Subject: Added Candy-Kingdom theme --- themes/candy-kingdom.zsh-theme | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 themes/candy-kingdom.zsh-theme (limited to 'themes') diff --git a/themes/candy-kingdom.zsh-theme b/themes/candy-kingdom.zsh-theme new file mode 100644 index 000000000..25aeb6597 --- /dev/null +++ b/themes/candy-kingdom.zsh-theme @@ -0,0 +1,37 @@ +# neuralsanwich.zsh-theme +# +# Author: Sean Jones +# URL: http://www.neuralsandwich.com +# Repo: +# Direct link: +# Create: +# Modified: + +if [ "x$OH_MY_ZSH_HG" = "x" ]; then + OH_MY_ZSH_HG="hg" +fi + +function hg_prompt_info { + $OH_MY_ZSH_HG prompt --angle-brackets "\ +< on %{$fg[magenta]%}%{$reset_color%}>\ +< at %{$fg[yellow]%}%{$reset_color%}>\ +%{$fg[green]%}%{$reset_color%}< +patches: >" 2>/dev/null +} + +function box_name { + [ -f ~/.box-name ] && cat ~/.box-name || hostname -s +} + +PROMPT=' +%{$fg[magenta]%}%n%{$reset_color%}@%{$fg[yellow]%}$(box_name)%{$reset_color%}:%{$fg_bold[green]%}${PWD/#$HOME/~}%{$reset_color%}$(hg_prompt_info)$(git_prompt_info) +%(?,,%{${fg_bold[white]}%}[%?]%{$reset_color%} )$ ' + +ZSH_THEME_GIT_PROMPT_PREFIX=" (%{$fg[magenta]%}branch: " +ZSH_THEME_GIT_PROMPT_CLEAN="" +ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[red]%}?" +ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[orange]%}!" +ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%})" + +local return_status="%{$fg[red]%}%(?..✘)%{$reset_color%}" +RPROMPT='${return_status}$(battery_time_remaining) $(battery_pct_prompt)%{$reset_color%}' -- cgit v1.2.3-70-g09d2 From e096e4041f76c70a621df2b02bb67bed88e6bcee Mon Sep 17 00:00:00 2001 From: Andrei Gorgan Date: Mon, 3 Dec 2012 12:03:43 +0200 Subject: Print last exit status in mortalscumbag prompt --- themes/mortalscumbag.zsh-theme | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'themes') diff --git a/themes/mortalscumbag.zsh-theme b/themes/mortalscumbag.zsh-theme index 7e25b149f..ae3f1c9fc 100644 --- a/themes/mortalscumbag.zsh-theme +++ b/themes/mortalscumbag.zsh-theme @@ -46,7 +46,8 @@ function ssh_connection() { fi } -PROMPT=$'\n$(ssh_connection)%{$fg_bold[green]%}%n@%m%{$reset_color%}$(my_git_prompt) : %~\n%# ' +local ret_status="%(?:%{$fg_bold[green]%}:%{$fg_bold[red]%})%?%{$reset_color%}" +PROMPT=$'\n$(ssh_connection)%{$fg_bold[cyan]%}%n@%m%{$reset_color%}$(my_git_prompt) : %~\n[${ret_status}] %# ' ZSH_THEME_PROMPT_RETURNCODE_PREFIX="%{$fg_bold[red]%}" ZSH_THEME_GIT_PROMPT_PREFIX=" $fg[white]‹ %{$fg_bold[yellow]%}" -- cgit v1.2.3-70-g09d2 From 8925cff334f9009a0f27d38922731bbcd82c42cb Mon Sep 17 00:00:00 2001 From: Andrei Gorgan Date: Mon, 3 Dec 2012 12:29:45 +0200 Subject: Fix prompt color: Change it back to green --- themes/mortalscumbag.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'themes') diff --git a/themes/mortalscumbag.zsh-theme b/themes/mortalscumbag.zsh-theme index ae3f1c9fc..5dbf2e4f6 100644 --- a/themes/mortalscumbag.zsh-theme +++ b/themes/mortalscumbag.zsh-theme @@ -47,7 +47,7 @@ function ssh_connection() { } local ret_status="%(?:%{$fg_bold[green]%}:%{$fg_bold[red]%})%?%{$reset_color%}" -PROMPT=$'\n$(ssh_connection)%{$fg_bold[cyan]%}%n@%m%{$reset_color%}$(my_git_prompt) : %~\n[${ret_status}] %# ' +PROMPT=$'\n$(ssh_connection)%{$fg_bold[green]%}%n@%m%{$reset_color%}$(my_git_prompt) : %~\n[${ret_status}] %# ' ZSH_THEME_PROMPT_RETURNCODE_PREFIX="%{$fg_bold[red]%}" ZSH_THEME_GIT_PROMPT_PREFIX=" $fg[white]‹ %{$fg_bold[yellow]%}" -- cgit v1.2.3-70-g09d2 From e4624c6a36a48dbae2d16241ee39ee14ce003f9f Mon Sep 17 00:00:00 2001 From: Isaac Wolkerstorfer Date: Fri, 21 Dec 2012 11:33:23 -0500 Subject: Revert "agnoster theme shows error code instead of an "x"" This reverts commit f09af5717923cca4e5c538e14846ea4816295949. It is far more aesthetically pleasing, and conveys the correct amount of information. The exact numeric status code is extremely rarely of use, and increases cognitive parsing burden on the user. (cherry picked from commit 8f664edcaf55adcc540f0fe43d4205b66e4f9fb6) --- themes/agnoster.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'themes') diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme index bd6f1a6a2..c3107c06c 100644 --- a/themes/agnoster.zsh-theme +++ b/themes/agnoster.zsh-theme @@ -95,7 +95,7 @@ prompt_dir() { prompt_status() { local symbols symbols=() - [[ $RETVAL -ne 0 ]] && symbols+="%{%F{red}%}$RETVAL" + [[ $RETVAL -ne 0 ]] && symbols+="%{%F{red}%}✘" [[ $UID -eq 0 ]] && symbols+="%{%F{yellow}%}⚡" [[ $(jobs -l | wc -l) -gt 0 ]] && symbols+="%{%F{cyan}%}⚙" -- cgit v1.2.3-70-g09d2