mirror of
https://github.com/dcarrillo/prezto.git
synced 2025-06-14 08:41:43 +00:00
Converted OMZ themes to native ZSH themes.
This commit is contained in:
@ -1,15 +0,0 @@
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[white]%}["
|
||||
ZSH_THEME_GIT_PROMPT_SUFFIX="]%{$reset_color%}"
|
||||
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}●%{$reset_color%}"
|
||||
ZSH_THEME_GIT_PROMPT_CLEAN=""
|
||||
|
||||
#Customized git status, oh-my-zsh currently does not allow render dirty status before branch
|
||||
git_custom_status() {
|
||||
local cb=$(current_branch)
|
||||
if [ -n "$cb" ]; then
|
||||
echo "- $ZSH_THEME_GIT_PROMPT_PREFIX$(current_branch)$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_SUFFIX"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
PROMPT='%2~ $(git_custom_status) »%b '
|
35
themes/minimal/prompt_minimal_setup
Normal file
35
themes/minimal/prompt_minimal_setup
Normal file
@ -0,0 +1,35 @@
|
||||
function +vi-git-status() {
|
||||
# Untracked files.
|
||||
if [[ -n $(git ls-files --other --exclude-standard 2> /dev/null) ]]; then
|
||||
hook_com[unstaged]='%F{red}●%f'
|
||||
fi
|
||||
}
|
||||
|
||||
function prompt_minimal_precmd () {
|
||||
setopt noxtrace noksharrays localoptions
|
||||
vcs_info
|
||||
}
|
||||
|
||||
function prompt_minimal_setup() {
|
||||
setopt noxtrace noksharrays localoptions
|
||||
prompt_opts=(cr subst percent)
|
||||
|
||||
autoload -Uz add-zsh-hook
|
||||
autoload -Uz vcs_info
|
||||
|
||||
add-zsh-hook precmd prompt_minimal_precmd
|
||||
|
||||
zstyle ':vcs_info:*' enable bzr git hg svn
|
||||
zstyle ':vcs_info:*' check-for-changes true
|
||||
zstyle ':vcs_info:*' stagedstr '%F{green}●%f'
|
||||
zstyle ':vcs_info:*' unstagedstr '%F{yellow}●%f'
|
||||
zstyle ':vcs_info:*' formats ' - [%b%c%u]'
|
||||
zstyle ':vcs_info:*' actionformats " - [%b%c%u|%F{cyan}%a%f]"
|
||||
zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b|%F{cyan}%r%f'
|
||||
zstyle ':vcs_info:git*+set-message:*' hooks git-status
|
||||
|
||||
PROMPT='%2~${vcs_info_msg_0_} » '
|
||||
}
|
||||
|
||||
prompt_minimal_setup "$@"
|
||||
|
Reference in New Issue
Block a user