Skip to content

Instantly share code, notes, and snippets.

@0xKira
Last active April 25, 2019 17:06
Show Gist options
  • Save 0xKira/c6e0fa7922f3bb60cad95c543a8436db to your computer and use it in GitHub Desktop.
Save 0xKira/c6e0fa7922f3bb60cad95c543a8436db to your computer and use it in GitHub Desktop.
A DIY Theme for Oh My ZSH

kira-zsh-theme

A DIY Theme for Oh My ZSH

Screenshots

See below

Installation

You can simply copy the code in kira.zsh-theme and save locally.

Theme

  1. Copy kira.zsh-theme file into the ~/.oh-my-zsh/custom/themes/ directory.
  2. Change the theme variable name to ZSH_THEME="kira" in ~/.zshrc.
  3. Reload ZSH with source ~/.zshrc

features

Including file path, git status, git hash, time and return status.

# Directory info.
local current_dir='${PWD/#$HOME/~}'
# ret status
# local ret_status="(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ )"
local ret_status="(?:🤔 :😱 )"
# VCS
YS_VCS_PROMPT_PREFIX="%{$fg_bold[white]%}[%{$reset_color%}%{$fg_bold[cyan]%}"
YS_VCS_PROMPT_SUFFIX="%{$reset_color%} "
YS_VCS_PROMPT_DIRTY=" %{$fg[red]%}✗"
YS_VCS_PROMPT_CLEAN=" %{$fg[green]%}●"
# Git short sha
local git_sha='$(git_prompt_short_sha)'
ZSH_THEME_GIT_PROMPT_SHA_BEFORE="%{$fg_bold[red]%}("
ZSH_THEME_GIT_PROMPT_SHA_AFTER=")%{$reset_color%}%{$fg_bold[white]%}]%{$reset_color%} "
# Git info.
local git_info='$(git_prompt_info)'
ZSH_THEME_GIT_PROMPT_PREFIX="$YS_VCS_PROMPT_PREFIX"
ZSH_THEME_GIT_PROMPT_SUFFIX="$YS_VCS_PROMPT_SUFFIX"
ZSH_THEME_GIT_PROMPT_DIRTY="$YS_VCS_PROMPT_DIRTY"
ZSH_THEME_GIT_PROMPT_CLEAN="$YS_VCS_PROMPT_CLEAN"
# Prompt format: \n # DIRECTORY [GIT_BRANCH STATE GIT_SHA] [DATE - TIME] \n [emoj]
PROMPT="%{$fg_bold[magenta]%}${current_dir}%{$reset_color%} \
${git_info}\
${git_sha}\
%{$FG[239]%}%D - %*
%${ret_status}%{$reset_color%}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment