Add `naaative` theme

Naaative is based on `steeef` with a few minor changes:
* Adapted to look best with the 'Oceanic Next Dark' theme, but will look nice with almost any theme
* Use the Terminal theme colors instead of absolute (256) colors
* Displays the same Git indicators as a lot of custom prompts do (! for untracked changes, + for uncommitted changes, ? for untracked files)
* Adds a stash indicator ($)

Cheers :)
This commit is contained in:
Jorrit Visser 2017-06-11 22:09:23 +02:00
parent fcf060482b
commit ad532e3235
No known key found for this signature in database
GPG Key ID: 53E37A7EA1CB82A7
2 changed files with 59 additions and 0 deletions

View File

@ -0,0 +1 @@

View File

@ -0,0 +1,58 @@
# Prompt style and colors based on the `steeef` default theme:
# Adapted to `Oceanic Next Dark` colors
# Requires the `git-info` zmodule to be included in the .zimrc file.
prompt_naaative_git() {
[[ -n ${git_info} ]] && print -n " ${(e)git_info[prompt]}"
prompt_naaative_virtualenv() {
[[ -n ${VIRTUAL_ENV} ]] && print -n " (%F{blue}${VIRTUAL_ENV:t}%f)"
prompt_naaative_precmd() {
(( ${+functions[git-info]} )) && git-info
prompt_naaative_setup() {
local naaativepink
local naaativeorange
local naaativegreen
local naaativeaqua
local naaativered
local naaativeyellow
autoload -Uz add-zsh-hook
autoload -Uz colors && colors
prompt_opts=(cr percent subst)
add-zsh-hook precmd prompt_naaative_precmd
zstyle ':zim:git-info' verbose 'yes'
zstyle ':zim:git-info:branch' format '%b'
zstyle ':zim:git-info:commit' format '%c'
zstyle ':zim:git-info:action' format "(${naaativegreen}%s%f)"
zstyle ':zim:git-info:unindexed' format "${naaativepink}!"
zstyle ':zim:git-info:indexed' format "${naaativegreen}+"
zstyle ':zim:git-info:untracked' format "${naaativered}?"
zstyle ':zim:git-info:stashed' format "${naaativeorange}$"
zstyle ':zim:git-info:keys' format \
'prompt' "(${naaativeaqua}%b%c%I%i%u%S%f)%s"
${naaativepink}%n%f at ${naaativeorange}%m%f in ${naaativegreen}%~%f\$(prompt_naaative_git)\$(prompt_naaative_virtualenv)
%(!.#.$) "
prompt_naaative_setup "${@}"