16

Suppose I have a VIM plugin that is very useful, but it generates a lot of errors/warnings that I don't care for.

How can I ignore all errors from that plugin? I just want to be disturbed by these messages anymore.

Is there any setting/function call that turns off such things?

I know that the best thing would be to report this as issue, but how can I just make them not appear?

Example of errors:

Ionică Bizău
  • 109,027
  • 88
  • 289
  • 474

1 Answers1

28

Well, I would definitely look into the root cause of the errors, as it might affect the plugin's functionality. At least this should allow you to send a precise bug report to the plugin's author.

Errors and warnings can be suppressed via the :silent! (note the !) command. Basically, any Ex command can be prefixed with it. So, if you have a :TroublesomeCommand, you can silence the errors via

:silent! TroublesomeCommand

To silence the plugin (if you really must), you can might be able to redefine its mappings (to include :silent!) and commands, but the use of <SID> may force you to modify the plugin itself. In that case, you can also put the :silent! directly before the offending command (the error should include its location), but again, fixing the root cause would be preferable.

Ingo Karkat
  • 167,457
  • 16
  • 250
  • 324
  • I tried `:silent!` but it doesn't work for me. See screenshot from question. Thanks! – Ionică Bizău Sep 04 '14 at 08:15
  • 1
    @IonicăBizău: The screenshot shows autocmds. For those the `:silent!` needs to be placed before the right-hand command definition. If you just prepend it before `:autocmd` (or any custom call that defines those), it'll only silence errors during the autocmd _definition_. Again, rather fix the root cause, please! – Ingo Karkat Sep 04 '14 at 11:18
  • @IngoKarkat You really have a knack for clearly explaining concepts. I love the "TroublesomeCommand" name you used! – Sabuncu Nov 23 '17 at 09:24