Vim Recall繁體中文

Call 'operatorfunc'

g@{motion}

Example

Normal 0 / 2

Call 'operatorfunc'.

Prepared operatorfunc

Function
Demo(type): let g:last_type = a:type
operatorfunc
Demo
last_type
not called
Before & after

Before

Prepared operatorfunc

Function
Demo(type): let g:last_type = a:type
operatorfunc
Demo
last_type
not called

After

Prepared operatorfunc

Function
Demo(type): let g:last_type = a:type
operatorfunc
Demo
last_type
char
Marks '[ / ']
line 1 columns 1 / 4 (one and its trailing space)

ILLUSTRATION. Assume +eval. operatorfunc names the prepared harmless Demo(type) function, which records its argument in g:last_type. Complete the operator with w; buffer text is unchanged.

Sample buffer
one two
three four
Cursor on line 1, column 1
Details & Vim help

Call 'operatorfunc'. Use in Normal mode. Braced names stand for the required argument and are not typed literally. Availability and exact behavior can depend on Vim build features, options, mappings and editor state; the linked help is authoritative.