~cdv/pure-prompt

27e646168af0442f3b03bda0f2b01d1a0a73404a — Chris Vittal 5 months ago ac72ba4
Fork config, bold things, reorder things
1 files changed, 7 insertions(+), 5 deletions(-)

M pure.zsh
M pure.zsh => pure.zsh +7 -5
@@ 128,21 128,22 @@ prompt_pure_preprompt_render() {
	# Initialize the preprompt array.
	local -a preprompt_parts

	# Username and machine, if applicable.
	[[ -n $prompt_pure_state[username] ]] && preprompt_parts+=('%B'$prompt_pure_state[username]'%b')

	# Set the path.
	preprompt_parts+=('%F{${prompt_pure_colors[path]}}%~%f')
	preprompt_parts+=('%B%F{${prompt_pure_colors[path]}}%~%f%b')

	# Add Git branch and dirty status info.
	typeset -gA prompt_pure_vcs_info
	if [[ -n $prompt_pure_vcs_info[branch] ]]; then
		preprompt_parts+=("%F{$git_color}"'${prompt_pure_vcs_info[branch]}${prompt_pure_git_dirty}%f')
		preprompt_parts+=("%B%F{$git_color}"'${prompt_pure_vcs_info[branch]}${prompt_pure_git_dirty}%f%b')
	fi
	# Git pull/push arrows.
	if [[ -n $prompt_pure_git_arrows ]]; then
		preprompt_parts+=('%F{$prompt_pure_colors[git:arrow]}${prompt_pure_git_arrows}%f')
	fi

	# Username and machine, if applicable.
	[[ -n $prompt_pure_state[username] ]] && preprompt_parts+=($prompt_pure_state[username])
	# Execution time.
	[[ -n $prompt_pure_cmd_exec_time ]] && preprompt_parts+=('%F{$prompt_pure_colors[execution_time]}${prompt_pure_cmd_exec_time}%f')



@@ 578,7 579,7 @@ prompt_pure_state_setup() {
		unset MATCH MBEGIN MEND
	fi

	hostname='%F{$prompt_pure_colors[host]}@%m%f'
	hostname='%F{$prompt_pure_colors[at]}@%f%F{$prompt_pure_colors[host]}%m%f'
	# Show `username@host` if logged in through SSH.
	[[ -n $ssh_connection ]] && username='%F{$prompt_pure_colors[user]}%n%f'"$hostname"



@@ 673,6 674,7 @@ prompt_pure_setup() {
		git:branch           242
		git:branch:cached    red
		host                 242
		at                   242
		path                 blue
		prompt:error         red
		prompt:success       magenta