-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprompt.zsh
More file actions
44 lines (33 loc) · 1.5 KB
/
prompt.zsh
File metadata and controls
44 lines (33 loc) · 1.5 KB
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
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/env zsh
# Prompt - Terminal prompt configuration
# Skip if using Powerlevel10k (avoid conflicts)
if [[ "$ZSH_THEME" == "powerlevel10k/powerlevel10k" ]]; then
return 0
fi
# Enable prompt substitution
setopt PROMPT_SUBST
# Colors
autoload -U colors && colors
# Version control info
autoload -Uz vcs_info
precmd_vcs_info() { vcs_info }
precmd_functions+=( precmd_vcs_info )
zstyle ':vcs_info:*' enable git
zstyle ':vcs_info:*' check-for-changes false
zstyle ':vcs_info:*' unstagedstr ' *'
zstyle ':vcs_info:*' stagedstr ' +'
zstyle ':vcs_info:git:*' formats ' [%b%u%c]'
zstyle ':vcs_info:git:*' actionformats ' [%b|%a%u%c]'
# Simple elegant prompt with git info
PROMPT='%{$fg[cyan]%}%n@%m%{$reset_color%}:%{$fg[green]%}%~%{$reset_color%}%{$fg[yellow]%}${vcs_info_msg_0_}%{$reset_color%}
%(?:%{$fg[green]%}➜ :%{$fg[red]%}➜ )%{$reset_color%}'
# Right prompt with time
RPROMPT='%{$fg[gray]%}[%*]%{$reset_color%}'
# Alternative prompts (uncomment to use)
# Minimal prompt
# PROMPT='%{$fg[blue]%}%1~%{$reset_color%} %# '
# Two-line prompt with more info
# PROMPT='%{$fg[blue]%}┌─[%{$fg[cyan]%}%n%{$fg[blue]%}@%{$fg[cyan]%}%m%{$fg[blue]%}]─[%{$fg[green]%}%~%{$fg[blue]%}]%{$fg[yellow]%}${vcs_info_msg_0_}%{$reset_color%}
# %{$fg[blue]%}└─➜%{$reset_color%} '
# Powerline-style (requires powerline fonts)
# PROMPT='%{$fg[white]$bg[blue]%} %n@%m %{$fg[blue]$bg[green]%}%{$fg[black]$bg[green]%} %~ %{$fg[green]$bg[yellow]%}%{$fg[black]$bg[yellow]%}${vcs_info_msg_0_} %{$reset_color$fg[yellow]%}%{$reset_color%} '