Created
September 6, 2022 07:32
-
-
Save uysalserkan/0de657d25d05225af73bbe8d31b60733 to your computer and use it in GitHub Desktop.
Custom and basic zsh theme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# It's created by Serkan UYSAL; github:uysalserkan | |
# Set up git variables | |
autoload -Uz vcs_info | |
zstyle ':vcs_info:*' check-for-changes true | |
zstyle ':vcs_info:*' unstagedstr '%F{red}*' | |
zstyle ':vcs_info:*' stagedstr '%F{yellow}+' | |
zstyle ':vcs_info:*' actionformats '%F{5}[%F{2}%b%F{3}|%F{1}%a%c%u%F{5}]%f ' | |
zstyle ':vcs_info:*' formats '%F{5}[%F{2}%b%c%u%F{5}]%f ' | |
zstyle ':vcs_info:svn:*' branchformat '%b' | |
zstyle ':vcs_info:svn:*' actionformats '%F{5}[%F{2}%b%F{1}:%F{3}%i%F{3}|%F{1}%a%c%u%F{5}]%f ' | |
zstyle ':vcs_info:svn:*' formats '%F{5}[%F{2}%b%F{1}:%F{3}%i%c%u%F{5}]%f ' | |
zstyle ':vcs_info:*' enable git cvs svn | |
# Functions | |
theme_precmd () { | |
vcs_info | |
} | |
# Git variables | |
ZSH_THEME_GIT_PROMPT_PREFIX="Ξ %{$fg_bold[blue]%}git::%{$fg_no_bold[red]%}" | |
ZSH_THEME_GIT_PROMPT_SUFFIX="" | |
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg_bold[blue]%}" | |
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[yellow]%} ⚡ %{$fg_bold[blue]%}" | |
# Prompt variables | |
setopt prompt_subst | |
PROMPT='─ %B%{$FG[040]%}[%n]%{$reset_color%} Ʃ ' | |
PROMPT+='%{$FG[033]%}%B[%~/]%{$reset_color%} ' | |
PROMPT+='$(git_prompt_info)' | |
PROMPT+=' | |
%{$fg[cyan]%}➭%{$reset_color%} ' | |
# # current-time - status Ʃ Ξ | |
RPROMPT="%* %(?.%{$fg[cyan]%}✓.%{$fg[red]%}✗%{$reset_color%})" | |
autoload -U add-zsh-hook | |
add-zsh-hook precmd theme_precmd |
@ZeldrexK0DE hi,
If you want to use theme, you need to save it under ~/.oh-my-zsh/themes/
folder as uysal.zsh-theme.
Hi @miguealejandror,
These variables are built-in zsh variables, Actually I don't know what is the cause of the error but be sure the correct form of theme.
May be this link helps you https://stackoverflow.com/questions/1128496/to-get-a-prompt-which-indicates-git-branch-in-zsh
worked for me. Cool theme.
You're welcome guys :)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
but why do i get this error
[oh-my-zsh] theme 'uysal' not found