-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnekonight.zsh-theme
34 lines (29 loc) · 1.19 KB
/
nekonight.zsh-theme
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#! zsh
# nekonight Zsh prompt with source control management and
# Author: Bruno Ciccarino <[email protected]>
#
# Demo:
# ╭─🐱 virtualenv 🐱user at 🐱host in 🐱directory on (🐱branch {1} ↑1 ↓1 +1 •1 ⌀1 ✗)
# ╰λ cd ~/path/to/your-directory
icon_start="╭─"
icon_user=" 🐱 %B%F{yellow}%n%f%b"
icon_host=" at 🐱 %B%F{cyan}%m%f%b"
icon_directory=" in 🐱 %B%F{magenta}%~%f%b"
icon_end="╰─%Bλ%b"
function git_prompt_info() {
local branch_name=$(git symbolic-ref --short HEAD 2>/dev/null)
if [[ -n $branch_name ]]; then
local git_status="$branch_name $(scm_git_status)"
echo -n " on (🐱 $git_status)"
fi
}
function scm_git_status() {
local git_status=""
[[ -n $(git rev-list --count --left-right @{upstream}...HEAD 2>/dev/null) ]] && git_status+="%F{brown}↓%f "
[[ -n $(git diff --cached --name-status 2>/dev/null) ]] && git_status+="%B%F{green}+%f%b"
[[ -n $(git diff --name-status 2>/dev/null) ]] && git_status+="%B%F{yellow}•%f%b"
[[ -n $(git ls-files --others --exclude-standard 2>/dev/null) ]] && git_status+="⌀"
echo -n "$git_status"
}
PROMPT='${icon_start}${icon_user}${icon_host}${icon_directory}$(git_prompt_info)
${icon_end}'