In my $VIMRC, I would like to

autocmd BufWinEnter *.ly call s:BufWinEnterLY()
autocmd TextChanged *.ly call s:TextChangedLY()
autocmd BufUnload *.ly call s:BufUnloadLY()

I want s:BufWinEnterLY() to create a buffer below with the intent to act as a log that cannot be modified, which I will explain further down.

I want s:TextChangedLog() to execute asynchronously lilypond "some predefined arguments" and have all stderr output from that be appended to the aforementioned log.

I want s:BufUnloadLY() to simply delete the log buffer.

I have tried using jobstart with rpc = true, termopen then rpcnotify, serverstart + sockconnect then rpcnotify, but none of these methods work. Any help?

  • 2
    that looks more like 3 separate questions. It should be possible to have a buffer receive the stderr of some jobs, please show what your current function looks like. Sep 7, 2021 at 7:30
  • I agree with @ChristianBrabandt .For example to answer the question on the title I would say execute the command with a . in front (e.g. try opening vim and type :.!date) but that doesn't relate at all with your actual question Sep 7, 2021 at 7:51
  • I don’t think you need rpc here—just to direct the output streams to the buffer. If there isn’t already an option to do this, you could write a callback, or just use :terminal ++shell lilypond args >/dev/null (I’m assuming you only care about stdout)
    – D. Ben Knoble
    Sep 7, 2021 at 12:47


Your Answer

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

Browse other questions tagged or ask your own question.