Pro tip: if you are getting the dreaded "Press ENTER" prompt on file save, make sure `shm+=t` is enabled!

As the title says!

I am posting this because I spent a good 25 minutes debugging it this morning, in the hopes that the next poor soul in this same situation will be able to find this information quickly.

At some point I had changed my shortmess setting, and the t option got dropped in the process. This was resulting in the dreaded “Press ENTER” prompt. Suggestions online tend to involve setting cmdheight=2, which works as long as the filename isn’t so long as to cover two lines, but I don’t want cmdheight=2. So I was racking my brains to figure out what might be causing this, going over my config and looking at verbose autocmd.

I spent a while poring over the shortmess docs in hope of finding something useful, but it was only about the 5th time re-reading that I found my answer, in the t option:

    t   truncate file message at the start if it is too long to fit
        on the command-line, "<" will appear in the left most column.
        Ignored in Ex mode.

It took me those 5 times to realize that the “file message” in question was in fact the message that was causing the “Press ENTER” prompt! Then I ran set shortmess+=t and the problem immediately went away.

If you are reading this, you probably don’t want these “Press ENTER” messages, and you probably do want shortmess+=t enabled.

So when you are setting options in your init file with shortmess=, make sure to include t! And if you mysteriously start getting “Press ENTER” prompts on file save, don’t waste time looking at autocommands. Check shortmess first, and make sure t is enabled!