/usr/share/vim/vim82/doc
NameSizeModeActions
arabic.txt122040644editdlrm
autocmd.txt743140644editdlrm
builtin.txt3890750644editdlrm
change.txt792140644editdlrm
channel.txt503870644editdlrm
cmdline.txt501300644editdlrm
debug.txt68960644editdlrm
debugger.txt54430644editdlrm
develop.txt228610644editdlrm
diff.txt175150644editdlrm
digraph.txt620820644editdlrm
editing.txt753190644editdlrm
eval.txt1782820644editdlrm
farsi.txt5230644editdlrm
filetype.txt279980644editdlrm
fold.txt241390644editdlrm
ft_ada.txt182460644editdlrm
ft_ps1.txt21870644editdlrm
ft_raku.txt41830644editdlrm
ft_rust.txt95960644editdlrm
ft_sql.txt306970644editdlrm
gui.txt530760644editdlrm
gui_w32.txt191170644editdlrm
gui_x11.txt299060644editdlrm
hangulin.txt5980644editdlrm
hebrew.txt56660644editdlrm
help.txt90980644editdlrm
help.txt.vim-tiny14310644editdlrm
helphelp.txt159330644editdlrm
howto.txt29160644editdlrm
if_cscop.txt193250644editdlrm
if_lua.txt185460644editdlrm
if_mzsch.txt119410644editdlrm
if_ole.txt73610644editdlrm
if_perl.txt112810644editdlrm
if_pyth.txt386440644editdlrm
if_ruby.txt85160644editdlrm
if_sniff.txt2710644editdlrm
if_tcl.txt229410644editdlrm
indent.txt419020644editdlrm
index.txt811250644editdlrm
insert.txt875680644editdlrm
intro.txt389340644editdlrm
map.txt744640644editdlrm
mbyte.txt596400644editdlrm
message.txt316710644editdlrm
mlang.txt81870644editdlrm
motion.txt518910644editdlrm
netbeans.txt379820644editdlrm
options.txt4012540644editdlrm
os_390.txt47490644editdlrm
os_amiga.txt54660644editdlrm
os_beos.txt2930644editdlrm
os_dos.txt154960644editdlrm
os_haiku.txt84960644editdlrm
os_mac.txt68560644editdlrm
os_mint.txt3910644editdlrm
os_msdos.txt5230644editdlrm
os_os2.txt2990644editdlrm
os_qnx.txt40710644editdlrm
os_risc.txt3280644editdlrm
os_unix.txt26030644editdlrm
os_vms.txt329030644editdlrm
os_win32.txt144040644editdlrm
pattern.txt629490644editdlrm
pi_getscript.txt210820644editdlrm
pi_gzip.txt12940644editdlrm
pi_logipat.txt41960644editdlrm
pi_netrw.txt1818240644editdlrm
pi_paren.txt22740644editdlrm
pi_spec.txt41270644editdlrm
pi_tar.txt72470644editdlrm
pi_vimball.txt118590644editdlrm
pi_zip.txt74910644editdlrm
popup.txt396890644editdlrm
print.txt312090644editdlrm
quickfix.txt833310644editdlrm
quickref.txt724920644editdlrm
quotes.txt127480644editdlrm
README.Debian3240644editdlrm
recover.txt107200644editdlrm
remote.txt84200644editdlrm
repeat.txt435650644editdlrm
rileft.txt49380644editdlrm
russian.txt30240644editdlrm
scroll.txt137810644editdlrm
sign.txt268700644editdlrm
spell.txt640950644editdlrm
sponsor.txt68030644editdlrm
starting.txt735990644editdlrm
syntax.txt2297950644editdlrm
tabpage.txt172480644editdlrm
tags3626700644editdlrm
tags.vim-tiny300644editdlrm
tagsrch.txt402780644editdlrm
term.txt498220644editdlrm
terminal.txt570980644editdlrm
testing.txt166780644editdlrm
textprop.txt163950644editdlrm
tips.txt210890644editdlrm
todo.txt3071470644editdlrm
uganda.txt140280644editdlrm
undo.txt165840644editdlrm
usr_01.txt70810644editdlrm
usr_02.txt242290644editdlrm
usr_03.txt238720644editdlrm
usr_04.txt191310644editdlrm
usr_05.txt270230644editdlrm
usr_06.txt106380644editdlrm
usr_07.txt159950644editdlrm
usr_08.txt193790644editdlrm
usr_09.txt115020644editdlrm
usr_10.txt292000644editdlrm
usr_11.txt130250644editdlrm
usr_12.txt134330644editdlrm
usr_20.txt137330644editdlrm
usr_21.txt184560644editdlrm
usr_22.txt149990644editdlrm
usr_23.txt127440644editdlrm
usr_24.txt208270644editdlrm
usr_25.txt191760644editdlrm
usr_26.txt82590644editdlrm
usr_27.txt177090644editdlrm
usr_28.txt160200644editdlrm
usr_29.txt201210644editdlrm
usr_30.txt226580644editdlrm
usr_31.txt103990644editdlrm
usr_32.txt53780644editdlrm
usr_40.txt231950644editdlrm
usr_41.txt956260644editdlrm
usr_42.txt138530644editdlrm
usr_43.txt74090644editdlrm
usr_44.txt289480644editdlrm
usr_45.txt176880644editdlrm
usr_46.txt70960644editdlrm
usr_90.txt168360644editdlrm
usr_toc.txt95050644editdlrm
various.txt314830644editdlrm
version4.txt139110644editdlrm
version5.txt3085330644editdlrm
version6.txt5769420644editdlrm
version7.txt6747030644editdlrm
version8.txt19404660644editdlrm
vim9.txt686120644editdlrm
visual.txt218460644editdlrm
vi_diff.txt574280644editdlrm
windows.txt558980644editdlrm
workshop.txt3710644editdlrm
Edit: /usr/share/vim/vim82/doc/remote.txt (8420B)
*remote.txt* For Vim version 8.2. Last change: 2021 Dec 27 VIM REFERENCE MANUAL by Bram Moolenaar Vim client-server communication *client-server* 1. Common functionality |clientserver| 2. X11 specific items |x11-clientserver| 3. MS-Windows specific items |w32-clientserver| ============================================================================== 1. Common functionality *clientserver* When compiled with the |+clientserver| option, Vim can act as a command server. It accepts messages from a client and executes them. At the same time, Vim can function as a client and send commands to a Vim server. 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. There is one optional init command: +{cmd}. This must be an Ex command that can be followed by "|". 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 > vim --remote-send ":n filename" < --remote-silent [+{cmd}] {file} ... *--remote-silent* As above, but don't complain if there is no server and the file is edited locally. --remote-wait [+{cmd}] {file} ... *--remote-wait* As --remote, but wait for files to complete (unload) in remote Vim. --remote-wait-silent [+{cmd}] {file} ... *--remote-wait-silent* As --remote-wait, but don't complain if there is no server. *--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-tab-wait* --remote-tab-wait Like --remote-wait but open each file in a new tabpage. *--remote-tab-wait-silent* --remote-tab-wait-silent Like --remote-wait-silent but open each file in a new tabpage. *--servername* --servername {name} Become the server {name}. When used together with one of the --remote commands: connect to server {name} instead of the default (see below). The name used will be uppercase. *--remote-send* --remote-send {keys} Send {keys} to server and exit. The {keys} are not mapped. Special key names are recognized, e.g., "" results in a CR character. *--remote-expr* --remote-expr {expr} Evaluate {expr} in server and print the result on stdout. *--serverlist* --serverlist Output a list of server names. Examples ~ Edit "file.txt" in an already running GVIM server: > gvim --remote file.txt Edit "file.txt" in an already running server called FOOBAR: > gvim --servername FOOBAR --remote file.txt Edit "file.txt" in server "FILES" if it exists, become server "FILES" otherwise: > gvim --servername FILES --remote-silent file.txt This doesn't work, all arguments after --remote will be used as file names: > gvim --remote --servername FOOBAR file.txt Edit file "+foo" in a remote server (note the use of "./" to avoid the special meaning of the leading plus): > vim --remote ./+foo Tell the remote server "BLA" to write all files and exit: > vim --servername BLA --remote-send ':wqa' SERVER NAME *client-server-name* By default Vim will try to register the name under which it was invoked (gvim, egvim ...). This can be overridden with the --servername argument. If the specified name is not available, a postfix is applied until a free name is encountered, i.e. "gvim1" for the second invocation of gvim on a particular X-server. The resulting name is available in the servername builtin variable |v:servername|. The case of the server name is ignored, thus "gvim" and "GVIM" are considered equal. When Vim is invoked with --remote, --remote-wait or --remote-send it will try to locate the server name determined by the invocation name and --servername argument as described above. If an exact match is not available, the first server with the number postfix will be used. If a name with the number postfix is specified with the --servername argument, it must match exactly. If no server can be located and --remote or --remote-wait was used, Vim will start up according to the rest of the command line and do the editing by itself. This way it is not necessary to know whether gvim is already started when sending command to it. The --serverlist argument will cause Vim to print a list of registered command servers on the standard output (stdout) and exit. Win32 Note: Making the Vim server go to the foreground doesn't always work, because MS-Windows doesn't allow it. The client will move the server to the foreground when using the --remote or --remote-wait argument and the server name starts with "g". 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. The --remote-wait argument does the same thing and additionally sets up to wait for each of the files to have been edited. This uses the BufUnload event, thus as soon as a file has been unloaded, Vim assumes you are done editing it. 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! FUNCTIONS *E240* *E573* There are a number of Vim functions for scripting the command server. See the description in |builtin.txt| or use CTRL-] on the function name to jump to the full explanation. synopsis explanation ~ remote_startserver( name) run a server remote_expr( server, string, idvar) send expression remote_send( server, string, idvar) send key sequence serverlist() get a list of available servers remote_peek( serverid, retvar) check for reply string remote_read( serverid) read reply string server2client( serverid, string) send reply string remote_foreground( server) bring server to the front See also the explanation of |CTRL-\_CTRL-N|. Very useful as a leading key sequence. The {serverid} for server2client() can be obtained with expand("") ============================================================================== 2. X11 specific items *x11-clientserver* *E247* *E248* *E251* *E258* *E277* The communication between client and server goes through the X server. The display of the Vim server must be specified. The usual protection of the X server is used, you must be able to open a window on the X server for the communication to work. It is possible to communicate between different systems. By default, a GUI Vim will register a name on the X-server by which it can be addressed for subsequent execution of injected strings. Vim can also act as a client and send strings to other instances of Vim on the same X11 display. When an X11 GUI Vim (gvim) is started, it will try to register a send-server name on the 'VimRegistry' property on the root window. A non GUI Vim with access to the X11 display (|xterm-clipboard| enabled), can also act as a command server if a server name is explicitly given with the --servername argument, or when Vim was built with the |+autoservername| feature. An empty --servername argument will cause the command server to be disabled. To send commands to a Vim server from another application, read the source file src/if_xcmdsrv.c, it contains some hints about the protocol used. ============================================================================== 3. Win32 specific items *w32-clientserver* Every Win32 Vim can work as a server, also in the console. You do not need a version compiled with OLE. Windows messages are used, this works on any version of MS-Windows. But only communication within one system is possible. Since MS-Windows messages are used, any other application should be able to communicate with a Vim server. An alternative is using the OLE functionality |ole-interface|. When using gvim, the --remote-wait only works properly this way: > start /w gvim --remote-wait file.txt < vim:tw=78:sw=4:ts=8:noet:ft=help:norl: