From f2276d528160662237365386507b8a5a99a5de96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mika=C3=ABl=20Capelle?= Date: Thu, 16 Mar 2017 14:58:15 +0100 Subject: [PATCH] Customize theme. --- .zshrc | 2 +- zsh-custom/themes/mybira.zsh-theme | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 zsh-custom/themes/mybira.zsh-theme diff --git a/.zshrc b/.zshrc index 31d3bfa..e934a73 100644 --- a/.zshrc +++ b/.zshrc @@ -8,7 +8,7 @@ export ZSH=$HOME/.oh-my-zsh # Set name of the theme to load. Optionally, if you set this to "random" # it'll load a random theme each time that oh-my-zsh is loaded. # See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes -ZSH_THEME="bira" +ZSH_THEME="mybira" # Uncomment the following line to use case-sensitive completion. # CASE_SENSITIVE="true" diff --git a/zsh-custom/themes/mybira.zsh-theme b/zsh-custom/themes/mybira.zsh-theme new file mode 100644 index 0000000..2b9f7bb --- /dev/null +++ b/zsh-custom/themes/mybira.zsh-theme @@ -0,0 +1,29 @@ +# ZSH Theme - Preview: http://gyazo.com/8becc8a7ed5ab54a0262a470555c3eed.png +local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" + + +if [[ $UID -eq 0 ]]; then + local user_host='%{$terminfo[bold]$fg[red]%}%n@%m%{$reset_color%}' + local user_symbol='#' +else + local user_host='%{$terminfo[bold]$fg[green]%}%n@%m%{$reset_color%}' + local user_symbol='$' +fi + +local current_dir='%{$terminfo[bold]$fg[blue]%} %~%{$reset_color%}' +local rvm_ruby='' +if which rvm-prompt &> /dev/null; then + rvm_ruby='%{$fg[red]%}‹$(rvm-prompt i v g)›%{$reset_color%}' +else + if which rbenv &> /dev/null; then + rvm_ruby='%{$fg[red]%}‹$(rbenv version | sed -e "s/ (set.*$//")›%{$reset_color%}' + fi +fi +local git_branch='$(git_prompt_info)%{$reset_color%}' + +PROMPT="╭─ ${user_host} ${current_dir} ${rvm_ruby} ${git_branch} +╰─%B${user_symbol}%b " +RPS1="%B${return_code}%b" + +ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}‹" +ZSH_THEME_GIT_PROMPT_SUFFIX="› %{$reset_color%}"