TEACL is a fork of TECOC created for the purpose of describing diffs in a document being collaboratively edited
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

145 lines
3.9 KiB

7 years ago
  1. Introduction to using tecoc
  2. Evocation
  3. ---------
  4. As stated in BUILD.txt, tecoc can either be executed directly, or a
  5. file link can be created, or a batch file or shell script can be
  6. created. For example, if you want to edit a file name MyFile.txt,
  7. if you have a link setup like:
  8. teco -> tecoc
  9. then you could execute:
  10. teco MyFile.txt
  11. However, if you want to run tecoc directly, you'd have to do:
  12. tecoc teco MyFile.txt
  13. The extra, and first, argument, "teco", tells tecoc what mode to run
  14. under. The remainder of this document will assume you have the link
  15. setup.
  16. If you have video mode configured, tecoc nevertheless starts in non-video
  17. mode by default. To start tecoc in video mode you could do:
  18. teco -scroll:5 MyFile.txt
  19. This would make the bottom 5 lines used for commands, and the remaining
  20. lines above to be the video display area.
  21. Additionally, video mode can be turned on or off while editing a file,
  22. regardless of the startup parameters. See "video.txt"
  23. Importantly, the command to save the file and exit is:
  24. EX followed by two escape key presses
  25. To exit the edit session without saving, do:
  26. -1EX followed by two escape key presses
  27. Commands
  28. --------
  29. Teco is a character based editor. This means that teco keeps track of
  30. what character you are at, and not what line you are on. One normally
  31. edits a file by positioning the point and editing there.
  32. The "$" character functions as the "escape key". A single $ is used
  33. to separate multiple commands. Two consecutive escapes, $$, cause
  34. teco to execute all of the commands up to that point.
  35. Other characters, besides $, each have a meaning to teco. Some
  36. commands consist of more than one character. Teco commands are
  37. case-insensitive. This means that "m" and "M" mean the same thing.
  38. In this text I will show the commands in uppercase simply to avoid
  39. confusion between such letters as ell and one.
  40. For example, the "L" command causes teco to move its pointer to the
  41. following line. If you type "L", nothing happens until you tell teco
  42. to execute is by following the "L" with "$$". So,
  43. L$$
  44. will cause teco to go to the next line.
  45. You may have any number of commands specified before executing them,
  46. for example:
  47. LLL$$
  48. will go down three lines.
  49. Also, commands may take numeric arguments. For example,
  50. 3L$$
  51. will go down 3 lines.
  52. Commands may also be negative, so the following:
  53. -4L$$
  54. will cause teco to go up 4 lines. Also, since the default argument is one,
  55. -L$$
  56. is the same as -1L$$
  57. In video mode, you will see the changes occur as soon as you execute $$.
  58. In non-video mode, you see nothing unless you ask teco to display a
  59. portion of the text. For example, if you type:
  60. V$$
  61. you will see the line you are on.
  62. The current character position is always available vie the "." command.
  63. There is also the "=" command that causes teco to display a value, thus:
  64. .=$$
  65. causes teco to display the current character position.
  66. Teco has many, many powerful commands. It has loops, conditionals,
  67. variables, etc.. Each letter has a different function. See the
  68. included documentation.
  69. Macros
  70. ------
  71. A series of commands, since they are only letters, may be entered into
  72. a text file. A user may tell teco to read and execute the commands in
  73. one of those files. The name associated to that set of commands is the name of
  74. the file they are located in (minus the .tec extension). The command
  75. used to execute a macro file is "EI", thus, for example, if you have a
  76. macro file named "ab.tec" located in the TEC_LIBRARY directory,
  77. executing:
  78. EIab$$
  79. will cause teco to execute the commands located in that file.
  80. In this example, the command is "EI". It takes a trailing string argument
  81. "ab", and the "$$" means execute it.
  82. Moving On
  83. ---------
  84. To learn more, I suggest you read the following, included, documents in
  85. the order shown:
  86. Summary.pdf
  87. blake-notes.txt
  88. teco-manual.txt
  89. wchart.txt
  90. Many of the other documentation files are either historical or provide
  91. greater, tecoc specific, information.