diff options
-rw-r--r-- | .zshrc | 16 |
1 files changed, 9 insertions, 7 deletions
@@ -1,7 +1,7 @@ ########################################################## # Prompt -setprompt () { +function () { setopt prompt_subst @@ -18,6 +18,7 @@ setprompt () { local nocolor="%{$terminfo[sgr0]%}" # Base prompt. + local pr_baseprompt pr_baseprompt="%(!.${red}%U%n%u.${green}%n)" # Username.. red underlining if uid 0 (root) pr_baseprompt+="${magenta}@${green}%m" # "@<host>" pr_baseprompt+="${yellow}:${green}%30<...<%~%<<%" # truncated path @@ -25,8 +26,8 @@ setprompt () { pr_baseprompt+="${yellow}>${nocolor} " # Finally, add a yellow "> " # Info for title bar/screen title - pr_titleinfo='%(!.[ROOT] | .)%l) %n@%m:%30<...<%~%<<' - pr_windowtitle='' + local pr_titleinfo='%(!.[ROOT] | .)%l) %n@%m:%30<...<%~%<<' + local pr_windowtitle='' pr_wt_in='' pr_wt_out='' case ${TERM} in @@ -62,7 +63,6 @@ setprompt () { } -setprompt ########################################################## # Misc @@ -108,9 +108,11 @@ LOGCHECK=120 # check every 2 min for login/logout activity autoload -U compinit compinit if [ -e ~/.ssh/known_hosts ]; then - # Use .ssh/known_hosts for hostnames. - hosts=(${${(f)"$(<~/.ssh/known_hosts)"//,/ }%%\ *}) - zstyle ':completion:*:hosts' hosts $hosts + # Use .ssh/known_hosts for hostnames. + function () { + local hosts=(${${(f)"$(<~/.ssh/known_hosts)"//,/ }%%\ *}) + zstyle ':completion:*:hosts' hosts $hosts + } fi ########################################################## |