Vim Recall繁體中文

Set highlighting for echo commands

:echohl

Example

Normal 0 / 2

Set highlighting for echo commands.

Echo highlight

Current group
None
Before & after

Before

Echo highlight

Current group
None

After

Echo highlight

Current group
WarningMsg
Applies to
subsequent echo/echon/echomsg and input prompts

Documentation-backed illustration. +eval and a defined WarningMsg highlight group. :echohl selects WarningMsg for later messages; it emits no text itself. Reset with :echohl None after using it. Primary help: :echohl.

Sample buffer
alpha
beta
gamma
Cursor on line 1, column 1
Details & Vim help

Set highlighting for echo commands. 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 :echoh[l] 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.