开发者

Vim: Showing an error message from a Vim Script

开发者 https://www.devze.com 2022-12-20 18:31 出处:网络
I am trying to show an error message in a Vim script: function! Foo() \" ... endfunction au BufWritePost *.py silent c开发者_开发问答all Foo()

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

精彩评论

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