Skip to content

Instantly share code, notes, and snippets.

@SteelPangolin
Created October 20, 2015 21:58
Show Gist options
  • Save SteelPangolin/187c7148b90e04f0855f to your computer and use it in GitHub Desktop.
Save SteelPangolin/187c7148b90e04f0855f to your computer and use it in GitHub Desktop.
Tweak robbyrussell ZSH theme to prepend hostname
local hostname="%{$fg_bold[black]%}%m"
local ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ %s)"
PROMPT='${hostname} ${ret_status}%{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}'
ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$fg[red]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})"
@MANTENN
Copy link

MANTENN commented Mar 5, 2024

I ended up adding:

local hostname="%{$fg_bold[white]%}%m"

PROMPT="${hostname} ${PROMPT}"

to the end of my .zshrc file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment