60 commits that optimized standard zsh-syntax-highlighting to the point that it can edit 10 kB
functions with zed/vared (optimizations done in
history-search-multi-word). Also added:
-
Variable highlighting
-
Colorizing of
${(a)parameter[...]}inside strings (normally only$parameteris colorized) -
Fixed colorizing of function definition, like
abc() { ... }–abcwill not be red -
Fixed colorizing of complex conditions inside
[[, like[[ "$a" || "$b" ]] -
Closing
]]and]are highlighted (see above) -
Paths from
$CDPATHaren't colorized unless the command iscd
Performance differencies can be observed at Asciinema recording, where 10 kB function is being edited:
The plugin is "standalone", which means that only sourcing it is needed. So to
install, unpack fast-syntax-highlighting somewhere and add
source {where-fsh-is}/fast-syntax-highlighting.plugin.zshto zshrc.
If using a plugin manager, then Zplugin is recommended, but you can use any
other too, and also install with Oh My Zsh (by copying directory to
~/.oh-my-zsh/custom/plugins).
Add zplugin load psprint/fast-syntax-highlighting to your .zshrc file. Zplugin will handle
cloning the plugin for you automatically the next time you start zsh. To update
issue zplugin update psprint/fast-syntax-highlighting (update-all can also be used).
Add antigen bundle psprint/fast-syntax-highlighting to your .zshrc file. Antigen will handle
cloning the plugin for you automatically the next time you start zsh.
cd ~/.oh-my-zsh/custom/pluginsgit clone https://github.com/zdharma/fast-syntax-highlighting.git- Add
fast-syntax-highlightingto your plugin list
Add zgen load psprint/fast-syntax-highlighting to your .zshrc file in the same place you're doing
your other zgen load calls in.