Vim Recall繁體中文

Detect the window size and redraw the screen

:mode

Example

Normal 0 / 2

Detect the window size and redraw the screen.

Terminal display

Reported size
100 columns × 30 rows
Vim's cached size
80 columns × 24 rows
Before & after

Before

Terminal display

Reported size
100 columns × 30 rows
Vim's cached size
80 columns × 24 rows

After

Terminal display

Reported size
100 columns × 30 rows
Vim's cached size
100 columns × 30 rows
Screen
redrawn

Subject: :mode. Documentation-backed illustration; assumes legacy command context and terminal reporting 100×30 after resize; not replay-verified. With no argument, :mode detects the terminal size and redraws. Historical MS-DOS mode arguments no longer work; :mode is unsupported in Vim9 script.

Sample buffer
notes
Cursor on line 1, column 1
Details & Vim help

Detect the window size and redraw the screen. 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 :mod[e] 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.