From 817ec23563dfc2f9f7bfab6da812a1b3449505c8 Mon Sep 17 00:00:00 2001 From: Gardouille Date: Thu, 29 Mar 2018 19:07:07 +0200 Subject: [PATCH] Add new highlighters for shell syntax --- zshrc | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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 +# }}} +