RED Tips, Tricks and Answers

This section lists some tips about things that you might useful. It also answers some frequently asked questions. It will be updated every now and then, so look in again later if you are interested.
Editing multiple files
When you use Red to edit multiple files at the same time, it is more efficient to use only one instance of Red. So you should start Red with multiple files as parameters (red file1 file2 file3) or use the "open" command to open further files. Avoid starting Red more than once. (It is not really a problem, but a waste of resources.)

goto-line
The function key F5 call goto-line, to set the cursor to a specified line number. F6 is show-line-number (display the current line number).

What does this key do?
Pressing Alt-D and then any key tells you (via a message in the information area) what that key does.

What are these .~ files?
After using Red, you will find some files with names ending in .~ in your directory. These are backup files that Red automatically generates. The backup always contains the version of the file from the time you started Red. They can be used to go back to an earlier version in case of a problem. If you need to use them, rename them first, and then go on editing normally. You can switch off the generation of backup files in the preferences settings.

Improved key bindings
The normal settings of TAB and Backspace keys are sometimes not optimal for programming. TAB indentation by eight characters is often too much for indentation in programs. The Backspace key is often expected to go back by one character - this does not happen if the character left to the cursor is a TAB character. Then the cursor jumps back all the way to the beginning of the TAB.

These nuisances can be overcome by using half-tab and backward-delete-untab instead.

I suggest to change your key bindings to the following:

Backspace and Ctrl-Left call backward-delete-untab
Ctrl-Backspace calls backward-delete-char
Tab calls half-tab
Ctrl-Tab calls tab-to-tab-stop
How do I select a large region of text?
Of course, you can select with the mouse. If the area you want to select is very large, this can be slow. Then there is select-all (by default on Alt-a) to select the whole text. But what if you want to select a large region which is not the whole text? You can do the following: Note: The functions "beginning-of-text" and "end-of-text" (keys: Home and End) automatically set the mark. So the sequence can be used to select from the cursor position to the end of the text.


Main index