.Dd December 27, 2016 .Dt DVTM-EDITOR 1 .Os dvtm 0.15+40.g311a8c0-1 .Sh NAME .Nm dvtm-editor .Nd make a text editor act as a filter . . .Sh SYNOPSIS . .Nm ARGS... . . .Sh DESCRIPTION . The .Nm is a file buffering utility used by the .Xr dvtm 1 terminal multiplexer to implement its copy mode. It reads the standard input and saves it to a temporary file, then opens an editor according to the .Sx "ENVIRONMENT VARIABLES" . .Pp If the invoked editor terminates with a non-zero exit status or the file modification time remains unchanged, .Nm does not output anything. Otherwise, it outputs the content of the modified temporary file to stdout. .Pp All command line arguments are forwarded verbatim. .Xr dvtm 1 uses this to adjust the initial view port by passing .Sy +n , meaning the start of line .Sy n should be displayed. . . .Sh ENVIRONMENT VARIABLES . .Nm will try to find the user editor by checking these variables in order: . .Bl -tag -width indent .It Ev DVTM_EDITOR Permitting to invoke an editor specific to dvtm, or set particular flags. . .It Ev VISUAL , Ev EDITOR Falling back to global defaults: .Ev VISUAL and .Ev EDITOR . .El .Pp If no editor is found, .Xr vi 1 is used. . . .Sh FILES . The temporary files are created according to the template: .Pa /tmp/dvtm-editor.XXXXXX . .Pp .Pa /dev/tty is opened to obtain a controlling tty which is used for the standard input/output streams of the invoked editor. . .Sh NOTES . Using .Xr vis 1 as editor is particularly convenient because .Ic :wq! in visual mode will reduce the file to the currently active selection(s). . .Sh SEE ALSO . .Xr vi 1 , .Xr dvtm 1 , .Xr dvtm-pager 1 . . .Sh AUTHOR . dvtm is written by .An Marc André Tanner Aq Mt mat at brain-dump.org