Skip to content

count en

Hamatoma edited this page Aug 6, 2022 · 1 revision

Counts the occurrence of a search pattern in a buffer.

Parameters

Name Type Description Example
append bool The result is appended in the destination buffer. append
input bufferName This buffer is counted. Default: input input=addresses
output bufferName The result is written into this buffer. Default: output output=result
marker character Defines a placeholder for the result number in template. Default: '#' marker=*
template string Template of what the result message looks like. Must contain marker. Default: the value of marker template="# hits: *"
what pattern Search pattern: String (also interpolated) or regular expression what="address"
what=r/\d+/

Examples

The "input" buffer contains:

Be or not to be, that's the question!
Hic Rhodes, Hic salta!
Command:
count what="e"
After that it says in "output": 4 Commands:
count what=r/\S+/ template="# words" output=statistic
count regexpr=r/[.;!?]/ t=', # sets' o=statistic append
count regexpr=r/./ t=', # characters' o=statistic append
Then the buffer says "statistic":
12 words, 2 sentences, 59 characters

Clone this wiki locally