Vim Recall繁體中文

Run python_x command for each line

:pyxdo

Example

Normal 0 / 2
red
blue
green
Cursor on line 1, column 1

Run python_x command for each line.

Per-line context

Range
1,2
Input lines
red / blue
Before & after
Before
red
blue
green
Cursor on line 1, column 1

Per-line context

Range
1,2
Input lines
red / blue
After
RED
BLUE
green
Cursor on line 1, column 1

Per-line context

Range
1,2
Completed
RED / BLUE

Subject: :pyxdo. Documentation-backed illustration; assumes +python3, Python 3 and pyxversion=3; modifiable buffer outside sandbox; not replay-verified. With pyxversion=3 each Python-3 call receives line and linenr; its returned string replaces that line. Only lines 1–2 are transformed; line 3 is outside the range.

Details & Vim help

Run python_x command for each line. This Ex reference uses the full command name; the alphabetical index omits arguments. Supply the ranges, arguments, flags and prerequisite state documented in the linked help. Press Enter to submit a complete command. The index spelling :pyxd[o] puts the optional abbreviation suffix in square brackets; those brackets are not typed. Availability and exact behavior can depend on Vim build features, options, mappings and editor state; the linked help is authoritative. This command requires a Vim build with +python or +python3 support and compatible runtime libraries for the documented embedded language interface.