How do I see all recent Vim messages, errors, and echo output I may have missed?
Answer
:messages
Explanation
:messages displays the full log of recent Vim messages — errors, warnings, echo output, and status notifications. When a message flashes by too quickly to read, or gets overwritten by the next command, :messages lets you scroll back through everything Vim has told you during the session.
How it works
- Vim stores up to
'messages'entries (default 20, increase with:set messages=200) :messagesopens a scrollable pager showing all stored output, newest at the bottom- You can navigate it with normal pager keys
:messages clearempties the message history:1messagesor:1messhows only the most recent message
Example
You run a macro that produces several lines of output, but only the last line is visible. Running:
:messages
Shows the full history:
could not find pattern 'foo'
substituted 3 occurrences
E486: Pattern not found: bar
1 line changed
Tips
- Use
:verbose set {option}?to see where an option was last set — the output appears in:messages - When debugging a plugin or autocmd, add
echocalls and inspect them with:messagesafter the fact - Map
:messagesto a key for quick access:nnoremap <leader>m :messages<CR> - In Neovim,
:Notifications(Noice plugin) replaces this with a richer UI, but:messagesalways works natively