zsh-users / zsh-syntax-highlighting

Fish shell like syntax highlighting for Zsh.
github.com/zsh-users/zsh-syntax-highlighting
BSD 3-Clause "New" or "Revised" License
19.55k stars 1.32k forks source link

Please add a highlighter for flags (like powershell) #866

Closed at-pyrix closed 2 years ago

at-pyrix commented 2 years ago

New Feature/Highlighter

Hi,

This is just a humble request to add a highlighter for flags which start with "-" or "--", just like powershell does.

image

Also, a highlighter for integers would be nice but it isn't that important :) Or can I create one myself? If yes, how?

phy1729 commented 2 years ago

The styles for the main highlighter are documented at https://github.com/zsh-users/zsh-syntax-highlighting/blob/master/docs/highlighters/main.md#how-to-tweak-it ; in particular there's single-hyphen-option and double-hyphen-option. For grey as in the screenshot you'd want ZSH_HIGHLIGHT_STYLES[single-hyphen-option]=fg=8 and ZSH_HIGHLIGHT_STYLES[double-hyphen-option]=fg=8.

at-pyrix commented 2 years ago

@phy1729 Thanks, that helps!