aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/prompt_adam3_setup
diff options
context:
space:
mode:
authorDennis Eriksen <dennis@eriksen.im>2015-06-29 13:50:59 +0200
committerDennis Eriksen <dennis@eriksen.im>2015-06-29 13:50:59 +0200
commit214b55d9a70b910cb82555b956fec2d84e119280 (patch)
treef5be3fcae2efc5ba7060f3c329c0092f161e506b /prompt_adam3_setup
parentadam3 is based upon adam1 from the zsh repo (diff)
downloadadam3-214b55d9a70b910cb82555b956fec2d84e119280.tar.gz
renaming to adam3, and adding a lincence
Diffstat (limited to '')
-rw-r--r--prompt_adam3_setup (renamed from prompt_adam1_setup)26
1 files changed, 13 insertions, 13 deletions
diff --git a/prompt_adam1_setup b/prompt_adam3_setup
index aca0e59..3fafb51 100644
--- a/prompt_adam1_setup
+++ b/prompt_adam3_setup
@@ -1,10 +1,10 @@
-# adam1 prompt theme
+# adam3 prompt theme
-prompt_adam1_help () {
+prompt_adam3_help () {
cat <<'EOF'
This prompt is color-scheme-able. You can invoke it thus:
- prompt adam1 [<color1> [<color2> [<color3>]]]
+ prompt adam3 [<color1> [<color2> [<color3>]]]
where the colors are for the user@host background, current working
directory, and current working directory if the prompt is split over
@@ -17,22 +17,22 @@ replacements for the 8-bit characters.
EOF
}
-prompt_adam1_setup () {
- prompt_adam1_color1=${1:-'blue'}
- prompt_adam1_color2=${2:-'cyan'}
- prompt_adam1_color3=${3:-'green'}
+prompt_adam3_setup () {
+ prompt_adam3_color1=${1:-'blue'}
+ prompt_adam3_color2=${2:-'cyan'}
+ prompt_adam3_color3=${3:-'green'}
- base_prompt="%K{$prompt_adam1_color1}%n@%m%k "
+ base_prompt="%K{$prompt_adam3_color1}%n@%m%k "
post_prompt="%b%f%k"
setopt localoptions extendedglob
base_prompt_no_color="${base_prompt//(%K{[^\\\}]#\}|%k)/}"
post_prompt_no_color="${post_prompt//(%K{[^\\\}]#\}|%k)/}"
- add-zsh-hook precmd prompt_adam1_precmd
+ add-zsh-hook precmd prompt_adam3_precmd
}
-prompt_adam1_precmd () {
+prompt_adam3_precmd () {
setopt noxtrace localoptions
local base_prompt_expanded_no_color base_prompt_etc
local prompt_length space_left
@@ -41,14 +41,14 @@ prompt_adam1_precmd () {
base_prompt_etc=$(print -P "$base_prompt%(4~|...|)%3~")
prompt_length=${#base_prompt_etc}
if [[ $prompt_length -lt 40 ]]; then
- path_prompt="%B%F{$prompt_adam1_color2}%(4~|...|)%3~%F{white}"
+ path_prompt="%B%F{$prompt_adam3_color2}%(4~|...|)%3~%F{white}"
else
space_left=$(( $COLUMNS - $#base_prompt_expanded_no_color - 2 ))
- path_prompt="%B%F{$prompt_adam1_color3}%${space_left}<...<%~$prompt_newline%F{white}"
+ path_prompt="%B%F{$prompt_adam3_color3}%${space_left}<...<%~$prompt_newline%F{white}"
fi
PS1="$base_prompt$path_prompt %# $post_prompt"
PS2="$base_prompt$path_prompt %_> $post_prompt"
PS3="$base_prompt$path_prompt ?# $post_prompt"
}
-prompt_adam1_setup "$@"
+prompt_adam3_setup "$@"