|
3 | 3 |
|
4 | 4 | local return_code="%(?..%{$fg_bold[red]%}%? ↵%{$reset_color%})" |
5 | 5 |
|
6 | | -function get_git_branch { |
7 | | - echo $(git rev-parse --abbrev-ref HEAD 2> /dev/null); |
8 | | - # echo $(git symbolic-ref HEAD 2>/dev/null | awk -F/ {'print $NF'}) |
9 | | -} |
10 | | - |
11 | | -function get_git_remote { |
12 | | - # echo $(git remote) |
13 | | - echo $(git config --get branch.$branch.remote) |
| 6 | +my_host() { |
| 7 | + if [[ -n "$SSH_CLIENT" ]]; then |
| 8 | + print -n "@%m" |
| 9 | + fi |
14 | 10 | } |
15 | 11 |
|
16 | | - |
| 12 | +# Unused – |
17 | 13 | function my_git_prompt_info() { |
18 | 14 | ref=$(git symbolic-ref HEAD 2> /dev/null) || return |
19 | 15 | GIT_STATUS=$(git_prompt_status) |
20 | 16 | [[ -n $GIT_STATUS ]] && GIT_STATUS=" $GIT_STATUS" |
21 | 17 | echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/} $ZSH_THEME_GIT_PROMPT_SUFFIX" |
22 | 18 | } |
23 | 19 |
|
24 | | -my_host() { |
25 | | - if [[ -n "$SSH_CLIENT" ]]; then |
26 | | - print -n "@%m" |
27 | | - fi |
28 | | -} |
| 20 | +ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[yellow]%} " |
| 21 | +ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} " |
29 | 22 |
|
30 | | - |
31 | | -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}(" |
32 | | -ZSH_THEME_GIT_PROMPT_SUFFIX=") %{$reset_color%}" |
33 | | -ZSH_THEME_GIT_PROMPT_UNTRACKED=":" |
34 | | -ZSH_THEME_GIT_PROMPT_ADDED="+" |
35 | | -ZSH_THEME_GIT_PROMPT_MODIFIED="*" |
36 | | -ZSH_THEME_GIT_PROMPT_RENAMED="~" |
37 | | -ZSH_THEME_GIT_PROMPT_DELETED="!" |
38 | | -ZSH_THEME_GIT_PROMPT_UNMERGED="?" |
39 | | - |
40 | | -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[yellow]% " |
41 | | -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" |
42 | | -# ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}%{$reset_color%} %{$fg[yellow]%}%1{✗%}" |
43 | | -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}%{$reset_color%} %{$fg_bold[red]%}%1{✗%}" |
| 23 | +ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg_bold[red]%}✗" |
44 | 24 | ZSH_THEME_GIT_PROMPT_CLEAN="%{$reset_color%} 🌼" |
45 | 25 |
|
46 | | -PROMPT='%{$fg[white]%}%n$(my_host)%{$reset_color%} %{$fg_bold[blue]%}%4~%{$reset_color%} $(git_prompt_info)%{$reset_color%} |
| 26 | +ZSH_THEME_GIT_PROMPT_ADDED="%{$fg_bold[red]%}✚%{$reset_color%}" |
| 27 | +ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg_bold[red]%}✹%{$reset_color%}" |
| 28 | +ZSH_THEME_GIT_PROMPT_DELETED="%{$fg_bold[red]%}✖%{$reset_color%}" |
| 29 | +ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg_bold[red]%}➜%{$reset_color%}" |
| 30 | +ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg_bold[red]%}═%{$reset_color%}" |
| 31 | +ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg_bold[red]%}✭%{$reset_color%}" |
| 32 | + |
| 33 | +PROMPT='%{$fg[white]%}%n$(my_host)%{$reset_color%} %{$fg_bold[blue]%}%4~%{$reset_color%} $(git_prompt_info)$(git_prompt_status)%{$reset_color%} |
47 | 34 | $ ' |
48 | 35 | RPS1="${return_code}" |
0 commit comments