zsh-syntax-highlighting
zsh-syntax-highlighting copied to clipboard
Fish shell like syntax highlighting for Zsh.
Fixes #223 Adds new `function-definition` style; thoughts on what that should be by default?
Fixes #701. There's a TODO in the last commit.
In `BUFFER='\local a=( /* )'`, the word `local` is highlighted as a reserved word where it's in fact a builtin.
Highlighting all errors the same way makes sense from a UI perspective (*cough* #691 *cough*), but it makes the tests weaker: when a test checks that an alias is highlighted...
This is https://github.com/zsh-users/zsh-syntax-highlighting/issues/485#issuecomment-359181850, rebased and with the tests written (for reasons explained there). Concerns: - [ ] https://github.com/zsh-users/zsh-syntax-highlighting/issues/485#issuecomment-358833116 "Modifiers require braces when KSH_ARRAYS is set." - [ ] https://github.com/zsh-users/zsh-syntax-highlighting/issues/485#issuecomment-358833831 Modifiers...
Shall we add a 256-color theme? We could enable it automatically after checking the terminal's capabilities in `${terminfo}`.
Check --show-prefix rather than --is-inside-work-tree in case we're inside some other git repository (e.g. a ports tree).
A history expansion followed by a character ineligible for history expansion (e.g. `=`) isn't highlighted correctly. `!!=` unquoted is all highlighted as history expansion and `"!!="` terminates the history expansion...
From zshexpn(1): > If the shell encounters the character sequence `tt(!")` > in the input, the history mechanism is temporarily disabled until > the current list (see > ifzman(zmanref(zshmisc))\ >...
```zsh % tests/generate.zsh '$NULLCMD | $READNULLCMD' main nullcmd 'local NULLCMD=cat READNULLCMD=f; f(){};' Set copyright year to 2020? y local NULLCMD=cat READNULLCMD=f; f(){}; BUFFER=$'$NULLCMD | $READNULLCMD' expected_region_highlight=( '1 8 unknown-token' #...