-
Notifications
You must be signed in to change notification settings - Fork 0
/
tvx_ref2.doc
1452 lines (955 loc) · 46.3 KB
/
tvx_ref2.doc
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
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
TVX Reference Manual 2/25/86
*** USER CUSTOMIZATION of TVX ***
A program called TVX_CFG is also provided with most versions of
Standard TVX. It allows you to customize TVX to a great extent. The
program generates a file called CONFIG.TVX. When TVX is started with
a command line of the form: 'TVX filename -c=config.tvx", the values
defined in CONFIG.TVX will be used instead of the defaults. (Warning:
TVX_CFG may not be implemented for all systems. It does not work with
the emulator versions of TVX.)
TVCONFIG is mostly self explanatory. It allows you to change the
following:
1. Commands. All of the approximately 50 commands can be redefined.
There are some restrictions: all commands must be a single letter, and
case is ignored. The '@', ESCAPE, and '<>' commands cannot be
changed. Commands cannot be a number, including a '-'.
2. Synonyms. You may define some synonyms, such as space for right,
or RETURN for down. You cannot duplicate previously defined
commands.
3. Function Keys. Up to 50 function keys may be defined to be
equivalent to any command (in fact any letter or character). When a
function key is pressed, TVX will translate it to the character you
specify. If your function keys use an ESCAPE as a prefix character,
you will have to redefine a function key to be ESCAPE!
4. Parameters. You may change the default for any of the ':'
parameters.
After you have built a suitable working version of CONFIG.TVX,
another program called TVX_PTCH has been provided to allow TVX.EXE (or
TVX.COM) to be permanently patched with the options set by TVX_CFG.
This means you won't have keep track of the CONFIG.TVX file any more,
and won't need the '-c' switch.
-22-
TVX Reference Manual 2/25/86
*** Error Messages ***
*** Abort, are you sure?
This message is displayed after the "abort" command has been
entered. A reply of y or Y will cause the session to be terminated.
*** Bad O= switch
An incorrect format was specified for the O= switch.
*** Bad @ name
An invalid file name was specified. Re-enter.
*** Bad command: x
The command is not a valid TVX command.
*** Bad file name
An invalid file name was specified. Re-enter.
*** Bad output file: filename
An invalid output file was specified.
*** Bad par (val | name)
An invalid value or parameter name was specified.
*** Bad rpt buff #
An invalid repeat loop number was entered.
*** Bad switch
An invalid switch was specified. Re-enter file name and
switches.
*** buffer empty
Information message. Displayed after a new file has been
created, or when the write buffer command is executed and the text
buffer is empty.
*** Can't create new name
TVX was unable to create a new name for the output file. Free
some disk space, rename the file, try again.
*** Can't insert that
There are three values that TVX uses internally, and thus are not
valid as user inserted characters in the text buffer.
*** Can't save last line twice!
The last line of the buffer can only be saved once. (That
applies to the other lines, too, but the last line is a special case.)
*** Can't :o, R/O
It makes no sense to set a new file name when the file is read
only.
*** Can't, buffer empty. Insert 1st
Most TVX commands are not valid until some text has been inserted
into the buffer.
-23-
TVX Reference Manual 2/25/86
*** Can't: R/O
File beginning is illegal when the file is read only.
*** Compacting buffer
Information message. Displayed when TVX is compacting the
buffer. The compaction process may take several seconds.
*** Compacting done
Information. The compaction is complete.
*** Compactor lost: quit now!
An internal error has been discovered. Exit TVX immediately, and
preserve the backup copy. Try the session again.
*** Create? (y/n)
The file name specified does not exist. A y answer will cause
the file to be created. A n answer will allow the file name to be
respecified.
*** Error reopening
Something has gone wrong with the 'File beginning' command.
Exit, and try editing the file again. Be careful since an empty file
may have been created.
*** File only part read
There was not enough room in the save buffer to hold the entire
external file specified in the 'merge' command. Try re-editing using
the 's' big buffer switch.
*** Line no longer there
Return to noted location can't work because the noted line has
been deleted.
*** lines filled
TVX has run out of room to add more lines. Use the 'write
buffer' or 'file beginning' command to get more space for new lines.
*** no get room
There is not enough room in the text buffer to insert all the
text in the save buffer. Use the 'file begin' or 'write buffer'
commands, and try again. The '-^W' command is often useful.
*** no more lines for insert
See "lines filled".
*** no nesting
TVX does not allow nested repeat loops: "<<..>>".
*** no save room
There is not enough room left to save any more text in the save
buffer. Try saving smaller blocks, or use the 'file begin' command to
get more space.
*** No more free lines for insert
The maximum number of lines have been used. Write the buffer
before inserting more new lines.
-24-
TVX Reference Manual 2/25/86
*** not found
The current find pattern was not found.
*** Not a valid rpt buff
The current line does not contain a valid repeat loop for the ^R
restore command to use.
*** reading file...
Displayed while TVX is reading in the file.
*** rename fails
Something has gone wrong with the 'File beginning' or 'quit'
commands. On timeshared systems, this may mean you didn't have write
capability for the file. The work file will probably be retained, and
can be manually renamed or copied using standard operating system
commands.
*** search fails
A cross-buffer search has failed to find pattern.
*** Save buffer empty!
Tried to write to a file when save buffer empty.
*** Unable to open external file
An invalid name was specified.
*** Unable to open yank file
An invalid name was specified.
*** writing buffer
Displayed when the buffer is being written out.
*** writing partial buffer
Partial buffer only, as caused by the '-^W' command.
*** Yank filename:
Enter the name of the file you want to read into the save
buffer.
*** 100 chars only
At most, 100 characters are allowed in each find pattern and each
repeat loop.
*** <> not complete
The repeat loop has terminated before the specified number times
have been executed. This is usually what you wanted, and can be
caused by failing to find a pattern, or reaching the end of the
buffer. An invalid command or other error will also cause a repeat
loop to terminate.
-25-
TVX Reference Manual 2/25/86
*** TTY MODE ***
Normally, TVX is uses as a full screen editor. It will work on
dumb crt terminals or on hard copy terminals, however. The alternate
mode of operation is called tty mode. Tty mode is also useful for
terminals hooked up with slow baud rates. Almost all TVX commands are
supported in tty mode. The main difference is that the editor no
longer operates in a what you see is what you get mode.
When TVX is first started in tty mode (either by the -t command
line switch, or using 1:t), it will display a 'tvx>' prompt. The
normal mnemonic commands are then entered on the input line. The
input line is terminated by a <return> (which is not sent as a
command). Each letter on the input line will be interpreted as a TVX
command. Thus, entering a line: 'dddr' would move the cursor 3 lines
down and one character right. The result of the commands will not be
displayed however.
The 'V' verify command operates specially for tty mode, and is
used to type out lines of the file. The normal procedure, then is to
enter commands on the command input line, then enter appropriate 'V'
commands to display relevant lines of the buffer.
As long as normal TVX commands are entered, the command line
prompt is 'tvx>', and the terminating <return> sends commands to TVX
to execute. In insert, find, and repeat, the prompt will change to
'+'. All text entered, including <return>'s is entered into the text,
the find pattern, or the repeat loop buffer. An Escape ends the
command, and an additional <return> sends the line to TVX.
Why is tty mode included in TVX? The earliest versions of TVX
had tty mode because there were a lot of TI Silent-700's around used
at 300 baud. No longer. One reason is that tty mode provides an
interface useful to visually handicapped users. The other is that it
is useful for certain things not possible in visual mode. For
example, suppose you wanted to see every line in a file containing a
certain pattern. Tty mode is useful for this. Enter tty mode (1:t),
then enter the following loop after the 'tvx>' prompt:
1000<fpattern$vd>$$
This command will find the pattern, print the line, and go to the next
line to search again. Failure on the last find will exit the loop.
There are no doubt other subtle tricks like this that tty mode can be
used for.
-26-
TVX Reference Manual 2/25/86
*** INSTALLATION OF TVX ***
If you have the C source code of TVX, this section has some notes
you should find useful if you recompile the code to customize TVX for
your system. It should also be helpful if you are installing TVX on a
new system. If you are just a user, then you can ignore this
section.
*** General Comments ***
TVX has been designed to be portable. It has had versions
running under CP/M-80, MS-DOS, GEMDOS, RT-11, RSX-11, VMS, and Unix
BSD 4.2. The heart of TVX portability is the terminal driver. For
dedicated systems, the control codes used by a specific terminal are
hard wired into C global variables and a terminal specific version is
compiled. It has been customary to give a unique name to each
different version such as TVV for a VT-52 version, TVT for a televideo
version, etc. The Unix 4.2 BSD version of TVX has been written to
take advantage of the TERMCAP library usually provided, and is thus
terminal independent.
Since terminals differ widely, TVX tries to update the screen as
best as possible using the control codes available. The minimum set
of control sequences required by TVX include direct x-y cursor
positioning, and erase from cursor to the end of the current line.
Almost all terminals have at least these two controls. The only known
terminal widely available that does not have both of these is the
ADM-3a. Thus, TVX will NOT work on ADM-3a's. Another desirable
control sequence is the ability to insert a blank line at the top of
the screen (reverse scroll). This allows TVX to scroll rather than
jump from one screen to the next. However, TVX will perform
adequately even on terminals with only x-y and erase to end of line.
It has also been found that TVX does not always work on terminals with
multiple pages of screen data. The scroll bottom line command usually
fails.
*** Quick and Dirty Porting ***
It should be very simple to port TVX to a new machine for a
pecific terminal. The only "hard" part comes when trying to use a
package like TERMCAP. Then, the 4.2 Unix code can serve as a guide.
In effect, what that code does is get the screen controls and patch
the regular TVX screen control locations.
Typically, however, it should be almost trivial (assuming a
fairly standard C implementation - the current code compiles unchanged
on 4 different C compilers) to generate a version of TVX for a
specific terminal. The main steps:
1. Define the control codes for the terminal. These are
explained in some detail in the manual.
2. Fix file I/O calls. This may take no changes at all. The
main issue has been the mode argument to fopen. TVX likes to get the
file raw - with NO end of line handling by the C I/O system. These
-27-
TVX Reference Manual 2/25/86
things are identified by #define's in tvx_defs.ic. The other issue is
what is the end of line character. Unix likes LF only, while MS-DOS
and descendants like CR/LF (actually DEC RT-11 descendants). The
#define FILELF and NEWLINE handle this.
3. The last issue is getting characters to and from the
terminal. These are isolated in tvx_io.c. The critical routines:
ttrd() [ and ttrd_() ]: This reads one character (ANY possible
character, except possible ^S and ^Q) from the terminal, UNECHOED.
The routine ttinit is called to possibly initialize things, and ttclos
at the end to undo whatever ttinit did.
ttwt() and ttwtln(): These are used to send characters to the
screen. ttwt sends a single character, immediately and unbuffered.
ttwtln can be based on ttwt, but is provided and used whenever a chunk
is available to write. This is essential on busy time shared
systems.
That's really the only problem areas. One good thing to do when
porting is to find all the uses of #ifdef (and #ifndef) for the
implementations described: MSDOS, UNIX, GEMDOS. Those certainly
identify the areas most likely to be different on your system.
Note that the Microsoft C compiler for MS-DOS is slightly brain
damaged - the arguments to rename in its library are backwards from
the rest of the world.
*** Source Files Supplied ***
The following files are included in most distributions:
TVX_1.C - main part of code (part 1)
TVX_2.C - main part of code (part 2)
These two files are mostly os and terminal independent.
TVX_EDIT.C - The main heart of the command parser. Isolated to
make generating new emulators easy. When generating
a new emulator, only TVX_EDIT and TVX_LEX need to
be recompiled.
TVX_LEX.C - defaults, some os dependent stuff in here. Major
changes in defaults can be fixed by recompiling this file.
TVX_IO.C - almost all I/O, including screen, confined to this file.
TVX_LIB.C - misc library routines needed by TVX.
TVX_IBM.C - IBM-PC specific code, specifically the screen driver
(TVX_IBM.ASM - hand optimized version of TVX_IBM.C)
TVX_UNIX.C - contains unix specific code, including termcap driver
TVX_DEFS.IC - #define's for version, os, terminal, defaults
TVX_GLBL.IC - global data structures
TVX_TERM.IC - definitions for various terminals and systems
TVX_CFG.C - used to build CONFIG.TVX file for -c switch
TVX_PTCH.C - MS-DOS versions only - used to permanently apply
config settings to TVX.EXE.
TVX_MAKE.BAT - MS-DOS Batch file to build TVX using cii c-86.
-28-
TVX Reference Manual 2/25/86
TVX_MAKE.UNX - Unix Makefile to make on unix.
TVX_REF.DOC - This file, preformatted for printing on a "standard"
printer - 80 columns by 66 lines.
TVX_TUT.DOC - A novice user tutorial for using Standard TVX.
xxx.ref - a quick reference card for given version of TVX.
*** Screen Driver and Control Sequences ***
The actual codes used by TVX to update the screen are global
variables in the 'tvx_glbl.ic' file. Using the '#ifdef EXTERN' trick
described in that file, the screen variables (plus most other relevant
global variables) are included as external references. The actual
definitions for a given terminal are included in a file called
'tvx_term.ic'. Several sample definitions are included in the
distribution code. A description of each relevant variable follows:
** X-Y Cursor Addressing
int addx - amount to add to internal x position get terminal's x
value. Terminals typically encode x-y as a single printable
character, thus requiring the addition of a blank to make x-y
printable. Since TVX uses a 1,1 origin, this value will commonly be
31.
int addy - same as addx, but for y position.
char cxychr - true (1) if convert xy binary representation to ascii
string.
char cxy1st - 'l' if line coordinate first, 'c' if column first.
char cxybeg[8], char cxymid[8], char cxyend[8] - The x-y cursor
control sequence usually takes one of two forms: <control><x><y> or
<control><x><middle><y><end>. The x and y may be reversed. These
three arrays are used to send the proper control sequence for xy
positioning.
*** Other control sequences
char cversn[12] - a version string to identify terminal.
char cerrbg[8], char cerred[8] - sequences sent when an error message
sent to terminal's last line. Note that cerrbe is sent BEFORE the
cursor is moved to the last line, and cerred is sent before the cursor
is returned to the original position. Some terminals give problems if
a highlight sequence is sent before a cursor positioning sequence. A
bell is usually safe for most versions.
char ctopb[8] - This sequence should insert a blank line when the
cursor is at the top left corner. It is often called reverse line
feed. A command to insert a line usually performs the same function,
but some terminals don't have both.
-29-
TVX Reference Manual 2/25/86
char cinit[20], char cendit[20] - these sequences are sent to
initialize and reset the terminal.
char cbotb[8] - this sequence scrolls the screen up one line when the
cursor is on the last line. Line feed works for any terminal
encountered to date.
char celin[8] - Erase from cursor to end of line. This sequence is
required for operation of TVX.
char cescr[8] - Erase from cursor to end of screen. If the terminal
doesn't have this, it is simulated using multiple celins.
char ccsrcm[8], char ccsrin[8] - These are used to change the cursor
from command mode to insert mode. Many terminals do not support a
method of changing the cursor shape. These have been also been used
to change the screen from normal to reverse video and back.
char ciline[8] - Insert a blank line. A blank line is inserted on the
line the cursor is on. If available, it can be used for ctopb, too.
char ckline[8] - Kill a line. The line the cursor is on is deleted,
and the following text scrolled up.
char cundlb[8], cundle[8] - TVX has the capability to optionally
support bold and underline for some text processors. For example, a
^U can be used to toggle underscore. This is only useful for a text
formatter that can recognize such a sequence.
char cboldb[8], char cbolde[8] - Similar to undlb, but boldface.
*** Default settings
int ddline - default display line. This sets which line is the
default home display line. For scrolling versions (dscrl != 0), right
in the middle is a good place. For fixed cursor line versions,
something below the middle seems better (like 16 for 24 line
screens).
int dscrl - default scroll lines. If this is non-zero, the cursor
will move up and down lines on the screen with cursor movement
commands. This requires a bit less screen update overhead, and is
better for slower time shared systems. If it is zero, the cursor will
remain fixed on ddline, and text will scroll on and off the screen as
needed. Both these are resettable with the : command.
int dxcase - default search case. 0 means find is case insensitive, 1
means find must match exact case.
int usecz - MS-DOS versions only. If 1, TVX will put a Control-Z end
of file mark in the file (this is CP/M compatible). If 0, TVX uses
MS-DOS end of file conventions.
int autoin - TRUE (1) if auto indent, FALSE (0) otherwise.
-30-
TVX Reference Manual 2/25/86
int logdef - Create backup log file by default? 0->no, 1-> yes.
char wildch - The character used as a wild card in finds.
char delkey - the delete character key, usually backspace.
int tvhardlines - number of physical lines on screen.
int tvlins - number of lines on virtual screen. Initially should be
same value as tvhardlines.
int tvcols - number of columns on screen. If the terminal wraps new
text to the next line rather than discarding characters after the last
column, then tvcols must be set to 1 less than the true width of the
terminal.
int isibmpc - TRUE (1) if this version uses the custom IBM-PC screen
driver. FALSE (0) if uses regular terminal output code.
char synofr[20], char synoto[20] - These are used to map commands.
The synofr contains commands to be aliased to the corresponding
command in the synoto table. For example, the '[' and '{' keys are
often reversed on some terminals. Making '[' in synofr a synonym to
'{' in synoto will make the two commands the same.
char funkey - If the terminal has function keys, they can be supported
by TVX by setting this variable to the first code sent by the function
key, usually ESCAPE. TVX supports only two code sequences for
function keys.
char funchar[50] - this is the second code sent by a function key.
char funcmd[50] - this is the equivalent command a given function key
will be mapped to. Similar to synofr and synoto.
*** #define options
The file 'tvx_defs.ic' has many #define statements that can be
used to customize TVX for particular installations. Ideally, the
source for TVX should be maintained as one set, and differences
between versions handled by #defines. Most #defines are explained in
the source code, but a few deserve a few extra comments, and are
summarized below.
#define VERSION " - TVX (7/1/85) - " - This defines the version of
TVX. Any time a modification is made, the VERSION define should be
updated.
#define VB - whether or not to create backup log version or not. This
does NOT imply the file "backup.log" will be used automatically (see
variable logdef), simply that the code is included.
#define ULBD - If defined, TVX supports underline, bold in ^U, ^B
format.
-31-
TVX Reference Manual 2/25/86
#define BACKUPNAME - This defines the name of the backup log file, if
used.
#define BUFFLIMIT - This defines how much space is saved in the text
buffer when reading in a file. This determines how much space is
reserved for saving text with the 'S' command, and how much is left
over for new inserts. Smaller values allow more text from the file to
be read, larger values allow more text to be saved. The '-s' switch
at runtime increases this value.
#define FILEREAD, #define FILEWRITE - These define the string used for
file mode in the fopen() calls. Unix and MS-DOS versions are not
typically exactly compatible, as most MS-DOS C's allow a different
mode to handle the CR/LF problem.
#define FNAMESIZE - maximum length of file names.
#define INT16 - If #defined, then the normal C int is 16 bits long.
This changes the way memory status is displayed.
#define LINELIMIT - Like BUFFLIMIT, only number of lines.
#define MAXBUFF - Defines maximum number of characters allocated to
text buffer. Malloc() is used to get the space from the runtime
system. It is possible less than MAXBUFF will be available. The
maximum allowed for any given system must be less than the maximum
value represented by an unsigned int. If MAXBUFF is very large, there
get to be a noticeable initialization delay.
#define MAXLINE - This determines the maximum number of lines
allocated per buffer. It is related to MAXBUFF.
#define REPEATBUFS - defines how many repeat buffers are allocated.
If space is a problem, allocate fewer repeat buffers.
#define USELF - This symbol should be defined if the terminal needs a
line feed character after each carriage return. Almost always true.
#define FILELF - This symbol is defined if text files use a CR/LF
combination. It causes a NEWLINE/LF to be written to files.
#define NEWLINE - This defines the actual character used as a new line
in files. On CR/LF systems, it should be a CR (13). On systems like
Unix with a single new line separator, it should be that character
(LF).
#define USECTRLZ - defined if the code for handling a Control-Z and
end of file mark should be used.
#define NEEDTVLIB - define this if the standard C library provided
doesn't have the routine in TVX_LIB.
#define HELP - Define this if help should be supported. The help
routine uses significant space, which can be saved if help isn't
compiled in.
-32-
TVX Reference Manual 2/25/86
#define CONFIGFILE - define this if support for the '-c' switch is
desired.
**** MS-DOS Notes ***
TVX can be built as a generic MS-DOS version and as an IBM-PC
specific version. The MS-DOS version uses the standard DOS character
output routines. Thus, it could use the ANSI.SYS driver, but it would
run very slowly then. The IBM-PC version has a custom screen driver
that calls the ROM BIOS directly, and is very fast. Even more speed
can be had by optimizing the output assembly code (the sysint
overhead). The definitions for and IBMPC included in "tvx_term.ic"
also define the keypad keys to work in a predictable manner.
*** Unix Notes ***
The usual Unix version will be the TERMCAP version. That version
works very well, but is not in all cases optimal for a given
terminal. It might be desirable to build a specific version for the
terminal you use most often. Most notably, the TERMCAP version does
not know about cursor shapes or other control sequences to distinguish
command mode from insert mode. Also, it sets tvcols to one less than
the true value to avoid wrapping problems. The termcap version also
only sends a bell for the error message.
-33-
TVX Reference Manual 2/25/86
*** TVX File Usage ***
TVX uses four logical files: the original file, the destination
file, a work file, and the source file. The original file and the
destination file are not touched until a normal exit from TVX.
The source file is the current copy of the file providing text to
be entered. When TVX is first started, the source file and the
original file are the same. The work file is used to hold the edited
output file.
When the '^B' file beginning command is issued, the remainder of
the source input file is written to the work output file. The work
file then becomes the new source file, and a new work file is
created. Thus, it is possible to have four copies of a file around:
The .BAK backup copy of the original file, the original copy of the
file, the copy of the source file, and the (partially written) work
file. Under normal operation, there will only be two copies: the
source file (which is really the original file) and the possibly
partially written work file. Only by using the '^B' commands can 3
copies of the file exist.
When you issue the normal '^X' exit command, the following
actions take place: Any old .BAK files are deleted. The original file
is renamed to be the new .BAK version. If the source file is
different than the original file, it will be deleted. The work file
is then renamed to be the destination file. If you don't have write
access to the directory with the original file, then the original file
and the work file will not be renamed. A message to that effect will
be printed. The normal operating system copy and rename commands can
be used to recover the work file, which contains the edits made to
date.
-34-
TVX Reference Manual 2/25/86
*** Standard Quick Reference Summary ***
TVX Commands (n => count allowed)
nA Append lines B Buffer beginning
^B File beginning nC Change chars
nD Down line n^D Down column
E Buffer end n^E Edit repeat buffer
nF Find pattern ^F Find across buffs
G Get save buffer ^G Unkill last line
nH Half page nI Insert (till $)
J Jump back nK Kill character
n^K Kill line nL Left
M Memory status nN Note location
n^N Reset location nO Open blank line
^O Operating system nP Page
^P Print screen nR Right
^R Restore edited buffer nS Save lines
nT Tidy (fill text) ^T Abort session
nU Up n^U Up column
V Verify n^W Write buff
^X Exit, end session n^Y Yank to(-n)/from(+n) file
nBS Delete prev. char. n; Find again
/ Delete last thing = Change last thing
' Del to line beginning " Delete to line end
, Line beginning . Line end
nTAB Word right n{ Word left
n<>$$ Repeat loop n& Repeat again
n#k Execute repeat buffer k n times
? Help @ Invoke cmd file
* Insert pat found last n~ Toggle case
$ Escape - end insert, find, repeat
n:p Set parameter p
Possible parameters:
A - Autoindent (1=y,0=n) D - display line
E - Expand tabs to n spaces F - find case (0=exact,1=any)
M - Match wild cards O - set output file name
S - scroll window R - repeat buffer to use
T - tty mode U - define user wild card set
V - virtual window W - autowrap width
C - cut mode
Usage: tvx filename [-b -i -l -o=f -r -s -t -w -# {-z -c=f}]
-[no]b : backup file -[no]i : autoindent
-[no]l : make command log file -t : tty mode
-o=outputfile -r : read only
-s : big save buff -[no]w : word processing mode
-# : set virtual window lines to #
On MS-DOS versions:
-[no]z : use control-z for end of file
-c=configfile -c : use /bin/config.tvx
-35-
TVX Reference Manual 2/25/86
VIX - A vi-like editor based on TVX
Vix is an extension to tvx that provides a close emulation of the
Unix editor vi. While the majority of the common commands are
identical, there are some inherent differences in the way tvx and vi
treat text. Most of the commands were implemented directly using the
TVX equivalent, although some commands were required new code. If the
vi command could not be implemented, its command letter was left
unused, and will produce an error message.
Vix does not have the underlying ex editor, so none of the escape
to ex commands work. Vix does have the TVX repeat loop, however, and
this compensates to a great extent for the need for ex features.
Please consult the TVX manual for examples of using the repeat loop.
Note that when using the repeat loop with vix, the commands will be
vix commands and not tvx commands.
Another significant difference is that tvx (and thus vix) treats
the end of line character as just another character. Thus cursor
movement commands move over the end of line in a fashion one would
expect. However, when one moves to the end of the line, the cursor is
placed 'over' the newline (displayed after the last real character in
the line). This makes the '$' command work somewhat differently.
This also means that you can include a <return> in a search pattern.
Vix and tvx use ESCAPE to end the search pattern instead of <return>.
Vi uses the ':' command to read and write the file (among other
things). Vix uses the ':' to set operating parameters such as
autoindent, screen size, etc. The 'ZZ' (or 'ZA' to abort without
changes) command is used by vix to exit.
Unlike vi and ex, tvx and vix try to load the entire file being
edited into memory (called the buffer by tvx/vix, as opposed to the
yank or save buffer). If the entire file doesn't fit, the user must
manually 'page' the file in and out of memory manually. Most of the
'q' ("tvx" prefix) commands are supplied to handle buffer
manipulation. For more details, consult the TVX manual. TVX/vix also
uses the concept of the "last thing" as a major editing tool.
Whenever you find a pattern, skip over a word with b or w, save text
into the save buffer with the 'y' or 'Y' commands, or put text from
the save buffer, that text is considered the "last thing". The 'c/'
and 'd/' commands will delete the last thing. Entering a new command
will forget what the last thing was until you again enter a "last
thing" command.
-36-
TVX Reference Manual 2/25/86
The available vix commands are summarized below. The first
column of each entry has a character noting similarities and
differences with the real vi commands in the following fashion:
- means present in vi, not implemented in vix.