docs copyedit: Rewrap to 80 columns, part 2.

This commit is contained in:
Daniel Shahaf 2015-11-17 03:02:39 +00:00
parent 3bedd8571e
commit 3f163a2fd4
9 changed files with 37 additions and 21 deletions

View File

@ -76,10 +76,11 @@ so make it the last element of the `$plugins` array.
### System-wide installation ### System-wide installation
Either of the above methods is suitable for a single-user installation, which requires Either of the above methods is suitable for a single-user installation,
no special privileges. If, however, you desire to install zsh-syntax-highlighting which requires no special privileges. If, however, you desire to install
system-wide, you may do so by running `make install` and directing your users to zsh-syntax-highlighting system-wide, you may do so by running `make install`
add `source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh` and directing your users to add
`source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh`
in their `.zshrc`s. in their `.zshrc`s.
@ -95,7 +96,8 @@ syntax highlighting.
### How are new releases announced? ### 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 - 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/ - An anitya entry: https://release-monitoring.org/project/7552/

View File

@ -14,7 +14,8 @@ Syntax highlighting is done by pluggable highlighters:
How to activate 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) ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets pattern cursor)
@ -32,7 +33,8 @@ How to implement a new highlighter
To create your own `myhighlighter` 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. * Implement the `_zsh_highlight_myhighlighter_highlighter_predicate` function.
This function must return 0 when the highlighter needs to be called and This function must return 0 when the highlighter needs to be called and

View File

@ -1,7 +1,8 @@
zsh-syntax-highlighting / highlighters / brackets 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 How to activate it
@ -21,7 +22,8 @@ This highlighter defines the following styles:
* `bracket-level-N` - brackets with nest level N * `bracket-level-N` - brackets with nest level N
* `cursor-matchingbracket` - the matching bracket, if cursor is on a bracket * `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 # To define styles for nested brackets up to level 4
ZSH_HIGHLIGHT_STYLES[bracket-level-1]='fg=blue,bold' ZSH_HIGHLIGHT_STYLES[bracket-level-1]='fg=blue,bold'

View File

@ -19,7 +19,8 @@ This highlighter defines the following styles:
* `cursor` - the style for the current cursor position * `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' ZSH_HIGHLIGHT_STYLES[cursor]='bg=blue'

View File

@ -19,7 +19,8 @@ This highlighter defines the following styles:
* `line` - the style for the whole line * `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' ZSH_HIGHLIGHT_STYLES[line]='bold'

View File

@ -52,7 +52,8 @@ This highlighter defines the following styles:
* `comment` - comments, when `setopt INTERACTIVE_COMMENTS` is in effect (`echo # foo`) * `comment` - comments, when `setopt INTERACTIVE_COMMENTS` is in effect (`echo # foo`)
* `default` - everything else * `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 # Declare the variable
typeset -A ZSH_HIGHLIGHT_STYLES typeset -A ZSH_HIGHLIGHT_STYLES

View File

@ -15,7 +15,8 @@ To activate it, add it to `ZSH_HIGHLIGHT_HIGHLIGHTERS`:
How to tweak it 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: # To have commands starting with `rm -rf` in red:
ZSH_HIGHLIGHT_PATTERNS+=('rm -rf *' 'fg=white,bold,bg=red') ZSH_HIGHLIGHT_PATTERNS+=('rm -rf *' 'fg=white,bold,bg=red')

View File

@ -1,7 +1,8 @@
zsh-syntax-highlighting / highlighters / root 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 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. * `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' ZSH_HIGHLIGHT_STYLES[root]='bg=red'

View File

@ -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 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. 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., **Isolation**: Each test is run in a separate subshell, so any variables,
it defines will be visible to the tested code (that computes `$region_highlight`), but will not affect aliases, functions, etc., it defines will be visible to the tested code (that
subsequent tests. The current working directory of tests is set to a newly-created empty directory, 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. which is automatically cleaned up after the test exits.
Highlighting test 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> 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 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> zsh test-perfs.zsh <HIGHLIGHTER NAME>