开发者

Vim: Showing an error message from a Vim Script

I am trying to show an error message in a Vim script:

function! Foo()
    " ...
endfunction

au BufWritePost *.py silent c开发者_开发问答all Foo()

The "throw" keyword works, but is probably not the right way to do this. I found references to "echomsg", but this doesn't have any effect:

echohl ErrorMsg
echomsg 'Hello World'
echohl NONE

I also tried to write into v:statusmsg (also no effect). Any idea?

In addition, I'd probably also want to stop the signal propagation like throw() does, i.e. such that other hooks that listen to the BufWritePost event are not called.


I think you are looking for echoerr.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜