remote.txt 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. *remote.txt* Nvim
  2. VIM REFERENCE MANUAL by Bram Moolenaar
  3. Vim client-server communication *client-server*
  4. Type |gO| to see the table of contents.
  5. ==============================================================================
  6. 1. Common functionality *clientserver*
  7. Nvim's |RPC| functionality allows clients to programmatically control Nvim. Nvim
  8. itself takes command-line arguments that cause it to become a client to another
  9. Nvim running as a server. These arguments match those provided by Vim's
  10. clientserver option.
  11. The following command line arguments are available:
  12. argument meaning ~
  13. --remote [+{cmd}] {file} ... *--remote*
  14. Open the file list in a remote Vim. When
  15. there is no Vim server, execute locally.
  16. Vim allows one init command: +{cmd}.
  17. This must be an Ex command that can be
  18. followed by "|". It's not yet supported by
  19. Nvim.
  20. The rest of the command line is taken as the
  21. file list. Thus any non-file arguments must
  22. come before this.
  23. You cannot edit stdin this way |--|.
  24. The remote Vim is raised. If you don't want
  25. this use >
  26. nvim --remote-send "<C-\><C-N>:n filename<CR>"
  27. <
  28. --remote-silent [+{cmd}] {file} ... *--remote-silent*
  29. As above, but don't complain if there is no
  30. server and the file is edited locally.
  31. *--remote-tab*
  32. --remote-tab Like --remote but open each file in a new
  33. tabpage.
  34. *--remote-tab-silent*
  35. --remote-tab-silent Like --remote-silent but open each file in a
  36. new tabpage.
  37. *--remote-send*
  38. --remote-send {keys} Send {keys} to server and exit. The {keys}
  39. are not mapped. Special key names are
  40. recognized, e.g., "<CR>" results in a CR
  41. character.
  42. *--remote-expr*
  43. --remote-expr {expr} Evaluate {expr} in server and print the result
  44. on stdout.
  45. *--server*
  46. --server {addr} Connect to the named pipe or socket at the
  47. given address for executing remote commands.
  48. See |--listen| for specifying an address when
  49. starting a server.
  50. Examples ~
  51. Start an Nvim server listening on a named pipe at '~/.cache/nvim/server.pipe': >
  52. nvim --listen ~/.cache/nvim/server.pipe
  53. Edit "file.txt" in an Nvim server listening at '~/.cache/nvim/server.pipe': >
  54. nvim --server ~/.cache/nvim/server.pipe --remote file.txt
  55. This doesn't work, all arguments after --remote will be used as file names: >
  56. nvim --remote --server ~/.cache/nvim/server.pipe file.txt
  57. Tell the remote server to write all files and exit: >
  58. nvim --server ~/.cache/nvim/server.pipe --remote-send '<C-\><C-N>:wqa<CR>'
  59. REMOTE EDITING
  60. The --remote argument will cause a |:drop| command to be constructed from the
  61. rest of the command line and sent as described above.
  62. Note that the --remote and --remote-wait arguments will consume the rest of
  63. the command line. I.e. all remaining arguments will be regarded as filenames.
  64. You can not put options there!
  65. ==============================================================================
  66. 2. Missing functionality *E5600* *clientserver-missing*
  67. Vim supports additional functionality in clientserver that's not yet
  68. implemented in Nvim. In particular, none of the "wait" variants are supported
  69. yet. The following command line arguments are not yet available:
  70. argument meaning ~
  71. --remote-wait [+{cmd}] {file} ... *--remote-wait*
  72. Not yet supported by Nvim.
  73. As --remote, but wait for files to complete
  74. (unload) in remote Vim.
  75. --remote-wait-silent [+{cmd}] {file} ... *--remote-wait-silent*
  76. Not yet supported by Nvim.
  77. As --remote-wait, but don't complain if there
  78. is no server.
  79. *--remote-tab-wait*
  80. --remote-tab-wait Not yet supported by Nvim.
  81. Like --remote-wait but open each file in a new
  82. tabpage.
  83. *--remote-tab-wait-silent*
  84. --remote-tab-wait-silent Not yet supported by Nvim.
  85. Like --remote-wait-silent but open each file
  86. in a new tabpage.
  87. *--servername*
  88. --servername {name} Not yet supported by Nvim.
  89. Become the server {name}. When used together
  90. with one of the --remote commands: connect to
  91. server {name} instead of the default (see
  92. below). The name used will be uppercase.
  93. *--serverlist*
  94. --serverlist Not yet supported by Nvim.
  95. Output a list of server names.
  96. SERVER NAME *client-server-name*
  97. By default Vim will try to register the name under which it was invoked (gvim,
  98. egvim ...). This can be overridden with the --servername argument. Nvim
  99. either listens on a named pipe or a socket and does not yet support this
  100. --servername functionality.
  101. vim:tw=78:sw=4:ts=8:noet:ft=help:norl: