| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- # guard against no zgen installed
- if [ ! -d "${HOME}/.zgen" ]; then
- echo "zgen not installed"
- return
- fi
- # load zgen
- source "${HOME}/.zgen/zgen.zsh"
- # if the init scipt doesn't exist
- if ! zgen saved; then
- # completions
- zgen load zsh-users/zsh-completions src
- # bulk load
- zgen loadall <<EOPLUGINS
- mreinhardt/sfz-prompt.zsh
- zsh-users/zsh-autosuggestions
- lukechilds/zsh-better-npm-completion
- zsh-users/zsh-syntax-highlighting
- zsh-users/zsh-history-substring-search
- EOPLUGINS
- # ^ can't indent this EOPLUGINS
- # save all to init script
- zgen save
- fi
- # customise sfz-prompt
- PROMPT_SFZ_CHAR="›"
- setopt TRANSIENT_RPROMPT
- prompt_sfz_colors () {
- case $1 in
- grey) echo "{234}";;
- # used for pwd, light blue
- bgrey) echo "{045}";;
- red) echo "{126}";;
- bred) echo "{200}";;
- green) echo "{035}";;
- bgreen) echo "{048}";;
- yellow) echo "{148}";;
- byellow) echo "{190}";;
- # used for prompt character, light grey
- blue) echo "{250}";;
- bblue) echo "{069}";;
- magenta) echo "{092}";;
- bmagenta) echo "{099}";;
- cyan) echo "{074}";;
- bcyan) echo "{081}";;
- white) echo "{153}";;
- bwhite) echo "{195}";;
- esac
- }
- prompt_sfz_git_dirty() {
- # too expensive
- }
- # bind to zsh-history-substring-search
- bindkey '^[[A' history-substring-search-up
- bindkey '^[[B' history-substring-search-down
- # customize zsh-autosuggestions
- ZSH_AUTOSUGGEST_USE_ASYNC="true"
- ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE="60"
- # customise zsh-history-substring-search
- HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND="underline"
- HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND="none"
- # customise zsh-syntax-highlighting
- ZSH_HIGHLIGHT_STYLES[unknown-token]='none'
- ZSH_HIGHLIGHT_STYLES[path]='bold'
- ZSH_HIGHLIGHT_STYLES[builtin]='fg=82'
- ZSH_HIGHLIGHT_STYLES[command]='fg=121'
- ZSH_HIGHLIGHT_STYLES[alias]='fg=193'
- ZSH_HIGHLIGHT_STYLES[globbing]='fg=white'
|