I use vim to do some slowly operations after file saved, those operations let my vim got stuck, so I wondering is there some asynchronize method to make those operations run in background?
Demo:
autocmd BufWritePost *.js call DoSomeTing()
function! DoSomeThing()
" some operations really slow
endfunction
You can use one of the more powerful language bindings (such as Python) to start a new thread and do your work in there. This is generally a really difficult task to get right, however. Also you really must not attempt to modify any vim structures or call any vim functions from these other threads - nothing in the vim core is thread safe.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With