Vim Recall繁體中文

Exchange the current window within its row or column

Ctrl-w x

Example

Normal 0 / 1

Exchange the current window within its row or column.

Windows

Window 3 · alpha.txt Active
40 columns × 11 lines
Window 4 · alpha.txt
39 columns × 11 lines
Window 2 · alpha.txt
40 columns × 10 lines
Window 1 · alpha.txt
39 columns × 10 lines
Before & after

Before

Windows

Window 3 · alpha.txt Active
40 columns × 11 lines
Window 4 · alpha.txt
39 columns × 11 lines
Window 2 · alpha.txt
40 columns × 10 lines
Window 1 · alpha.txt
39 columns × 10 lines

After

Windows

Window 2 · alpha.txt Active
40 columns × 10 lines
Window 4 · alpha.txt
39 columns × 11 lines
Window 3 · alpha.txt
40 columns × 11 lines
Window 1 · alpha.txt
39 columns × 10 lines

Start in Normal mode. Window labels use the current window-ID order in each frame and can change after a window closes; they are separate from Vim window numbers. The panel shows observed positions, sizes and the active window in an 80-column example workspace.

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

Example replayed in Vim

Exchange the current window within its row or column. Use in Normal mode. Availability and exact behavior can depend on Vim build features, options, mappings and editor state; the linked help is authoritative. Without a count, target the immediate next sibling position, or the previous one when no next position exists. Count N targets the Nth sibling position in the current row or column, starting at 1, not global window number N. Split groups occupy positions but cannot be exchanged as a unit; selecting a group, missing position or the current window performs no exchange. After a successful exchange, focus enters the other window.