zsh-syntax-highlighting
zsh-syntax-highlighting copied to clipboard
Fish shell like syntax highlighting for Zsh.
I had this in my `~/.zshrc`, and I found there are some performance issue when loading up this zsh. `source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh` before comment out the above line: ``` /usr/bin/time zsh...
In `: ${foo:?}`, the `?` is highlighted as `globbing`, even though it's not. Likewise in `: ${bar:*}`. Both of these are parameter expansion syntaxes that simply happen to involve characters...
I am just using `main` highlighter. At first, I thought if I just disable some styles, it will work fine. So I disabled all `quoted-argument`. When I paste `magnet:?xt=..t.nz` after...
If I define an alias: ```shell alias xxx='ls -la' ``` and then type `xxx`, it highlights it just fine. But if I define alias containing a function: ```shell alias xxx='f(){...
- [x] https://openports.se/shells/zsh-syntax-highlighting - [x] http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/shells/zsh-syntax-highlighting/ - [x] Might as well link to https://repology.org/project/zsh-syntax-highlighting/versions so people can quickly check whether their distro's covered or not - [ ] Consider adding...
Here's the implementation of ZSH_HIGHLIGHT_DIRS_BLACKLIST: https://github.com/zsh-users/zsh-syntax-highlighting/blob/e8517244f7d2ae4f9d979faf94608d6e4a74a73e/highlighters/main/main-highlighter.zsh#L1229-L1240 That runs a nested loop for each ordinary (non-option) word on the command line. I suspect that's not very performant. - [ ] Confirm...
Supposing `ZSH_HIGHLIGHT_DIRS_BLACKLIST=( /foo )`, how should `: /foo/bar` be highlighted? Currently, it's highlighted as any ordinary (unquoted non-option) word is, even though it may denote a filename. Consider adding a...
I override `vi`, `vim`, and `nvim` with a local version (if available). The following is the relevant segments from `.zshrc`: ```shell export VARERR='Error: Variable is not set.' export EDITOR="/opt/nvim/bin/nvim" if...
This is a commonly used technique: https://unix.stackexchange.com/questions/33994/zsh-interpret-ignore-commands-beginning-with-as-comments?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa But with zsh-syntax-highlighting turned on, all characters after `#` become invisible.
The `main` highlighter incorporates a zsh syntax parser. Separate that parser into an independently reusable component. The lexer is mostly handled by `bufferwords()` aka ${(z)}, ~~although subshells and command substitutions...