Skip to content

Instantly share code, notes, and snippets.

@kgizdov
Last active March 27, 2019 21:39
Show Gist options
  • Save kgizdov/d3a28ce29047c69dc6e6 to your computer and use it in GitHub Desktop.
Save kgizdov/d3a28ce29047c69dc6e6 to your computer and use it in GitHub Desktop.
Variation on robbyrussell theme for ZSH
#!/bin/zsh
local user_host="%{$fg_bold[yellow]%}%n%{$reset_color%}%{$fg[green]%}@%{$reset_color%}%{$fg[blue]%}${HOST[(ws:.:)1]}%{$reset_color%}"
local ret_status="%(?:%{$fg_bold[green]%}❯ :%{$fg_bold[red]%}❯ )%{$reset_color%}"
local curr_dir="%{$fg_bold[cyan]%}%c%{$reset_color%}"
local work_dir="/afs/cern.ch/work/k/kgizdov"
dir_arrow () {
local dir_arrow
if [[ $(pwd) == $HOME ]]; then
dir_arrow="%{$fg_bold[green]%}⁕ %{$reset_color%}"
else
dir_arrow="%{$fg_bold[green]%}➜ %{$reset_color%}"
fi
echo $dir_arrow
}
curr_dir () {
local curr_dir
if [[ $(pwd) == ${work_dir} ]]; then
curr_dir="%{$fg_bold[cyan]%}work%{$reset_color%}"
else
curr_dir="%{$fg_bold[cyan]%}%c%{$reset_color%}"
fi
echo $curr_dir
}
PROMPT='${user_host} $(dir_arrow)$(curr_dir) $(git_prompt_info)${ret_status}'
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}git:(%{$fg[red]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment