From d08624f37552a0d396b956f2a264db4ee0a6b5c8 Mon Sep 17 00:00:00 2001 From: Adam Ransom Date: Thu, 19 Apr 2012 18:33:21 +0900 Subject: [PATCH 1/3] Added the start of my own theme, based on blinks. --- themes/adamransom.zsh-theme | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 themes/adamransom.zsh-theme diff --git a/themes/adamransom.zsh-theme b/themes/adamransom.zsh-theme new file mode 100644 index 000000000..9200a821a --- /dev/null +++ b/themes/adamransom.zsh-theme @@ -0,0 +1,22 @@ +# https://github.com/adamransom zsh theme + +function _prompt_char() { + echo "%{$fg[blue]%}➜%{$reset_color%}" +} + +function _ssh_prompt() { + [[ -n "${SSH_CONNECTION}" ]] && "%n%{$fg_bold[blue]%}@%{$fg_bold[cyan]%}%m%{$fg_bold[green]%}" +} + +function _collapse_pwd { + echo $(pwd | sed -e "s,^$HOME,~,") +} + +ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg_bold[blue]%}" +ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}%{$bg[black]%}%{$fg_bold[green]%}" +ZSH_THEME_GIT_PROMPT_DIRTY=" %{$reset_color%}%{$bg[black]%}%{$fg[red]%}✘%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_CLEAN=" %{$reset_color%}%{$bg[black]%}%{$fg[green]%}✔%{$reset_color%}" + +PROMPT='%{$reset_color%} +%{%K{black}%B%F{green}%}$(_ssh_prompt)%{%b%F{yellow}%K{black}%}$(_collapse_pwd)%{%B%F{green}%}$(git_prompt_info)%E%{$reset_color%} +%{%K{black}%}$(_prompt_char)%{%K{black}%} %#%{$reset_color%} ' From b03027b74e089daf547a53ffdbf367936a9904cd Mon Sep 17 00:00:00 2001 From: Adam Ransom Date: Fri, 17 Aug 2012 11:48:55 +0900 Subject: [PATCH 2/3] fix prompt --- themes/adamransom.zsh-theme | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/themes/adamransom.zsh-theme b/themes/adamransom.zsh-theme index 9200a821a..8acd4b4d4 100644 --- a/themes/adamransom.zsh-theme +++ b/themes/adamransom.zsh-theme @@ -5,18 +5,22 @@ function _prompt_char() { } function _ssh_prompt() { - [[ -n "${SSH_CONNECTION}" ]] && "%n%{$fg_bold[blue]%}@%{$fg_bold[cyan]%}%m%{$fg_bold[green]%}" + [[ -n "${SSH_CONNECTION}" ]] && "%{$fg_bold[green]%}%n%{$fg_bold[blue]%}@%{$fg_bold[cyan]%}%m%{$fg_bold[green]%}" } function _collapse_pwd { echo $(pwd | sed -e "s,^$HOME,~,") } -ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg_bold[blue]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}%{$bg[black]%}%{$fg_bold[green]%}" -ZSH_THEME_GIT_PROMPT_DIRTY=" %{$reset_color%}%{$bg[black]%}%{$fg[red]%}✘%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_CLEAN=" %{$reset_color%}%{$bg[black]%}%{$fg[green]%}✔%{$reset_color%}" +precmd() +{ + print -rP ' +$(_ssh_prompt)%{$fg[yellow]%}$(_collapse_pwd)$(git_prompt_info)%{$reset_color%}' +} -PROMPT='%{$reset_color%} -%{%K{black}%B%F{green}%}$(_ssh_prompt)%{%b%F{yellow}%K{black}%}$(_collapse_pwd)%{%B%F{green}%}$(git_prompt_info)%E%{$reset_color%} -%{%K{black}%}$(_prompt_char)%{%K{black}%} %#%{$reset_color%} ' +ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg_bold[green]%}on %{$fg_bold[blue]%}" +ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_DIRTY=" %{$reset_color%}%{$fg[red]%}✘%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_CLEAN=" %{$reset_color%}%{$fg[green]%}✔%{$reset_color%}" + +PROMPT='$(_prompt_char) %#%{$reset_color%} ' From 32f3b4cb50687fa9d76f52d54786a2c07d7bfa65 Mon Sep 17 00:00:00 2001 From: Adam Ransom Date: Mon, 2 Sep 2013 13:40:18 +0900 Subject: [PATCH 3/3] fix ssh prompt --- themes/adamransom.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/adamransom.zsh-theme b/themes/adamransom.zsh-theme index 8acd4b4d4..720c75a06 100644 --- a/themes/adamransom.zsh-theme +++ b/themes/adamransom.zsh-theme @@ -5,7 +5,7 @@ function _prompt_char() { } function _ssh_prompt() { - [[ -n "${SSH_CONNECTION}" ]] && "%{$fg_bold[green]%}%n%{$fg_bold[blue]%}@%{$fg_bold[cyan]%}%m%{$fg_bold[green]%}" + [[ -n "${SSH_CONNECTION}" ]] && echo "%{$fg_bold[green]%}%n@%m%{$reset_color%} " } function _collapse_pwd {