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

How do I make Vim show the beginning of long lines that don't fit on screen instead of just showing @@@ placeholders?

Answer

:set display=lastline

Explanation

By default, when the last visible line of a window is too long to fit on screen, Vim shows @@@ in its place — hiding the content entirely. Setting display=lastline changes this behavior so Vim displays as much of the line as it can, appending @@@ only at the very end to signal truncation. This is especially useful when working with files that have very long lines, such as JSON or log files.

How it works

  • :set display=lastline — enables the lastline flag in the display option, instructing Vim to show a partial last line rather than hiding it with @@@
  • The @@@ marker still appears at the end of the last visible row to indicate the line continues beyond the screen edge
  • Does not affect wrap/nowrap — it only changes the fallback rendering when the last visible line cannot be shown in full

Example

With a long JSON blob on the last visible line, default Vim shows:

@
@
@

After :set display=lastline:

{"key": "value", "another": "field", "more"@@@

You can now see the beginning of the line and understand its content at a glance.

Tips

  • Add this to your vimrc / init.vim to make it permanent: set display=lastline
  • In Neovim you can also add truncate to the list: set display=lastline,truncate
  • For very wide files, combine with :set nowrap and sidescrolloff to control horizontal navigation

Next

How do I safely use a filename containing special characters in a Vim Ex command?