Add new highlighters for shell syntax
This commit is contained in:
parent
b977293d2c
commit
817ec23563
15
zshrc
15
zshrc
|
@ -1221,6 +1221,19 @@ cf() {
|
||||||
|
|
||||||
fi
|
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
|
[ -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
|
||||||
|
# }}}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue