themes/{mairan,zork}: Define variable in the place where it is used

This commit is contained in:
Koichi Murase
2024-04-01 22:54:19 +09:00
parent 50f629ccda
commit 4cb952b648
2 changed files with 2 additions and 8 deletions
+1 -4
View File
@@ -89,6 +89,7 @@ function chroot {
# show virtualenvwrapper
function my_ve {
if [[ $VIRTUAL_ENV ]]; then
local ve=$(basename "$VIRTUAL_ENV")
local my_ps_ve=$_omb_prompt_bold_purple$ve$_omb_prompt_normal
echo "($my_ps_ve)"
fi
@@ -103,10 +104,6 @@ function _omb_theme_PROMPT_COMMAND {
local my_ps_user="$BOLD$GREEN\u${_omb_prompt_normal}"
local my_ps_root="${_omb_prompt_bold_brown}\u${_omb_prompt_normal}"
if [[ $VIRTUAL_ENV ]]; then
local ve=$(basename "$VIRTUAL_ENV")
fi
# nice prompt
case $(id -u) in
0) PS1="\n${TITLEBAR}${BRACKET_COLOR}┌─${_omb_prompt_normal}$(my_ve)$(chroot)[$my_ps_root][$my_ps_host_root]$(modern_scm_prompt)$(__my_rvm_ruby_version)[${_omb_prompt_green}\w${_omb_prompt_normal}]$(is_vim_shell)${BRACKET_COLOR}
+1 -4
View File
@@ -56,6 +56,7 @@ function chroot {
# show virtualenvwrapper
function my_ve {
if [[ $VIRTUAL_ENV ]]; then
local ve=$(basename "$VIRTUAL_ENV")
local my_ps_ve=$_omb_prompt_bold_purple$ve$_omb_prompt_normal
echo "($my_ps_ve)"
fi
@@ -70,10 +71,6 @@ function _omb_theme_PROMPT_COMMAND {
local my_ps_user="${_omb_prompt_bold_green}\u${_omb_prompt_normal}"
local my_ps_root="${_omb_prompt_bold_brown}\u${_omb_prompt_normal}"
if [[ $VIRTUAL_ENV ]]; then
local ve=$(basename "$VIRTUAL_ENV")
fi
# nice prompt
case $(id -u) in
0) PS1="${TITLEBAR}┌─$(my_ve)$(chroot)[$my_ps_root][$my_ps_host_root]$(modern_scm_prompt)$(__my_rvm_ruby_version)[${_omb_prompt_teal}\w${_omb_prompt_normal}]$(is_vim_shell)