2

Is it possible to suppress messages in vim that are coming from the system or shell? E.g. message from sysadmin or batch queue messages when jobs complete.

Note that I want to specify this at the vim command line or in .vimrc, NOT at the shell or system level. I am using an obscure operating system (OpenVMS) so answers specific to Windows, Linux, or MacOS will unfortunately not be helpful to me.

The rationale, if it matters: I'll often have a large number of batch jobs complete which writes over my text in vim and I have to repeatedly hit Ctrl-L to refresh the screen. I don't want to turn off the messages at the system or shell level because I want to see them. I just don't want them messing up my text in vim.

In a different editor the system messages would display at the bottom of the window without screwing up the text so if anyone knows how to make vim do that, I would also consider accepting that as an answer.

0

1 Answer 1

1

This is what worked for me based on the comments of @Carpetsmoker and @Mass (thanks to both!)

Added these lines to .vimrc:

autocmd VimEnter * silent ! set broadcast=none
autocmd VimLeave * silent ! set broadcast=all

This simply turns messages off when you start vim, and then turns them back on when you exit vim. set broadcast=xxx is specific to OpenVMS but I imagine this would work for linux/windows/mac if you substituted the appropriate command.

3
  • For completeness, you're saying autocmd VimEnter * silent !set broadcast=none produced a "Press ENTER" message?
    – Mass
    Commented Sep 29, 2017 at 0:19
  • 1
    Ah, okay. FYI: silent must precede each command it is to make silent, by itself it does nothing. So, autocmd VimEnter * silent !set broadcast=none may have worked, but putting silent on a separate line will definitely not work, as expected.
    – Mass
    Commented Sep 29, 2017 at 2:13
  • @Mass Thanks! You are exactly correct about that. I have edited it to reflect that. I initially misunderstood what you were saying.
    – JohnE
    Commented Sep 29, 2017 at 2:46

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.