Now, based on another post, I noticed that when using shell commands through vim, the message (as shown in the title) will appear once the command exit.

I know of two ways to somewhat prevent it:

silent ...

or in the case of the other post:

silent exec '!commandhere '.shellescape(getline('.'))

The second:

set shortmess=a

Now the first one seems to work on first glance, but once the [commandhere] exit, it will return to an invisible view so to speak (literally return to vim that was running, but with no text displayed).

The second method doesn't do anything as far as I'm aware. I tried both method with/without colorschemes/plugins to make sure, and I also tried both methods together/one at a time.

In the first method, command-line (ex mode) still work fine however.

Is there any way to disable this specific message? If not, maybe any message of that type (if that's the only way).

Using vim 8.2 (Huge version with GTK2, only using terminal version).

  • 2
    Try :redraw[!] for vim with no text ("invisible view")
    – D. Ben Knoble
    May 21, 2021 at 20:03
  • 1
    This one might be helpful too: github.com/fcpg/vim-altscreen
    – filbranden
    May 21, 2021 at 22:29
  • Thanks, think I found a solution, will post shortly :) @D.BenKnoble May 22, 2021 at 6:31
  • 1
    This is nice! didn't know this plugin existed @filbranden May 22, 2021 at 6:32

1 Answer 1


Based on this answer, I came up with the following:

:silent exec '!commandhere '.shellescape(getline('.'))<CR>:redr!<CR>

This works.

The other alternative as mentioned in the comment would be this plugin.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.