mirror of
https://git.decapod.one/brethil/dotfiles
synced 2024-11-23 20:11:31 +01:00
zsh: themes: fix prompt_too_long usage
This commit is contained in:
parent
120cd3f4d9
commit
1e90b5766c
|
@ -78,15 +78,17 @@ local success="%B%F{28} →%f%b"
|
|||
local failure="%B%{$fg[red]%} x%b%{$reset_color%}"
|
||||
local prompt_with_previous_return_status="%(?:$success:$failure) "
|
||||
|
||||
# prints a newline if more than $COLUMNS/2 characters have been printed, see end of `man zshmisc`
|
||||
local prompt_too_long='%-$((COLUMNS/2))(l..'$'\n'')'
|
||||
function prompt_too_long(){
|
||||
# prints a newline if less than $COLUMNS/2 characters remain to the right margin, see end of `man zshmisc`
|
||||
echo "%-$((COLUMNS/2))(l..\n)"
|
||||
}
|
||||
|
||||
## oh-my-zsh vi-mode plugins indicators:
|
||||
export MODE_INDICATOR="[%B%K{red}nav%k%b]" # red background
|
||||
export INSERT_MODE_INDICATOR="[%B%K{28}ins%k%b]" # green background
|
||||
|
||||
# put it all together
|
||||
PROMPT='$(virtualenv_info)'"${user_prompt}${path_prompt}${git_prompt}${job_prompt}${shlvl_prompt}${prompt_too_long}${prompt_with_previous_return_status}"
|
||||
PROMPT='$(virtualenv_info)'"${user_prompt}${path_prompt}${git_prompt}${job_prompt}${shlvl_prompt}$(prompt_too_long)${prompt_with_previous_return_status}"
|
||||
|
||||
# Right prompt is just return code and time
|
||||
RPS1="${return_code_RPS1}"'$(vi_mode_prompt_info)[%*]'
|
||||
|
|
Loading…
Reference in New Issue
Block a user