c14fcad3b0
The parent commit, which merged the feature/redrawhook bug and thereby closed PR #749, also fixed the following issue: Fixes #40. Fixes #90, closes #470. (The latter is a PR for the former.) Fixes #150, closes #151, closes #160. (The latter two are PR's for the first one.) The related issue #183 appears to have been fixed in master. For #150, a different fix for older versions of zsh was considered but has not been implemented. Issue #154 was fixed in xsel(1) in 2017. The parent commit probably fixed that issue for pre-2017 xsel(1). Is #245, #356, and #749. Fixes #245 (redrawhook umbrella issue). Does not reintroduce #257 (comment). Does not reintroduce #259 (comment) Closes #281 as obsolete. Fixes #295. Fixes #324. Fixes #375. Fixes #377. Closes #421 as obsolete. Fixes #520. Unblocks #536 (already milestoned). Fixes #632. Unblocks #635. Milestoned. Unblocks #688. Milestoned. Unblocks administrative issue #655 (already milestoned). (The above is copied from https://github.com/zsh-users/zsh-syntax-highlighting/pull/749#issuecomment-658407330, but repeated here for the sake of github's commit-to-issue linking magic.) |
||
---|---|---|
docs | ||
highlighters | ||
images | ||
tests | ||
.editorconfig | ||
.gitattributes | ||
.gitignore | ||
.revision-hash | ||
.travis.yml | ||
.version | ||
COPYING.md | ||
HACKING.md | ||
INSTALL.md | ||
Makefile | ||
README.md | ||
changelog.md | ||
release.md | ||
zsh-syntax-highlighting.plugin.zsh | ||
zsh-syntax-highlighting.zsh |
README.md
zsh-syntax-highlighting
Fish shell-like syntax highlighting for Zsh.
Requirements: zsh 4.3.11+.
This package provides syntax highlighting for the shell zsh. It enables highlighting of commands whilst they are typed at a zsh prompt into an interactive terminal. This helps in reviewing commands before running them, particularly in catching syntax errors.
Some examples:
How to install
See INSTALL.md.
FAQ
Why must zsh-syntax-highlighting.zsh
be sourced at the end of the .zshrc
file?
zsh-syntax-highlighting works by hooking into the Zsh Line Editor (ZLE) and computing syntax highlighting for the command-line buffer as it stands at the time z-sy-h's hook is invoked.
In zsh 5.2 and older,
zsh-syntax-highlighting.zsh
hooks into ZLE by wrapping ZLE widgets. It must
be sourced after all custom widgets have been created (i.e., after all zle -N
calls and after running compinit
) in order to be able to wrap all of them.
Widgets created after z-sy-h is sourced will work, but will not update the
syntax highlighting.
In zsh newer than 5.8 (not including 5.8 itself),
zsh-syntax-highlighting uses the add-zle-hook-widget
facility to install
a zle-line-pre-redraw
hook. Hooks are run in order of registration,
therefore, z-sy-h must be sourced (and register its hook) after anything else
that adds hooks that modify the command-line buffer.
Does syntax highlighting work during incremental history search?
Highlighting the command line during an incremental history search (by default bound to to Ctrl+R in zsh's emacs keymap) requires zsh 5.4 or newer.
Under zsh versions older than 5.4, the zsh-default underlining of the matched portion of the buffer remains available, but zsh-syntax-highlighting's additional highlighting is unavailable. (Those versions of zsh do not provide enough information to allow computing the highlighting correctly.)
See issues #288 and #415 for details.
How are new releases announced?
There is currently no "push" announcements channel. However, the following alternatives exist:
- GitHub's RSS feed of releases: https://github.com/zsh-users/zsh-syntax-highlighting/releases.atom
- An anitya entry: https://release-monitoring.org/project/7552/
How to tweak
Syntax highlighting is done by pluggable highlighter scripts. See the documentation on highlighters for details and configuration settings.