zsh prompt: username/host on left size

This commit is contained in:
Henrik Lissner 2015-12-09 01:33:30 -05:00
parent a88235e2b6
commit 2bb080e539

View file

@ -69,7 +69,7 @@ prompt_pure_precmd() {
# git info # git info
vcs_info vcs_info
local prompt_pure_preprompt="%F{blue}%~%F{242}$vcs_info_msg_0_`prompt_pure_git_dirty`$prompt_pure_username%f%F{yellow}`prompt_pure_cmd_exec_time`%f"'$(vi_mode_prompt_info)' local prompt_pure_preprompt="%F{blue}%~%F{242}$vcs_info_msg_0_`prompt_pure_git_dirty`%f%F{yellow}`prompt_pure_cmd_exec_time`%f"'$(vi_mode_prompt_info)'
# print -P $prompt_pure_preprompt # print -P $prompt_pure_preprompt
RPROMPT=$prompt_pure_preprompt RPROMPT=$prompt_pure_preprompt
@ -118,15 +118,15 @@ prompt_pure_setup() {
zstyle ':vcs_info:git*' actionformats ' %b|%a' zstyle ':vcs_info:git*' actionformats ' %b|%a'
# show username@host if logged in through SSH # show username@host if logged in through SSH
[[ "$SSH_CONNECTION" != '' ]] && prompt_pure_username=' %n@%m' [[ "$SSH_CONNECTION" != '' ]] && prompt_pure_username='%n@%m '
# show username@host if root, with username in white # show username@host if root, with username in white
[[ $UID -eq 0 ]] && prompt_pure_username=' %F{white}%n%F{242}@%m' [[ $UID -eq 0 ]] && prompt_pure_username='%F{white}%n%F{242}@%m '
# prompt turns red if the previous command didn't exit with 0 # prompt turns red if the previous command didn't exit with 0
N_MODE=" --NORMAL--" N_MODE=" --NORMAL--"
I_MODE="" I_MODE=""
PROMPT='%(?.%F{yellow}.%F{red}) %f' PROMPT='$prompt_pure_username%(?.%F{yellow}.%F{red}) %f'
} }
prompt_pure_setup "$@" prompt_pure_setup "$@"