vimtricks.wiki Concise Vim tricks, one at a time.

How do I stop Vim from constantly showing 'Hit ENTER to continue' by giving messages more room?

Answer

:set cmdheight=2

Explanation

The cmdheight option controls how many lines Vim reserves for the command-line area at the bottom of the screen. The default of 1 often isn't tall enough to display messages from LSP servers, compilers, or plugins — causing the disruptive "Press ENTER or type command to continue" prompt every time a message spills over. Increasing it to 2 or 3 gives messages enough room to display without requiring a key-press.

How it works

  • set cmdheight=1 (default) — one line; any message longer than the terminal width triggers a hit-enter prompt
  • set cmdheight=2 — two lines; fits most plugin and LSP status messages
  • set cmdheight=0 (Neovim 0.8+) — hides the command area entirely when idle, reclaiming the line for buffer content; it reappears on demand

Example

With cmdheight=1, an LSP message like this forces a pause:

Language server initialized, 3 diagnostics found.  Press ENTER or type command to continue

With :set cmdheight=2, the same message sits quietly in the two-line area:

Language server initialized, 3 diagnostics found.
                                                     ← second line stays empty, no prompt

Tips

  • For plugin-heavy or LSP-enabled setups, set cmdheight=2 in your vimrc is a quality-of-life essential
  • Neovim 0.8+ users often prefer set cmdheight=0 — the command area appears only when you type a command or a message arrives
  • Combine with :set shortmess+=c to suppress less important completion-menu messages and further reduce interruptions
  • :set noshowmode removes the -- INSERT -- / -- VISUAL -- status line, which pairs well with a taller cmdheight when you have a plugin rendering mode in the statusline

Next

How do I configure Vim's :grep command to use ripgrep for faster project-wide searching?