-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #253 from loopj/master
Added function git_remote_status to lib/git.zsh which extracts if the local branch is ahead/behind/diverged from remote
- Loading branch information
Showing
2 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# ZSH theme by James Smith (http://loopj.com) | ||
# A multiline prompt with username, hostname, full path, return status, git branch, git dirty status, git remote status | ||
|
||
local return_status="%{$fg[red]%}%(?..⏎)%{$reset_color%}" | ||
|
||
local host_color="green" | ||
if [ -n "$SSH_CLIENT" ]; then | ||
local host_color="red" | ||
fi | ||
|
||
PROMPT=' | ||
%{$fg_bold[grey]%}[%{$reset_color%}%{$fg_bold[${host_color}]%}%n@%m%{$reset_color%}%{$fg_bold[grey]%}]%{$reset_color%} %{$fg_bold[blue]%}%10c%{$reset_color%} $(git_prompt_info) $(git_remote_status) | ||
%{$fg_bold[cyan]%}❯%{$reset_color%} ' | ||
|
||
|
||
RPROMPT='${return_status}%{$reset_color%}' | ||
|
||
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[grey]%}(%{$fg[red]%}" | ||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" | ||
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[grey]%}) %{$fg[yellow]%}⚡%{$reset_color%}" | ||
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[grey]%})" | ||
ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE="%{$fg_bold[magenta]%}↓%{$reset_color%}" | ||
ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE="%{$fg_bold[magenta]%}↑%{$reset_color%}" | ||
ZSH_THEME_GIT_PROMPT_DIVERGED_REMOTE="%{$fg_bold[magenta]%}↕%{$reset_color%}" |