SciTECO - <Website> Home / Screenshots / Downloads / sciteco(1) / sciteco(7) / Wiki / Github

This documents the project's HEAD revision.

1. Tutorial
1.1. Get me out of here!
1.2. Navigation
1.3. Insertion
1.4. Deletion
1.5. Saving
1.6. Loading
1.7. Search and replace
1.8. Q-Registers
1.9. Programming
1.10. Customize
1.11. Further reading

1. Tutorial

It seems, you are launching SciTECO for the first time. SciTECO is an unique interactive text editor and programming language. This tutorial guides you through the bare essentials of the editor. Try the examples directly on this document.

1.1. Get me out of here!

To exit the editor, just type the characters ex, followed by two escape key presses. Escape key presses produce ASCII 27 characters, which are echoed as “$”. TECO commands are case-insensitive. In the remainder of this document, command examples are therefore formatted as follows:

EX$$

1.2. Navigation

To set the cursor to the next line, type the L command, which will eventually scroll the document. You should also be able to use cursor movement keys. Perhaps you can even scroll using your mouse’s scroll wheel.

To move back one line, type the B command. B is -L! C moves one character to the right and R moves in the reverse direction, i.e. one character to the left. R is -C. J jumps to the beginning of the document and ZJ to the end. Using cursor movement or mouse buttons updates the movement commands in the command line (the line at the bottom of the screen after *).

1.3. Insertion

To insert the string “Hello world!” type the following:

IHello world!$

Try pressing the backspace key repeatedly — the inserted text will vanish. This is called rubout and it works for all commands. You are not actually editing the document, but the command line. The commands are executed on the fly — you don’t have to press Enter as in all other programming language prompts. Also try pressing CTRL+W to rub out entire words or commands. While the I command may resemble Vi, SciTECO is not a modal editor. There is no “insert” mode, you are merely providing a string argument to the interactively executed I command.

1.4. Deletion

Rubout may be used to undo text insertions, but you can also explicitly delete lines using the K command. D deletes individual characters. -K deletes the previous line and -D the previous character. If you changed this document, “EX$$” will refuse to exit the editor. Use the following command instead to discard all changes:

-EX$$

1.5. Saving

You should not save any changes to this document. Instead, let’s save it to a local file (save as):

EW˜/test.txt$

If you exit now, next time you start SciTECO, this file is restored and you can continue right where you left off. To write out the current document without changing its name, just type:

EW$

Remember, you can type CTRL+W to undo even the file write and restore the previous state of the file.

1.6. Loading

To open files from your operating system’s shell, specify them after the “sciteco” command. For instance to open exactly one file on an UNIX-like system:

$ sciteco ˜/test.txt

When called this way, SciTECO does not maintain sessions, i.e. will not restore this file when started without arguments. In order to open another file from within SciTECO, try the following command:

EBnew-file.txt$

This can be an existing or new file or even be open already — you will always edit the given file afterwards. You can use the Tab key to auto-complete file names, just like in a typical UNIX shell! Of course, you can press CTRL+W to revert opening the file.

1.7. Search and replace

To search for a string beginning at the current position, try something like this:

Ssome string$

To find “some string” and replace it with “another string”, you could write:

FRsome string$another string$

If you omit either of the string arguments, the previous value is used, so S$ repeats the last search and FR$$ repeats the last search-replace operation.

1.8. Q-Registers

The equivalent of variables are called Q-registers. You can among many other things store the next 10 lines into the register “A”:

10Xa

Leave away the number to copy the next line only. Actually, most commands accept optional number arguments. To insert (get) the contents of register “A” use the command Ga. Register “˜” is the main system clipboard, so “X˜” copies into, while “G˜” pastes the clipboard. This however might not work out of the box if you are running the ncurses version of SciTECO.

1.9. Programming

SciTECO is an editor and a structured turing complete programming language. It recognizes complex control flow commands and subroutines (macros) for automating text editing tasks. This tutorial will not go into detail, but here’s an example of performing a search-replace operation on the entire buffer:

J <FRhere’s$here is$;>

1.10. Customize

If you haven’t done so already, copy the global /usr/local/bin/../share/sciteco/fallback.teco_ini to your home directory and edit it to customize SciTECO’s behavior:

$ cp /usr/local/bin/../share/sciteco/fallback.teco_ini ˜/.teco_ini
$ sciteco ˜/.teco_ini

This is a profile script in the SciTECO language, that is executed by default every time you launch SciTECO. If you made a mistake editing it and SciTECO refuses to start, you can always skip loading the profile and use SciTECO commands to fix up the profile script:

$ sciteco --no-profile

1.11. Further reading

There is a lot more to learn if you would like to become a “moby munger”. Consult or even print the official Cheat Sheet to extend your “vocabulary” of SciTECO commands:

https://sciteco.sf.net/manuals/cheat-sheet.pdf

Navigate to the beginning of the line with the URL and type to copy it into the system clipboard. For more details on the SciTECO language, consult the sciteco(7) man page. sciteco(1) documents SciTECO as an application (command-line arguments, environment variables and so on). These man pages are also available on the website in HTML format, but you can also read them right now from within SciTECO by using the “?” command. To open the language reference, type:

?language$

If you want to read the tutorial at any later time, just type ?tutorial$. You may also want to have a look at the Wiki and FAQ:

https://github.com/rhaberkorn/sciteco/wiki

If you cannot find a solution to your problem, you can of course open an Issue or Discussion on SciTECO’s Github page. We are also happy to help out on the official IRC channel: Join #sciteco at irc.libera.chat.

Merry munging!


* IThis page was made with SciTECO.$-EX$$