docs copyedit: Rewrap to 80 columns, part 2.
This commit is contained in:
parent
3bedd8571e
commit
3f163a2fd4
12
README.md
12
README.md
@ -76,10 +76,11 @@ so make it the last element of the `$plugins` array.
|
||||
|
||||
### System-wide installation
|
||||
|
||||
Either of the above methods is suitable for a single-user installation, which requires
|
||||
no special privileges. If, however, you desire to install zsh-syntax-highlighting
|
||||
system-wide, you may do so by running `make install` and directing your users to
|
||||
add `source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh`
|
||||
Either of the above methods is suitable for a single-user installation,
|
||||
which requires no special privileges. If, however, you desire to install
|
||||
zsh-syntax-highlighting system-wide, you may do so by running `make install`
|
||||
and directing your users to add
|
||||
`source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh`
|
||||
in their `.zshrc`s.
|
||||
|
||||
|
||||
@ -95,7 +96,8 @@ syntax highlighting.
|
||||
|
||||
### How are new releases announced?
|
||||
|
||||
There is currently no "push" announcements channel. However, the following alternatives exist:
|
||||
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/
|
||||
|
@ -14,7 +14,8 @@ Syntax highlighting is done by pluggable highlighters:
|
||||
How to activate highlighters
|
||||
----------------------------
|
||||
|
||||
To activate an highlighter, add it to the `ZSH_HIGHLIGHT_HIGHLIGHTERS` array in `~/.zshrc`, for example:
|
||||
To activate an highlighter, add it to the `ZSH_HIGHLIGHT_HIGHLIGHTERS` array in
|
||||
`~/.zshrc`, for example:
|
||||
|
||||
ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets pattern cursor)
|
||||
|
||||
@ -32,7 +33,8 @@ How to implement a new highlighter
|
||||
|
||||
To create your own `myhighlighter` highlighter:
|
||||
|
||||
* Create your script at `highlighters/${myhighlighter}/${myhighlighter}-highlighter.zsh`.
|
||||
* Create your script at
|
||||
`highlighters/${myhighlighter}/${myhighlighter}-highlighter.zsh`.
|
||||
|
||||
* Implement the `_zsh_highlight_myhighlighter_highlighter_predicate` function.
|
||||
This function must return 0 when the highlighter needs to be called and
|
||||
|
@ -1,7 +1,8 @@
|
||||
zsh-syntax-highlighting / highlighters / brackets
|
||||
=================================================
|
||||
|
||||
This is the `brackets` highlighter, that highlights brackets, parenthesis and matches them.
|
||||
This is the `brackets` highlighter, that highlights brackets, parenthesis and
|
||||
matches them.
|
||||
|
||||
|
||||
How to activate it
|
||||
@ -21,7 +22,8 @@ This highlighter defines the following styles:
|
||||
* `bracket-level-N` - brackets with nest level N
|
||||
* `cursor-matchingbracket` - the matching bracket, if cursor is on a bracket
|
||||
|
||||
To override one of those styles, change its entry in `ZSH_HIGHLIGHT_STYLES`, for example in `~/.zshrc`:
|
||||
To override one of those styles, change its entry in `ZSH_HIGHLIGHT_STYLES`,
|
||||
for example in `~/.zshrc`:
|
||||
|
||||
# To define styles for nested brackets up to level 4
|
||||
ZSH_HIGHLIGHT_STYLES[bracket-level-1]='fg=blue,bold'
|
||||
|
@ -19,7 +19,8 @@ This highlighter defines the following styles:
|
||||
|
||||
* `cursor` - the style for the current cursor position
|
||||
|
||||
To override one of those styles, change its entry in `ZSH_HIGHLIGHT_STYLES`, for example in `~/.zshrc`:
|
||||
To override one of those styles, change its entry in `ZSH_HIGHLIGHT_STYLES`,
|
||||
for example in `~/.zshrc`:
|
||||
|
||||
ZSH_HIGHLIGHT_STYLES[cursor]='bg=blue'
|
||||
|
||||
|
@ -19,7 +19,8 @@ This highlighter defines the following styles:
|
||||
|
||||
* `line` - the style for the whole line
|
||||
|
||||
To override one of those styles, change its entry in `ZSH_HIGHLIGHT_STYLES`, for example in `~/.zshrc`:
|
||||
To override one of those styles, change its entry in `ZSH_HIGHLIGHT_STYLES`,
|
||||
for example in `~/.zshrc`:
|
||||
|
||||
ZSH_HIGHLIGHT_STYLES[line]='bold'
|
||||
|
||||
|
@ -52,7 +52,8 @@ This highlighter defines the following styles:
|
||||
* `comment` - comments, when `setopt INTERACTIVE_COMMENTS` is in effect (`echo # foo`)
|
||||
* `default` - everything else
|
||||
|
||||
To override one of those styles, change its entry in `ZSH_HIGHLIGHT_STYLES`, for example in `~/.zshrc`:
|
||||
To override one of those styles, change its entry in `ZSH_HIGHLIGHT_STYLES`,
|
||||
for example in `~/.zshrc`:
|
||||
|
||||
# Declare the variable
|
||||
typeset -A ZSH_HIGHLIGHT_STYLES
|
||||
|
@ -15,7 +15,8 @@ To activate it, add it to `ZSH_HIGHLIGHT_HIGHLIGHTERS`:
|
||||
How to tweak it
|
||||
---------------
|
||||
|
||||
To use this highlighter, associate patterns with styles in the `ZSH_HIGHLIGHT_PATTERNS` array, for example in `~/.zshrc`:
|
||||
To use this highlighter, associate patterns with styles in the
|
||||
`ZSH_HIGHLIGHT_PATTERNS` array, for example in `~/.zshrc`:
|
||||
|
||||
# To have commands starting with `rm -rf` in red:
|
||||
ZSH_HIGHLIGHT_PATTERNS+=('rm -rf *' 'fg=white,bold,bg=red')
|
||||
|
@ -1,7 +1,8 @@
|
||||
zsh-syntax-highlighting / highlighters / root
|
||||
=============================================
|
||||
|
||||
This is the `root` highlighter, that highlights the whole line if the current user is root.
|
||||
This is the `root` highlighter, that highlights the whole line if the current
|
||||
user is root.
|
||||
|
||||
|
||||
How to activate it
|
||||
@ -19,7 +20,8 @@ This highlighter defines the following styles:
|
||||
|
||||
* `root` - the style for the whole line if the current user is root.
|
||||
|
||||
To override one of those styles, change its entry in `ZSH_HIGHLIGHT_STYLES`, for example in `~/.zshrc`:
|
||||
To override one of those styles, change its entry in `ZSH_HIGHLIGHT_STYLES`,
|
||||
for example in `~/.zshrc`:
|
||||
|
||||
ZSH_HIGHLIGHT_STYLES[root]='bg=red'
|
||||
|
||||
|
@ -15,18 +15,21 @@ that is, `$i` and `$j` specify a range, 1-indexed, inclusive of both endpoints.
|
||||
If `$todo` exists, the test point is marked as TODO (the failure of that test
|
||||
point will not fail the test), and `$todo` is used as the explanation.
|
||||
|
||||
**Note**: `$region_highlight` uses the same `"$i $j $style"` syntax but interprets the indexes differently.
|
||||
**Note**: `$region_highlight` uses the same `"$i $j $style"` syntax but
|
||||
interprets the indexes differently.
|
||||
|
||||
**Isolation**: Each test is run in a separate subshell, so any variables, aliases, functions, etc.,
|
||||
it defines will be visible to the tested code (that computes `$region_highlight`), but will not affect
|
||||
subsequent tests. The current working directory of tests is set to a newly-created empty directory,
|
||||
**Isolation**: Each test is run in a separate subshell, so any variables,
|
||||
aliases, functions, etc., it defines will be visible to the tested code (that
|
||||
computes `$region_highlight`), but will not affect subsequent tests. The
|
||||
current working directory of tests is set to a newly-created empty directory,
|
||||
which is automatically cleaned up after the test exits.
|
||||
|
||||
|
||||
Highlighting test
|
||||
-----------------
|
||||
|
||||
[`test-highlighting.zsh`](tests/test-highlighting.zsh) tests the correctness of the highlighting. Usage:
|
||||
[`test-highlighting.zsh`](tests/test-highlighting.zsh) tests the correctness of
|
||||
the highlighting. Usage:
|
||||
|
||||
zsh test-highlighting.zsh <HIGHLIGHTER NAME>
|
||||
|
||||
@ -40,7 +43,8 @@ which will run all highlighting tests and report results in [TAP](http://testany
|
||||
Performance test
|
||||
----------------
|
||||
|
||||
[`test-perfs.zsh`](tests/test-perfs.zsh) measures the time spent doing the highlighting. Usage:
|
||||
[`test-perfs.zsh`](tests/test-perfs.zsh) measures the time spent doing the
|
||||
highlighting. Usage:
|
||||
|
||||
zsh test-perfs.zsh <HIGHLIGHTER NAME>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user