Files
neovim/runtime/doc/remote.txt
Justin M. Keyes f1fad32e2e docs: misc, custom text-object #39877
text-object-define is a pattern I found in tpope's plugins (e.g.
https://github.com/tpope/vim-jdaddy) which shows an elegant way to
define a text-object. (Any mistakes in the example are my fault.)
2026-05-20 05:21:27 -04:00

116 lines
4.1 KiB
Plaintext

*remote.txt* Nvim
VIM REFERENCE MANUAL by Bram Moolenaar
Vim client-server communication *client-server*
Type |gO| to see the table of contents.
==============================================================================
1. Common functionality *clientserver*
Nvim's |RPC| functionality allows clients to programmatically control Nvim. Nvim
itself takes command-line arguments that cause it to become a client to another
Nvim running as a server. These arguments match those provided by Vim's
clientserver option.
The following command line arguments are available:
argument meaning ~
--remote [+{cmd}] {file} ... *--remote*
Open the file list in a remote Vim. When
there is no Vim server, execute locally.
Vim allows one init command: +{cmd}.
This must be an Ex command that can be
followed by "|". It's not yet supported by
Nvim.
The rest of the command line is taken as the
file list. Thus any non-file arguments must
come before this.
You cannot edit stdin this way |--|.
The remote Vim is raised. If you don't want
this use >
nvim --remote-send "<C-\><C-N>:n filename<CR>"
<
--remote-silent [+{cmd}] {file} ... *--remote-silent*
As above, but don't complain if there is no
server and the file is edited locally.
*--remote-tab*
--remote-tab Like --remote but open each file in a new
tabpage.
*--remote-tab-silent*
--remote-tab-silent Like --remote-silent but open each file in a
new tabpage.
*--remote-send*
--remote-send {keys} Send {keys} to server and exit. The {keys}
are not mapped. Special key names are
recognized, e.g., "<CR>" results in a CR
character.
*--remote-expr*
--remote-expr {expr} Evaluate {expr} in server and print the result
on stdout.
*--remote-ui*
--remote-ui Display the UI of the server in the terminal.
Fully interactive: keyboard and mouse input
are forwarded to the server.
*--server*
--server {addr} Connect to the named pipe or socket at the
given address for executing remote commands.
See |--listen| for specifying an address when
starting a server.
Examples ~
Start an Nvim server listening on a named pipe at '~/.cache/nvim/server.pipe': >
nvim --listen ~/.cache/nvim/server.pipe
Edit "file.txt" in an Nvim server listening at '~/.cache/nvim/server.pipe': >
nvim --server ~/.cache/nvim/server.pipe --remote file.txt
This doesn't work, all arguments after --remote will be used as file names: >
nvim --remote --server ~/.cache/nvim/server.pipe file.txt
Tell the remote server to write all files and exit: >
nvim --server ~/.cache/nvim/server.pipe --remote-send '<C-\><C-N>:wqa<CR>'
REMOTE EDITING
The --remote argument will cause a |:drop| command to be constructed from the
rest of the command line and sent as described above.
Note that the --remote and --remote-wait arguments will consume the rest of
the command line. I.e. all remaining arguments will be regarded as filenames.
You can not put options there!
==============================================================================
2. Missing functionality *E5600* *clientserver-missing*
Vim supports additional functionality in clientserver that's not yet
implemented in Nvim. In particular, none of the "wait" variants are supported
yet. The following command line arguments are not yet available:
argument meaning ~
--remote-wait [+{cmd}] {file} ... *--remote-wait*
Not yet supported by Nvim.
As --remote, but wait for files to complete
(unload) in remote Vim.
--remote-wait-silent [+{cmd}] {file} ... *--remote-wait-silent*
Not yet supported by Nvim.
As --remote-wait, but don't complain if there
is no server.
*--remote-tab-wait*
--remote-tab-wait Not yet supported by Nvim.
Like --remote-wait but open each file in a new
tabpage.
*--remote-tab-wait-silent*
--remote-tab-wait-silent Not yet supported by Nvim.
Like --remote-wait-silent but open each file
in a new tabpage.
vim:tw=78:sw=4:ts=8:noet:ft=help:norl: