mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-23 02:35:38 +01:00
add quantum theme
This commit is contained in:
parent
2423b7a12d
commit
83105d025d
1 changed files with 39 additions and 0 deletions
39
themes/quantum.zsh-theme
Normal file
39
themes/quantum.zsh-theme
Normal file
|
|
@ -0,0 +1,39 @@
|
||||||
|
# Quantum Theme For ZSH
|
||||||
|
|
||||||
|
# 🎨 Colors
|
||||||
|
local dir_color="%{$fg_bold[cyan]%}"
|
||||||
|
local branch_name_color="%{$fg_bold[yellow]%}"
|
||||||
|
local detached_color="%{$fg_bold[red]%}"
|
||||||
|
local arrow_color="%{$fg_bold[green]%}"
|
||||||
|
local reset="%{$reset_color%}"
|
||||||
|
|
||||||
|
# 📁 Current folder name
|
||||||
|
function quantum_dir_name() {
|
||||||
|
if [[ "$PWD" == "$HOME" ]]; then
|
||||||
|
echo "${dir_color}~${reset}"
|
||||||
|
elif [[ "$PWD" == "/" ]]; then
|
||||||
|
echo "${dir_color}/${reset}"
|
||||||
|
else
|
||||||
|
echo "${dir_color}${PWD##*/}${reset}"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# 🌿 Git branch (symbol + name only if on branch)
|
||||||
|
function quantum_git_info() {
|
||||||
|
git rev-parse --is-inside-work-tree &>/dev/null || return
|
||||||
|
|
||||||
|
local ref=$(git symbolic-ref --quiet HEAD 2>/dev/null)
|
||||||
|
|
||||||
|
if [[ -n "$ref" ]]; then
|
||||||
|
# On a branch
|
||||||
|
local branch=${ref##refs/heads/}
|
||||||
|
echo " ${arrow_color}»${reset} ${branch_name_color} ${branch}${reset}"
|
||||||
|
else
|
||||||
|
# Detached HEAD
|
||||||
|
local commit=$(git rev-parse --short HEAD 2>/dev/null)
|
||||||
|
echo " ${arrow_color}»${reset} ${detached_color}${commit}${reset}"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# 🚀 Prompt
|
||||||
|
PROMPT='$(quantum_dir_name)$(quantum_git_info) ${arrow_color}»${reset} '
|
||||||
Loading…
Add table
Add a link
Reference in a new issue