1
0
mirror of https://git.decapod.one/brethil/dotfiles synced 2024-11-21 11:01:31 +01:00

zsh: themes: fix prompt_too_long usage

This commit is contained in:
bretello 2024-05-09 12:37:39 +02:00
parent 120cd3f4d9
commit 1e90b5766c
Signed by: brethil
GPG Key ID: 876AAC6290170FE7

View File

@ -78,15 +78,17 @@ local success="%B%F{28} →%f%b"
local failure="%B%{$fg[red]%} x%b%{$reset_color%}" local failure="%B%{$fg[red]%} x%b%{$reset_color%}"
local prompt_with_previous_return_status="%(?:$success:$failure) " 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` function prompt_too_long(){
local prompt_too_long='%-$((COLUMNS/2))(l..'$'\n'')' # 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: ## oh-my-zsh vi-mode plugins indicators:
export MODE_INDICATOR="[%B%K{red}nav%k%b]" # red background export MODE_INDICATOR="[%B%K{red}nav%k%b]" # red background
export INSERT_MODE_INDICATOR="[%B%K{28}ins%k%b]" # green background export INSERT_MODE_INDICATOR="[%B%K{28}ins%k%b]" # green background
# put it all together # 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 # Right prompt is just return code and time
RPS1="${return_code_RPS1}"'$(vi_mode_prompt_info)[%*]' RPS1="${return_code_RPS1}"'$(vi_mode_prompt_info)[%*]'