2022-01-15 15:46:11 +09:00
|
|
|
# -*- mode: bash -*-
|
2017-10-10 18:07:01 +07:00
|
|
|
# ------------------------------------------------------------------#
|
|
|
|
# FILE: mbriggs.zsh-theme #
|
|
|
|
# BY: Matt Briggs (matt@mattbriggs.net) #
|
|
|
|
# BASED ON: smt by Stephen Tudor (stephen@tudorstudio.com) #
|
|
|
|
# ------------------------------------------------------------------#
|
|
|
|
|
|
|
|
SCM_THEME_PROMPT_DIRTY="${red}⚡${reset_color}"
|
|
|
|
SCM_THEME_PROMPT_AHEAD="${red}!${reset_color}"
|
|
|
|
SCM_THEME_PROMPT_CLEAN="${green}✓${reset_color}"
|
|
|
|
SCM_THEME_PROMPT_PREFIX=" "
|
|
|
|
SCM_THEME_PROMPT_SUFFIX=""
|
|
|
|
GIT_SHA_PREFIX=" ${yellow}"
|
|
|
|
GIT_SHA_SUFFIX="${reset_color}"
|
|
|
|
|
|
|
|
function git_short_sha() {
|
|
|
|
SHA=$(git rev-parse --short HEAD 2> /dev/null) && echo "$GIT_SHA_PREFIX$SHA$GIT_SHA_SUFFIX"
|
|
|
|
}
|
|
|
|
|
|
|
|
function prompt() {
|
|
|
|
local return_status=""
|
2021-12-28 07:34:53 +09:00
|
|
|
local ruby="${red}$(_omb_prompt_print_ruby_env)${reset_color}"
|
2017-10-10 18:07:01 +07:00
|
|
|
local user_host="${green}\h${reset_color}"
|
|
|
|
local current_path="\w"
|
|
|
|
local n_commands="\!"
|
|
|
|
local git_branch="$(git_short_sha)$(scm_prompt_info)"
|
|
|
|
local prompt_symbol='λ'
|
|
|
|
local open='('
|
|
|
|
local close=')'
|
|
|
|
local prompt_char=' \$ '
|
|
|
|
|
|
|
|
PS1="\n${n_commands} ${user_host} ${prompt_symbol} ${ruby} ${open}${current_path}${git_branch}${close}${return_status}\n${prompt_char}"
|
|
|
|
}
|
|
|
|
|
2021-12-28 09:19:44 +09:00
|
|
|
_omb_util_add_prompt_command prompt
|