Closed rr- closed 3 years ago
unfortunately subscribe/unsubscribe are mostly useless and unrelated to the vim "events" (autocommands). Instead see :help autocmd
. work to improve this is https://github.com/neovim/neovim/pull/11613 for example
Instead see
:help autocmd
.
Excuse me, I am at a loss as to how :help autocmd
helps with OPs question, could you elaborate?
Context: I'm creating headless neovim child instance like so:
I'm looking into subscribing to User events (so that I can
self._nvim.command(":map zp doau User blabla<CR>")
and then react to it within my Python code), but the only documentation I have found is this:I assumed I could
self.nvim.subscribe('User', lambda ev: …)
but no. All I can do isself.nvim.subscribe('User')
. So I went to look at the tests to see how I can actually receive those events in the userland, and there are subscriptions tests indeed:However that is still not very helpful. Does that mean I now have to create an event loop that will poll
vim.next_message
and filter relevant events? I thought pynvim does that for me as per documentation of theNvim
class?