Support communication with parent nvim if run in :terminal
lucc opened this issue · 0 comments
lucc commented
It should be possible to communicate with a parent nvim instance via the $NVIM
socket if nvimpager is run in a :terminal
.
Something like
[[ -S $NVIM ]] && [[ -r $NVIM ]] && [[ -w $NVIM ]]
nvim --clean --headless -u NONE \
--cmd 'let id=sockconnect("pipe", $NVIM, {"rpc":1})' \
--cmd 'echo rpcrequest(id, "nvim_command", "echo 1")' \
--cmd 'qa!'
can be used to send requests to the parent nvim.
Now the nvimpager code needs to be modularised in such a way that the functionality can be loaded into a running nvim without disturbing the editor. This probably means refactor cat mode and ansi-esc mode work like any normal plugin. The old AnsiEsc plugin from Dr Chip and :TOHtml can serve as examples here.