forked from ohmyzsh/ohmyzsh
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ee79bc8
commit 1213dde
Showing
1 changed file
with
70 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,70 @@ | |||
# A custom theme just for me! | |||
# | |||
# Author: | |||
# Andrew Smith <fullsailor@me.com> | |||
# | |||
# Example: | |||
# |5:00:23| username at hostname in ~/path on branch | |||
|
|||
|
|||
function time_info { | |||
echo "%F{none}|%F{green}%*%F{none}|%f" | |||
} | |||
|
|||
function user_info { | |||
echo "%F{blue}%n%f" | |||
} | |||
|
|||
function host_info { | |||
echo "%F{yellow}%m%f" | |||
} | |||
|
|||
function path_info { | |||
echo "%F{cyan}$(nocorrect PWD)%f" | |||
} | |||
|
|||
# My home directory is a git repo of my dotfiles. I do not want my prompt to lie | |||
# and say that isn't | |||
function is_git_dir { | |||
[[ $(pwd) != $HOME ]] && [[ -d "./.git" ]] | |||
} | |||
function prompt_char { | |||
is_git_dir && echo '±' && return | |||
echo '○' | |||
} | |||
|
|||
function git_info { | |||
is_git_dir && echo $git_prompt_info | |||
} | |||
|
|||
function prompt_fullsailor_precmd () { | |||
setopt LOCAL_OPTIONS | |||
unsetopt XTRACE KSH_ARRAYS | |||
|
|||
if (( $+functions[git-info] )); then | |||
git-info | |||
fi | |||
print -rP $'$(time_info) $(user_info) at $(host_info) in $(path_info) $(git_info)' | |||
} | |||
|
|||
function prompt_fullsailor_setup() { | |||
setopt LOCAL_OPTIONS | |||
unsetopt XTRACE KSH_ARRAYS | |||
prompt_opts=(cr percent subst) | |||
|
|||
autoload -Uz add-zsh-hook | |||
add-zsh-hook precmd prompt_fullsailor_precmd | |||
|
|||
# For Vi mode | |||
zstyle ':omz:prompt' vicmd '%F{yellow}❮%f%B%F{red}❮%f%b%F{red}❮%f' | |||
|
|||
zstyle ':omz:plugin:git:prompt' prompt 'on %b%A%B%D' | |||
zstyle ':omz:plugin:git:prompt' branch '%F{magenta}%b%f' | |||
zstyle ':omz:plugin:git:prompt' ahead '%F{yellow}⬆%f' | |||
zstyle ':omz:plugin:git:prompt' behind '%F{yellow}⬇%f%' | |||
zstyle ':omz:plugin:git:prompt' dirty '%F{yellow}ϟ%f' | |||
|
|||
PROMPT='$(prompt_char) ' | |||
} | |||
|
|||
prompt_fullsailor_setup "$@" |