Skip to content

Instantly share code, notes, and snippets.

@asapzacy
Last active January 31, 2022 22:49
Show Gist options
  • Save asapzacy/f512f92d9aec56ff62d2f7b058c65151 to your computer and use it in GitHub Desktop.
Save asapzacy/f512f92d9aec56ff62d2f7b058c65151 to your computer and use it in GitHub Desktop.
# Asap
# by Zac Arellano
# https://github.com/asapzacy/asap
# MIT License
# For my own and others sanity
# git:
# %b => current branch
# %a => current action (rebase/merge)
# prompt:
# %F => color dict
# %f => reset color
# %~ => current path
# %* => time
# %n => username
# %m => shortname host
# %(?..) => prompt conditional - %(condition.true.false)
# terminal codes:
# \e7 => save cursor position
# \e[2A => move cursor 2 lines up
# \e[1G => go to position 1 in terminal
# \e8 => restore cursor position
# \e[K => clears everything after the cursor on the current line
# \e[2K => clear everything on the current line
# local prefix="%{$fg_bold[blue]%}〉"
local white="%{$fg[white]%}"
local grey="%{%F{247}%}"
local red="%{$fg[red]%}"
local green="%{$fg[green]%}"
local blue="%{$fg[blue]%}"
local whiteBold="%{$fg_bold[white]%}"
local blueBold="%{$fg_bold[blue]%}"
local resetColor="%{$reset_color%}"
local prefix="${blueBold}〉${resetColor}"
local suffix="${blueBold}· ${resetColor}"
prompt_command () {
if [[ $(pwd) = *"/vendorportal/"* ]]; then
dir="${grey}vp|%c${resetColor}"
elif [[ $(pwd) = *"/ebill/"* ]]; then
dir="${grey}eb|%c${resetColor}"
else
dir="${grey}%c${resetColor}"
fi
echo $dir
}
ZSH_THEME_GIT_PROMPT_PREFIX="${white}at${resetColor} ${grey}"
ZSH_THEME_GIT_PROMPT_SUFFIX="${resetColor}"
ZSH_THEME_GIT_PROMPT_DIRTY="${red} ✗ ${resetColor}"
ZSH_THEME_GIT_PROMPT_CLEAN="${resetColor} "
# ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%} ✔ "
PROMPT_COMMAND=prompt_command
PROMPT='${prefix}$(prompt_command) $(git_prompt_info)% ${suffix}'
# RPROMPT="|%t"
RPROMPT='${grey}|%D{%L:%M:%S}|'
# RPROMPT='${grey}¦%D{%r}'
# RPROMPT="%{$fg[green]%}[%D{%@}]"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment