-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathXVI.LST
528 lines (319 loc) · 16.4 KB
/
XVI.LST
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
XVI(1) USER COMMANDS XVI(1)
NAME
xvi - multi-file text editor
SYNOPSIS
xvi { -s _p_a_r_a_m_e_t_e_r-_a_s_s_i_g_n_m_e_n_t } [ -t _t_a_g | +_n_u_m_b_e_r |
+/_p_a_t_t_e_r_n ] { _f_i_l_e_n_a_m_e ... }
DESCRIPTION
Xvi (pronounced _e_c_k_s-_v_e_e-_e_y_e) is a free, portable, multi-
window implementation of the popular vi(1) editor. It has
some useful enhancements, although, as described below, not
all of vi's features have been implemented yet, and some
things work differently from vi.
OPTIONS
The following command-line options are available:
-s _p_a_r_a_m_e_t_e_r-_a_s_s_i_g_n_m_e_n_t
Set the value of the specified parameter at startup.
The assignment has the same form as when given as an
editor command, i.e:
_n_a_m_e=_s_t_r_i_n_g
for string parameters
_n_a_m_e=_n_u_m_b_e_r
for numeric parameters
_n_a_m_e to turn a Boolean parameter on
no_n_a_m_e
to turn a Boolean parameter off
-t _t_a_g
Edit the file containing the definition specified as
_t_a_g, at the start of the definition (as per vi).
+_n_u_m_b_e_r
Go to the specified line number of the file being
edited.
+/_p_a_t_t_e_r_n
Go to the first occurrence of the specified _p_a_t_t_e_r_n
within the file being edited.
The -r command line option is not supported.
ENHANCEMENTS
Multiple buffers and windows
A _b_u_f_f_e_r is the internal object which holds a file in
memory, while a _w_i_n_d_o_w is an area of the screen which shows
part of a buffer. Every window references a buffer, even if
Unix Last change: 19/6/1992 1
XVI(1) USER COMMANDS XVI(1)
no file is being edited. The following commands are
available for operating on buffers and windows:
:buffer
create a new buffer in a new window; can be followed by
a filename, which will be edited in the new buffer.
:split
create a new window on to the current buffer by
splitting the current window in half. The two
resulting windows are similar to _v_i_e_w_p_o_r_t_s on to a
single editing buffer, in that changes made in one
window are reflected in the other one.
:close
close the current window; will also close the buffer if
this is the last window on to it.
:x / ZZ
close only the current window. If the window is the
only one on to the buffer, the buffer will be closed as
well, writing it first if it is modified.
g move to the next window.
^W increase the size of the current window (may be given a
numeric prefix, default is one line).
^T decrease the size of the current window (may be given a
numeric prefix, default is one line).
^O make the current window as large as possible.
^] as for vi, but create a new buffer window if
appropriate (and if autosplit allows).
Note that the :quit command quits out of the editor, not out
of a window. The :close command is thus the equivalent of
:quit for windows. There is no equivalent of :x or ZZ for
the whole editor; these have been hijacked for operations on
windows.
The numeric autosplit parameter specifies the maximum number
of buffer windows that will be created automatically
whenever you either edit more than one file, or use tags to
edit a different file.
Undo works per buffer, as do marks; yank/put and redo (the .
command) work over all buffers, i.e. you can delete from one
buffer and put the text into a different buffer.
Unix Last change: 19/6/1992 2
XVI(1) USER COMMANDS XVI(1)
File preservation
Rather than use vi's Unix-specific method for preservation,
xvi does periodic preservation of all files currently being
edited into temporary files in the same directory. It tries
to do this when you aren't typing, so that you won't notice
the short delay when the temporary file is written out.
Obviously, only changed files are preserved in this way, and
the temporary file is removed once the real file has been
successfully written.
8-bit character support
Characters with the top bit set are accepted by xvi, but it
is not yet possible to have null ('\0') bytes in a file
buffer. How characters are displayed can be controlled by
the cchars and mchars parameters, which, if set, cause
control and meta-characters respectively to be output
unchanged; otherwise they are shown as sequences of
printable characters.
Tabs are normally displayed as a series of spaces of the
appropriate length (according to the tabstops parameter);
setting list mode will cause them to be displayed as control
characters, as will unsetting the tabs parameter. How the
tab character is displayed is then under the control of the
cchars parameter.
You can use the ^_ (control-underscore) command to flip the
top bit of the character the cursor is on. This may be
useful on systems where it is otherwise impossible to enter
8-bit characters.
File formats
Xvi can read and write text files in non-Unix formats. The
current format is given by the value of the format
parameter, which may be set to "unix", "msdos", etc. To see
a list of available formats, type
:se fmt=?
Extended regular expressions
vi's magic parameter is superseded by the regextype
parameter, which can take the following values:
tags only ^ and $ are significant (used for tags)
grep like grep(1), but with \< and \> added
egrep
like egrep(1), but with \< and \> added
The default is grep.
Unix Last change: 19/6/1992 3
XVI(1) USER COMMANDS XVI(1)
Note that it is still possible to set or unset magic as in
vi; this will simply result in regextype being set as
appropriate.
The sections and paragraphs parameters define egrep-style
patterns to search for, rather than vi's simplistic (and
troff-dependent) character pairs.
Improved replace mode
The R command acts more intelligently when you press return
- it leaves the rest of the current line alone, and just
starts replacing text on the next line, starting at the
screen column where you first typed R.
Command re-execution
As well as the normal named (conjugate) buffers, and the
default one (named @), there exist several extra ones named
:, /, ? and !, which contain the last command lines typed to
each of the given commands. So for instance, @: will re-
execute the last ex command, or you can insert it into your
buffer, edit it and then re-execute it (e.g. with dd@@).
Jumpscroll
When multiple windows are used, xvi normally has to be able
to scroll individual windows without scrolling the whole
screen. This can be very inefficient on terminals without
scrolling regions, so the jumpscroll parameter is provided
to control the editor's scrolling behaviour. It can be set
to one of:
off When the cursor moves outside a window's boundaries,
and the new position is near enough, the window will
scroll to the new position.
on When the cursor moves outside a window's boundaries,
the window will always jump to the new position.
auto A window will scroll only if it can do so efficiently;
otherwise it will jump.
The default value is auto.
On ISA-type systems which have memory-mapped displays,
hardware character generators and reasonably fast
processors, jumpscroll should generally be set to off;
however, on LCD screens or other displays with a long image
persistence, this may actually make the text more difficult
to read, and many users may be more comfortable with it
turned on.
Explicit scroll commands (e.g. ^D and ^E) are not affected
by the jumpscroll parameter.
Unix Last change: 19/6/1992 4
XVI(1) USER COMMANDS XVI(1)
Colour
There are four new parameters to control screen colours:
colour colour used for text
statuscolourcolour used for status lines
roscolour as statuscolour, but for readonly files
systemcolourcolour used for system mode (i.e. subshells and
after termination)
These parameters are numeric, and the value means different
things on different operating systems. On Unix, it is an
index into the termcap(5) entries "c0" to "c9", which are
assumed to be colour-setting escape sequences if they are
present. If they are not present, "so" (begin standout
mode) and "se" (end standout mode) are used instead. Values
of 0 and 1 give normal text, whereas 2 and above give
standout mode.
The default colour for the roscolour parameter will
generally involve red if colours are available; this is
intended to provide a warning to the user that writing the
file may not be possible.
On-line help
A primitive help facility is available; the :help command
simply creates a new buffer window on to a standard help
file. The name of the file which is edited is given by the
helpfile string parameter; the default on Unix versions is
"/usr/lib/xvi.help". Note that the help file buffer will be
marked "not editable" when it is created, which prevents
accidental overwriting of the help file even when the file
permissions would allow it.
Miscellaneous
The command :wn (write file and edit next) is provided, as
in PC-vi.
The new edit parameter controls whether a buffer can be
modified. This may be used to implement a nicer version of
view(1) than the standard vi version, since it won't fool
you into thinking that editing the buffer is in any way
safe. Be warned: once having set noedit, it is not possible
to do a :set edit any more. It's a one-way street.
In insert and replace modes, ^A has the same meaning as ^@
in vi, except that it works at any time, not just for the
first character. Also, typing ^B_x where _x is the name of a
conjugate buffer, inserts the contents of that buffer into
the input stream at that point. The buffer named < always
Unix Last change: 19/6/1992 5
XVI(1) USER COMMANDS XVI(1)
contains the last thing inserted, so that ^B< is the same as
^A.
LIMITATIONS
Ex mode
The main area in which xvi is lacking is vi's ex mode, which
is not implemented at all (and neither are edit, e, or open
modes). However, many of the ex commands are available in
vi mode as colon commands; the colon commands that have not
been implemented are mostly those which offer the same
functionality as other commands in vi mode.
In particular, abbreviate, append, change, ex, insert, join,
open, recover, unabbreviate, undo, write>>, z and | have not
been implemented as colon commands yet.
Vi mode
In vi mode, the U and = commands are not implemented,
although there is no real reason why they shouldn't be,
whilst Q is inappropriate in the context of xvi, since there
is no ex mode.
Parameters
Many of vi's parameters have not been implemented; the
command :se all gives a complete list, with current values,
of those that have been.
Miscellaneous
Repeat counts before insertions don't work.
Appending to named buffers is not yet implemented.
Typing ^Q in input mode does not mean the same as ^V; it
just inserts a `^Q', assuming it gets as far as the editor
at all.
Typing ^W in insert mode does not back up one word as in vi.
It is not possible to interrupt the editor while it is
performing certain operations. If you start off a big
global command, you have to wait for it to finish.
Flags and counts after ex mode commands are not supported.
It is not possible to read the output of a system command
using
:r !_c_o_m_m_a_n_d
or to write into a command using
:w !_c_o_m_m_a_n_d.
Unix Last change: 19/6/1992 6
XVI(1) USER COMMANDS XVI(1)
Regular expressions, although implemented (see above), do
not support the ~ metacharacter; also, the \u and \l escape
sequences are not supported in substitute replacement
patterns. Newlines included on the right hand side of a
substitution do not currently cause the line to be split;
the newline character is literally inserted into the line.
The :global command only supports the commands [lps&~d].
OTHER DIFFERENCES FROM VI
The XVINIT environment variable is read instead of EXINIT.
Whilst no files are sourced automatically, users who wish to
have a startup file can arrange it very easily. sh(1) or
ksh(1) users should add this line to their $HOME/.profile:
XVINIT='source _x_v_i-_s_t_a_r_t_u_p-_f_i_l_e'; export XVINIT
csh(1) users should add this to their $HOME/.login:
setenv XVINIT 'source _x_v_i-_s_t_a_r_t_u_p-_f_i_l_e'
The tags parameter can be used to specify multiple tags
files; these can be separated by either ``\ '' (backslash
space) or ``,'' (comma).
Alternate files are handled slightly differently, owing to
the presence of buffer and window handling. Essentially,
when you close a buffer, its filename is remembered as the
alternate file; when you invoke the ^^ or :e # commands,
this file is re-edited. Note that ^^ edits the alternate
file in a new buffer window, if autosplit allows.
Hitting the escape key while in the command line does not
terminate input; instead, it cancels input, returning the
prompt to the beginning of the line. This applies to input
for :, /, ? and !.
FILES
/usr/lib/xvi.helpDefault help file.
SEE ALSO
ex(1), vi(1), termcap(5).
_S_u_m_m_a_r_y _o_f _D_i_f_f_e_r_e_n_c_e_s _b_e_t_w_e_e_n _V_i _a_n_d _X_v_i.
BUGS
o+ When the cursor is on the last word of a buffer, the
command dw leaves the last character of the word
undeleted.
o+ Some screen updates do not get shown properly when
buffers are split, and certain commands (e.g. x) are
executed.
Unix Last change: 19/6/1992 7
XVI(1) USER COMMANDS XVI(1)
o+ If you do something like cf.WORD<_e_s_c> and then redo it,
and the f. fails, then the WORD<_e_s_c> gets taken as
normal input. The rest of the input should really be
cancelled when part of a redo fails.
o+ A command of the form :/pat/;+1m. will not work because
the editor incorrectly detects a conflict between
source and destination.
o+ The editor in its present form is very inefficient in
terms of CPU cycles.
o+ Most termcap(5) terminal descriptions are only tested
with vi(1) (and possibly rogue(6)). Since xvi is, in
some ways, more demanding than vi in its use of termcap
capabilities, it sometimes exposes bugs or inadequacies
in termcap entries. This applies especially to
scrolling regions.
AVAILABILITY
Xvi has been ported to MS-DOS, OS/2, QNX and many different
versions of Unix. Source code is available from the
authors.
AUTHORS
Chris and John Downey.
Derived from STEVIE, written by Tim Thompson and Tony
Andrews.
Unix Last change: 19/6/1992 8