mirror of
git://git.code.sf.net/p/zsh/code
synced 2024-09-28 15:01:21 +02:00
22608: improve doc for match-word-context
This commit is contained in:
parent
3a97920199
commit
6a77c04ce0
@ -1,5 +1,7 @@
|
|||||||
2006-08-14 Peter Stephenson <pws@csr.com>
|
2006-08-14 Peter Stephenson <pws@csr.com>
|
||||||
|
|
||||||
|
* 22608: Doc/Zsh/contrib.yo: improvments on 22606.
|
||||||
|
|
||||||
* 22606: Doc/Zsh/contrib.yo, Functions/Zle/match-word-context,
|
* 22606: Doc/Zsh/contrib.yo, Functions/Zle/match-word-context,
|
||||||
Functions/Zle/match-words-by-style, Functions/Zle/.distfiles: new
|
Functions/Zle/match-words-by-style, Functions/Zle/.distfiles: new
|
||||||
word-context style for word matching, remove out-of-date handling
|
word-context style for word matching, remove out-of-date handling
|
||||||
|
@ -487,16 +487,15 @@ has been set, and tt(transpose-words-match) is called with the cursor on
|
|||||||
the var(X) of tt(foo)var(X)tt(bar), where var(X) can be any character, then
|
the var(X) of tt(foo)var(X)tt(bar), where var(X) can be any character, then
|
||||||
the resulting expression is tt(bar)var(X)tt(foo).
|
the resulting expression is tt(bar)var(X)tt(foo).
|
||||||
|
|
||||||
Finer grained control can be obtained by setting the style
|
Finer grained control can be obtained by setting the style tt(word-context)
|
||||||
tt(word-context) to an array of pairs of entries. Each pair of entries
|
to an array of pairs of entries. Each pair of entries consists of a
|
||||||
consists of a var(pattern) and a var(subcontext). The word the cursor is on is
|
var(pattern) and a var(subcontext). The shell argument the cursor is on is
|
||||||
matched against each var(pattern) in turn until one matches; if it does,
|
matched against each var(pattern) in turn until one matches; if it does,
|
||||||
the context is extended by a colon and the corresponding var(subcontext).
|
the context is extended by a colon and the corresponding var(subcontext).
|
||||||
Note that the test is made against the original word on the line, with
|
Note that the test is made against the original word on the line, with no
|
||||||
no stripping of quotes. If the cursor is at the end of the line
|
stripping of quotes. If the cursor is at the end of the line the test is
|
||||||
the test is maded against an empty string; if it is on whitespace
|
performed against an empty string; if it is on whitespace between words the
|
||||||
between words the test is made against a single space. Some examples
|
test is made against a single space. Some examples are given below.
|
||||||
are given below.
|
|
||||||
|
|
||||||
Here are some examples of use of the styles, actually taken from the
|
Here are some examples of use of the styles, actually taken from the
|
||||||
simplified interface in tt(select-word-style):
|
simplified interface in tt(select-word-style):
|
||||||
@ -516,7 +515,7 @@ Neither of the styles tt(word-chars) nor tt(word-class) is used in this case.
|
|||||||
Here are some examples of use of the tt(word-context) style to extend
|
Here are some examples of use of the tt(word-context) style to extend
|
||||||
the context.
|
the context.
|
||||||
|
|
||||||
example(zstyle ':zle:*' word-context "[[:space:]]" whitespace "*/*" file
|
example(zstyle ':zle:*' word-context "*/*" file "[[:space:]]" whitespace
|
||||||
zstyle ':zle:transpose-words:whitespace' word-style shell
|
zstyle ':zle:transpose-words:whitespace' word-style shell
|
||||||
zstyle ':zle:transpose-words:filename' word-style normal
|
zstyle ':zle:transpose-words:filename' word-style normal
|
||||||
zstyle ':zle:transpose-words:filename' word-chars '')
|
zstyle ':zle:transpose-words:filename' word-chars '')
|
||||||
|
Loading…
Reference in New Issue
Block a user