local client = vim.api.nvim_get_chan_info(chan).client
local rv = vim.rpcrequest(chan, 'nvim_exec_lua', [[return ... + 1]], { 41 })
vim.print(('got "%s" from parent Nvim'):format(rv))
end
end
<
*v:shell_error* *shell_error-variable*
v:shell_error
Result of the last shell command. When non-zero, the last
shell command had an error. When zero, there was no problem.
This only works when the shell returns the error code to Vim.
The value -1 is often used when the command could not be
executed. Read-only.
Example: >vim
!mv foo bar
if v:shell_error
echo 'could not rename "foo" to "bar"!'
endif
<
*v:stacktrace* *stacktrace-variable*
v:stacktrace
The stack trace of the exception most recently caught and
not finished. Refer to |getstacktrace()| for the structure of
stack trace. See also |v:exception|, |v:throwpoint|, and
|throw-variables|.
*v:statusmsg* *statusmsg-variable*
v:statusmsg
Last given status message.
Modifiable (can be set).
*v:stderr* *stderr-variable*
v:stderr
|channel-id| corresponding to stderr. The value is always 2;
use this variable to make your code more descriptive.
Unlike stdin and stdout (see |stdioopen()|), stderr is always
open for writing. Example: >vim
:call chansend(v:stderr, "error: toaster empty\n")
<
*v:swapchoice* *swapchoice-variable*
v:swapchoice
|SwapExists| autocommands can set this to the selected choice
for handling an existing swapfile:
'o' Open read-only
'e' Edit anyway
'r' Recover
'd' Delete swapfile
'q' Quit
'a' Abort
The value should be a single-character string. An empty value
results in the user being asked, as would happen when there is
no SwapExists autocommand. The default is empty.
*v:swapcommand* *swapcommand-variable*
v:swapcommand
Normal mode command to be executed after a file has been
opened. Can be used for a |SwapExists| autocommand to have
another Vim open the file and jump to the right place. For
example, when jumping to a tag the value is ":tag tagname\r".
For ":edit +cmd file" the value is ":cmd\r".
*v:swapname* *swapname-variable*
v:swapname
Name of the swapfile found.
Only valid during |SwapExists| event.
Read-only.
*v:t_blob* *t_blob-variable* *v:t_TYPE*
v:t_blob Value of |Blob| type. Read-only. See: |type()|
*v:t_bool* *t_bool-variable*
v:t_bool Value of |Boolean| type. Read-only. See: |type()|
*v:t_dict* *t_dict-variable*
v:t_dict Value of |Dictionary| type. Read-only. See: |type()|
*v:t_float* *t_float-variable*
v:t_float Value of |Float| type. Read-only. See: |type()|
*v:t_func* *t_func-variable*
v:t_func Value of |Funcref| type. Read-only. See: |type()|
*v:t_list* *t_list-variable*
v:t_list Value of |List| type. Read-only. See: |type()|
*v:t_number* *t_number-variable*
v:t_number Value of |Number| type.