Vim Recall繁體中文

Filter the text covered by the motion through the {filter} command

!{motion}{filter}

Example

Normal 0 / 2
pear
apple
keep
Cursor on line 1, column 1

Filter the text covered by the motion through the {filter} command.

Before & after
Before
pear
apple
keep
Cursor on line 1, column 1
After
apple
pear
keep
Cursor on line 1, column 1

SIMULATED filter

Program
sort
Status
Assumed success; no program executed
Output
apple pear

ILLUSTRATION. The concrete filter is sort. Assume an available shell and a successful tool with the shown output; this data-only illustration never runs it. The motion/count covers only the shown input lines.

Details & Vim help

Filter the text covered by the motion through the {filter} command. 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.