Closed tejasvi closed 3 years ago
Yes, usually nvr is used the other way around: controlling another process and sending it input, not evaluating something there and getting the result back.
But you can still do that with --remote-expr
, which like the name suggests, takes an Vim expression, not a command.
So, to get the first line like in your example:
$ nvr --servername ... --remote-expr 'getline(1)'
If you really want to use Python3 for that, use this:
$ nvr --servername ... --remote-expr 'py3eval("vim.current.buffer[0]")'
nvr -c 'echo "test"'
prints nothing to stdout. More specifically I was trying to get buffer contents usingnvr -c "py3 print(vim.current.buffer[0])"
.