1
0
Fork 0

Add new Zsh syntax theme and switch to it

This commit is contained in:
tastytea 2022-04-27 22:36:23 +02:00
parent 4e7c0f4d96
commit a4b11b0f79
Signed by: tastytea
SSH Key Fingerprint: SHA256:FBkvrOlhq5use1XEttyUGT4bUTDVA1ar9SgIc9P03cM
2 changed files with 96 additions and 1 deletions

View File

@ -155,7 +155,7 @@ esac
[[ -f "${ZDOTDIR}"/keys.zsh ]] && source "${ZDOTDIR}"/keys.zsh
[[ -f "${ZDOTDIR}"/aliases.zsh ]] && source "${ZDOTDIR}"/aliases.zsh
[[ -d "${ZDOTDIR}"/functions ]] && autoload -Uz "${ZDOTDIR}"/functions/*
[[ -f "${ZDOTDIR}"/themes/syntax-unikitty-reversible.zsh ]] && source "${ZDOTDIR}"/themes/syntax-unikitty-reversible.zsh
[[ -f "${ZDOTDIR}"/themes/syntax-tastytea.zsh ]] && source "${ZDOTDIR}"/themes/syntax-tastytea.zsh
zstyle ':vcs_info:*' enable git svn hg # vcs_info_printsys
zstyle ':vcs_info:*' check-for-changes true

View File

@ -0,0 +1,95 @@
# zsh-syntax-highlighting theme, 256 colours.
function()
{
local -A _ttc # tastytea theme colour
_ttc[builtins]="99"
_ttc[commands]="99"
_ttc[keywords]="171"
_ttc[options]="69"
_ttc[variables]="166"
_ttc[strings]="36"
_ttc[misc]="39"
_ttc[math]="214"
_ttc[dark]="244"
_ttc[light]="255"
_ttc[error]="201"
# <https://github.com/zsh-users/zsh-syntax-highlighting/tree/master/highlighters/main>
unset ZSH_HIGHLIGHT_STYLES
typeset -gA ZSH_HIGHLIGHT_STYLES
# Builtins
ZSH_HIGHLIGHT_STYLES[reserved-word]="fg=${_ttc[keywords]}"
ZSH_HIGHLIGHT_STYLES[builtin]="fg=${_ttc[builtins]}"
ZSH_HIGHLIGHT_STYLES[function]="fg=${_ttc[builtins]}"
# ZSH_HIGHLIGHT_STYLES[hashed-command]="fg=green,standout" # ???
ZSH_HIGHLIGHT_STYLES[alias]="fg=${_ttc[builtins]}"
ZSH_HIGHLIGHT_STYLES[suffix-alias]="fg=${_ttc[builtins]}"
ZSH_HIGHLIGHT_STYLES[global-alias]="fg=${_ttc[builtins]}"
ZSH_HIGHLIGHT_STYLES[autodirectory]="fg=${_ttc[builtins]}"
# Commands
ZSH_HIGHLIGHT_STYLES[command]="fg=${_ttc[commands]}"
ZSH_HIGHLIGHT_STYLES[precommand]="fg=${_ttc[builtins]},underline"
ZSH_HIGHLIGHT_STYLES[arg0]="fg=${_ttc[commands]}"
ZSH_HIGHLIGHT_STYLES[process-substitution]="fg=${_ttc[commands]}"
ZSH_HIGHLIGHT_STYLES[command-substitution]="fg=${_ttc[commands]}"
ZSH_HIGHLIGHT_STYLES[command-substitution-quoted]="fg=${_ttc[commands]}"
ZSH_HIGHLIGHT_STYLES[command-substitution-unquoted]="fg=${_ttc[commands]}"
ZSH_HIGHLIGHT_STYLES[single-hyphen-option]="fg=${_ttc[options]}"
ZSH_HIGHLIGHT_STYLES[double-hyphen-option]="fg=${_ttc[options]}"
ZSH_HIGHLIGHT_STYLES[back-quoted-argument]="fg=${_ttc[misc]}"
ZSH_HIGHLIGHT_STYLES[back-quoted-argument-unclosed]="fg=${_ttc[misc]},bold"
# Punctuation
ZSH_HIGHLIGHT_STYLES[commandseparator]="none"
ZSH_HIGHLIGHT_STYLES[command-substitution-delimiter]="fg=${_ttc[commands]}"
ZSH_HIGHLIGHT_STYLES[command-substitution-delimiter-quoted]="fg=${_ttc[commands]}"
ZSH_HIGHLIGHT_STYLES[command-substitution-delimiter-unquoted]="fg=${_ttc[commands]}"
ZSH_HIGHLIGHT_STYLES[process-substitution-delimiter]="fg=${_ttc[commands]}"
ZSH_HIGHLIGHT_STYLES[back-quoted-argument-delimiter]="fg=${_ttc[misc]}"
# Text, quotes
ZSH_HIGHLIGHT_STYLES[single-quoted-argument]="fg=${_ttc[strings]}"
ZSH_HIGHLIGHT_STYLES[single-quoted-argument-unclosed]="fg=${_ttc[strings]},bold"
ZSH_HIGHLIGHT_STYLES[double-quoted-argument]="fg=${_ttc[strings]}"
ZSH_HIGHLIGHT_STYLES[double-quoted-argument-unclosed]="fg=${_ttc[strings]},bold"
ZSH_HIGHLIGHT_STYLES[rc-quote]="fg=${_ttc[strings]}"
ZSH_HIGHLIGHT_STYLES[dollar-quoted-argument]="fg=${_ttc[variables]}"
ZSH_HIGHLIGHT_STYLES[dollar-quoted-argument-unclosed]="fg=${_ttc[variables]},bold"
ZSH_HIGHLIGHT_STYLES[dollar-double-quoted-argument]="fg=${_ttc[variables]}"
ZSH_HIGHLIGHT_STYLES[back-double-quoted-argument]="fg=${_ttc[misc]}"
ZSH_HIGHLIGHT_STYLES[back-dollar-quoted-argument]="fg=${_ttc[strings]}"
# Variables, constants
ZSH_HIGHLIGHT_STYLES[assign]="fg=${_ttc[variables]}"
ZSH_HIGHLIGHT_STYLES[named-fd]="fg=${_ttc[variables]}"
ZSH_HIGHLIGHT_STYLES[numeric-fd]="fg=${_ttc[variables]}"
ZSH_HIGHLIGHT_STYLES[arithmetic-expansion]="fg=${_ttc[math]}"
# Paths
ZSH_HIGHLIGHT_STYLES[path]="none"
ZSH_HIGHLIGHT_STYLES[path_pathseparator]="none,bold"
ZSH_HIGHLIGHT_STYLES[path_prefix]="fg=${_ttc[dark]}"
ZSH_HIGHLIGHT_STYLES[path_prefix_pathseparator]="fg=${_ttc[dark]},bold"
# Misc
ZSH_HIGHLIGHT_STYLES[default]="none"
ZSH_HIGHLIGHT_STYLES[comment]="fg=${_ttc[dark]},italic"
ZSH_HIGHLIGHT_STYLES[unknown-token]="none"
ZSH_HIGHLIGHT_STYLES[globbing]="none,bold"
ZSH_HIGHLIGHT_STYLES[history-expansion]="fg=${_ttc[builtins]}"
ZSH_HIGHLIGHT_STYLES[redirection]="fg=${_ttc[light]}"
# Brackets
ZSH_HIGHLIGHT_STYLES[bracket-error]="fg=${_ttc[error]},bold"
ZSH_HIGHLIGHT_STYLES[cursor-matchingbracket]="bold,underline"
ZSH_HIGHLIGHT_STYLES[bracket-level-1]='none'
ZSH_HIGHLIGHT_STYLES[bracket-level-2]='none'
ZSH_HIGHLIGHT_STYLES[bracket-level-3]='none'
ZSH_HIGHLIGHT_STYLES[bracket-level-4]='none'
ZSH_HIGHLIGHT_STYLES[bracket-level-5]='none'
}