diff --git a/fish/theme-t31m/fish_prompt.fish b/fish/theme-t31m/fish_prompt.fish index 39cc1dd..2c6113d 100644 --- a/fish/theme-t31m/fish_prompt.fish +++ b/fish/theme-t31m/fish_prompt.fish @@ -53,12 +53,12 @@ function fish_prompt end set t31m_custom (t31m_prompt) + set t31m_custom_right (t31m_prompt_right) # check if latest cmd resulted in exit code 0 (ok) if test "$code" = 0 - echo -n -s "$t31m_custom"(red)"$symbol"(off) + echo -e -n -s "$t31m_custom""$t31m_custom_right"(red)"\n$symbol"(off) else - echo -n -s "$t31m_custom"(dim)"$symbol"(off) + echo -e -n -s "$t31m_custom""$t31m_custom_right"(dim)"\n$symbol"(off) end - end diff --git a/fish/theme-t31m/fish_right_prompt.fish b/fish/theme-t31m/fish_right_prompt.fish index e7fd410..dcbde51 100644 --- a/fish/theme-t31m/fish_right_prompt.fish +++ b/fish/theme-t31m/fish_right_prompt.fish @@ -100,7 +100,7 @@ function fish_right_prompt end end - printf (yellow)"("(off)$cwd(yellow)") "(off) - printf (off)(date +%H(yellow):(off)%M(yellow):(off)%S)(off) + #printf (yellow)"("(off)$cwd(yellow)") "(off) + #printf (off)(date +%H(yellow):(off)%M(yellow):(off)%S)(off)"\n" end diff --git a/fish/theme-t31m/t31m_prompt_right.fish b/fish/theme-t31m/t31m_prompt_right.fish new file mode 100644 index 0000000..74decbe --- /dev/null +++ b/fish/theme-t31m/t31m_prompt_right.fish @@ -0,0 +1,18 @@ +function t31m_prompt_right + + if test "$theme_complete_path" = "yes" + set cwd (prompt_pwd) + else + set cwd (basename (prompt_pwd)) + + if git::is_repo + set root_folder (command git rev-parse --show-toplevel ^/dev/null) + set parent_root_folder (dirname $root_folder) + set cwd (echo $PWD | sed -e "s|$parent_root_folder/||") + end + end + + printf (yellow)"("(off)$cwd(yellow)") "(off) + printf (off)(date +%H(yellow):(off)%M(yellow):(off)%S)(off)"\n" + +end