diff --git a/zshrc b/zshrc index a1474d2..c59d845 100644 --- a/zshrc +++ b/zshrc @@ -1221,6 +1221,19 @@ cf() { fi -# zsh-syntax-highlighting +# zsh-syntax-highlighting {{{ +## Activate if plugin is available [ -f ~/repos/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh ] && source ~/repos/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh +## Additionnal highlighters +### The order is important. Put **regexp** before **main** to prioritize +### the double quotation marks +ZSH_HIGHLIGHT_HIGHLIGHTERS=(regexp main brackets pattern) +### Dangerous commands +ZSH_HIGHLIGHT_PATTERNS+=('rm -rf *' 'fg=white,bold,bg=red') +ZSH_HIGHLIGHT_REGEXP+=('\bsudo\b' 'fg=white,bold,bg=red') +### Taskwarrior +ZSH_HIGHLIGHT_REGEXP+=('\ \+[^ ]+' 'fg=226') # tags in yellow (+txt) +ZSH_HIGHLIGHT_REGEXP+=('[^ ]+\:' 'fg=135') # metadata in purple +# }}} +