Last active
March 18, 2017 06:18
-
-
Save sitedyno/52aa3071e6c57384ad4de308bc47b36d to your computer and use it in GitHub Desktop.
Remove hg_prompt_info, doesn't work for me.
This file contains hidden or 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
# user, host, full path, and time/date | |
# on two lines for easier vgrepping | |
# entry in a nice long thread on the Arch Linux forums: http://bbs.archlinux.org/viewtopic.php?pid=521888#p521888 | |
function hg_prompt_info { | |
hg prompt --angle-brackets "\ | |
<hg:%{$fg[magenta]%}<branch>%{$reset_color%}><:%{$fg[magenta]%}<bookmark>%{$reset_color%}>\ | |
</%{$fg[yellow]%}<tags|%{$reset_color%}, %{$fg[yellow]%}>%{$reset_color%}>\ | |
%{$fg[red]%}<status|modified|unknown><update>%{$reset_color%}< | |
patches: <patches|join( → )|pre_applied(%{$fg[yellow]%})|post_applied(%{$reset_color%})|pre_unapplied(%{$fg_bold[black]%})|post_unapplied(%{$reset_color%})>>" 2>/dev/null | |
} | |
ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[cyan]%}%B+ " | |
ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[yellow]%}%B✱ " | |
ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%}%B✗ " | |
ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[blue]%}%B➦ " | |
ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[magenta]%}%B✂ " | |
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[blue]%}%B✈ " | |
ZSH_THEME_GIT_PROMPT_SHA_BEFORE=" %F{012}" | |
ZSH_THEME_GIT_PROMPT_SHA_AFTER="%{$reset_color%}" | |
ZSH_THEME_GIT_PROMPT_PREFIX="%F{002}git:%{$reset_color%}(%F{012}" | |
function mygit() { | |
if [[ "$(git config --get oh-my-zsh.hide-status)" != "1" ]]; then | |
ref=$(command git symbolic-ref HEAD 2> /dev/null) || \ | |
ref=$(command git rev-parse --short HEAD 2> /dev/null) || return | |
echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(git_prompt_short_sha) $(git_prompt_status)%{$reset_color%}%b$ZSH_THEME_GIT_PROMPT_SUFFIX" | |
fi | |
} | |
function retcode() {} | |
brktClr="%F{039}" | |
# alternate prompt with git & hg | |
PROMPT=$'$brktClr┌─[%{\e[0m%}%{\e[0;32m%}%n%F{226}@%{\e[0m%}%{\e[0;36m%}%m$brktClr] - [%{\e[0;37m%}%~$brktClr] - [%F{226}'%D{"%Y-%m-%d %I:%M:%S"}$'$brktClr]%{\e[0m%} | |
$brktClr└─[%{\e[0;35m%}%?$(retcode)$brktClr] <$(mygit)$brktClr>%{\e[0m%} ' | |
PS2=$' \e[0;34m%}>%{\e[0m%} ' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment