remote.txt 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  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. *--remote-ui*
  46. --remote-ui Display the UI of the server in the terminal.
  47. Fully interactive: keyboard and mouse input
  48. are forwarded to the server.
  49. *--server*
  50. --server {addr} Connect to the named pipe or socket at the
  51. given address for executing remote commands.
  52. See |--listen| for specifying an address when
  53. starting a server.
  54. Examples ~
  55. Start an Nvim server listening on a named pipe at '~/.cache/nvim/server.pipe': >
  56. nvim --listen ~/.cache/nvim/server.pipe
  57. Edit "file.txt" in an Nvim server listening at '~/.cache/nvim/server.pipe': >
  58. nvim --server ~/.cache/nvim/server.pipe --remote file.txt
  59. This doesn't work, all arguments after --remote will be used as file names: >
  60. nvim --remote --server ~/.cache/nvim/server.pipe file.txt
  61. Tell the remote server to write all files and exit: >
  62. nvim --server ~/.cache/nvim/server.pipe --remote-send '<C-\><C-N>:wqa<CR>'
  63. REMOTE EDITING
  64. The --remote argument will cause a |:drop| command to be constructed from the
  65. rest of the command line and sent as described above.
  66. Note that the --remote and --remote-wait arguments will consume the rest of
  67. the command line. I.e. all remaining arguments will be regarded as filenames.
  68. You can not put options there!
  69. ==============================================================================
  70. 2. Missing functionality *E5600* *clientserver-missing*
  71. Vim supports additional functionality in clientserver that's not yet
  72. implemented in Nvim. In particular, none of the "wait" variants are supported
  73. yet. The following command line arguments are not yet available:
  74. argument meaning ~
  75. --remote-wait [+{cmd}] {file} ... *--remote-wait*
  76. Not yet supported by Nvim.
  77. As --remote, but wait for files to complete
  78. (unload) in remote Vim.
  79. --remote-wait-silent [+{cmd}] {file} ... *--remote-wait-silent*
  80. Not yet supported by Nvim.
  81. As --remote-wait, but don't complain if there
  82. is no server.
  83. *--remote-tab-wait*
  84. --remote-tab-wait Not yet supported by Nvim.
  85. Like --remote-wait but open each file in a new
  86. tabpage.
  87. *--remote-tab-wait-silent*
  88. --remote-tab-wait-silent Not yet supported by Nvim.
  89. Like --remote-wait-silent but open each file
  90. in a new tabpage.
  91. *--servername*
  92. --servername {name} Not yet supported by Nvim.
  93. Become the server {name}. When used together
  94. with one of the --remote commands: connect to
  95. server {name} instead of the default (see
  96. below). The name used will be uppercase.
  97. *--serverlist*
  98. --serverlist Not yet supported by Nvim.
  99. Output a list of server names.
  100. SERVER NAME *client-server-name*
  101. By default Vim will try to register the name under which it was invoked (gvim,
  102. egvim ...). This can be overridden with the --servername argument. Nvim
  103. either listens on a named pipe or a socket and does not yet support this
  104. --servername functionality.
  105. vim:tw=78:sw=4:ts=8:noet:ft=help:norl: