~kaction/dvtm

dvtm/dvtm-editor.1 -rw-r--r-- 1.7 KiB
51d01e91 — Dmitry Bogatov Release 0.15.2 3 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
.Dd December 27, 2016
.Dt DVTM-EDITOR 1
.Os dvtm VERSION
.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