Skip to content

Instantly share code, notes, and snippets.

@igolden
Last active December 7, 2021 23:35
Show Gist options
  • Save igolden/b13f9353014327743137 to your computer and use it in GitHub Desktop.
Save igolden/b13f9353014327743137 to your computer and use it in GitHub Desktop.
# @igolden 2021
AT_SYMBOL="@"
IN_SYMBOL=""
ON_SYMBOL=""
SYMBOL="$"
USER_COLOR="%F{178}"
DEVICE_COLOR="%F{039}"
DIR_COLOR="%F{220}"
BRANCH_COLOR="%F{001}"
TIME_COLOR="%F{033}"
username() {
echo "$USER_COLOR%n%f"
}
# Returns device name
device() {
echo "$DEVICE_COLOR%m%f"
}
# The current directory
directory() {
echo "$DIR_COLOR%~%f"
}
# Current time with milliseconds
current_time() {
echo "$TIME_COLOR%*%f"
}
# Return status of the last command
return_status() {
echo "%(?..%F{001}out %?)%f"
}
# Set the git_prompt_info text
ZSH_THEME_GIT_PROMPT_PREFIX="${BRANCH_COLOR}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%f"
ZSH_THEME_GIT_PROMPT_DIRTY=""
ZSH_THEME_GIT_PROMPT_CLEAN=""
# %B and %b make the text bold
precmd () {
PROMPT="%b$(username)$AT_SYMBOL$(device):$(directory)%b $SYMBOL "
RPROMPT="$(git_prompt_info) %j [$(current_time)]"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment