mirror of
https://github.com/jimeh/dotfiles.git
synced 2026-02-19 13:46:41 +00:00
Use oh-my-zsh's custom directory feature to enable my personal theme
Instead of using a specific fork with my theme added. For the time being, I still need to use my own fork, as there was a couple of bugs with customizing the custom directory path. I've created a fix and waiting for the pull request to be merged: https://github.com/robbyrussell/oh-my-zsh/pull/1111
This commit is contained in:
23
shell/zsh/custom/plain.zsh-theme
Normal file
23
shell/zsh/custom/plain.zsh-theme
Normal file
@@ -0,0 +1,23 @@
|
||||
PROMPT='%n@%m %~$(check_git_prompt_info)$ %{$reset_color%}'
|
||||
|
||||
local return_code="%(?..%{$fg[cyan]%}%? ↵%{$reset_color%})"
|
||||
RPROMPT="${return_code}"
|
||||
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[cyan]%}("
|
||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
|
||||
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}*%{$fg[cyan]%})%{$reset_color%}"
|
||||
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[cyan]%})%{$fg[blue]%}"
|
||||
|
||||
|
||||
# Git sometimes goes into a detached head state. git_prompt_info doesn't
|
||||
# return anything in this case. So wrap it in another function and check
|
||||
# for an empty string. -- Brorrowed from Soliah.zsh-theme :)
|
||||
function check_git_prompt_info() {
|
||||
if git rev-parse --git-dir > /dev/null 2>&1; then
|
||||
if [[ -z $(git_prompt_info) ]]; then
|
||||
echo " %{$fg[cyan]%}(detached%{$fg[magenta]%}*%{$fg[cyan]%})%{$reset_color%}"
|
||||
else
|
||||
echo " $(git_prompt_info)"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
Submodule shell/zsh/oh-my-zsh updated: 45c6a3aba4...f9018c5efb
Reference in New Issue
Block a user