Detect the window size and redraw the screen
Example
Normal 0 / 2Command-line 1 / 2Normal 2 / 2Detect the window size and redraw the screen.
Terminal display
- Reported size
100 columns × 30 rows- Vim's cached size
80 columns × 24 rows
Command entered · ready to apply
Terminal display
- Reported size
100 columns × 30 rows- Vim's cached size
80 columns × 24 rows
With no argument, :mode detects the terminal size and redraws. Historical MS-DOS mode arguments no longer work; :mode is unsupported in Vim9 script.
Terminal display
- Reported size
100 columns × 30 rows- Vim's cached size
100 columns × 30 rows- Screen
redrawn
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.
notesCursor on line 1, column 1Details & 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.