Configuration
TDE uses three external files: tde.cfg, tde.hlp and
tde.shl (in UNIX the dot is at the front). These files are
read from the home directory (the global file) and/or the current
directory (the local file). The home directory is determined by the
environment variables TDEHOME or HOME, or the same path as
TDE itself, whichever exists first (however, in order for HOME
to be used in DOS or Windows, tde.cfg must already exist in
it). The default tde.cfg and tde.hlp files can be found in the
config directory (without any dot for UNIX); the default
tde.shl is called tdedist.shl in the source distribution (its
tde.shl includes TDE's own highlighting).
- tde.cfg
-
This file defines what key performs what function (including macros) and the
initial state of the editor (mode settings and colors). It can also define
upper and lower case letters and the sort sequence. Please see the default file
for more information. It is loaded globally first and then locally (i.e. both
locations, not one or the other).
- tde.hlp
-
This file contains the screen(s) displayed when Help is pressed. It is
at most 50 lines, with at most 100 characters per line; any more than this will
be ignored. Lines need not be the same length, as all lines will be
space-padded to the length of the longest. Two screens are present, one for the
normal help and another for read-only files; separate the two with a
`<<<>>>' sequence. If tde.hlp doesn't exist locally it will be read
globally. A local file need only define one type of screen; the other will
still be read globally.
- tde.shl
-
This file supplies the colors used for syntax highlighting and the information
required to assign those colors to a particular file. It searches for the
language locally first and then tries globally. Note that when a local language
is found, all the patterns are prefixed with the current directory.
Syntax Highlighting
The colors always come first in the file. They are global for all languages.
Colors are defined in the same manner as in the configuration file (see
config/tde.cfg). Following are all the recognized colors, with their
default color in brackets.
background
-
The default background color for all the following (blue).
normal
-
The color for any text that is not explicitly highlighted (yellow).
bad
-
The color for invalid components, such as malformed numbers, character
literals containing too many characters, or unterminated string and character
literals (bright red).
keyword
-
The color of keywords (white).
comment
-
The color of comments (grey).
function
-
The color of function names (bright green).
string
-
The color of string literals (bright cyan).
character
-
The color of character literals (bright cyan).
integer
-
The color of numbers (in decimal, without a point; bright cyan).
binary
-
The color of binary (base 2) numbers (bright cyan).
octal
-
The color of octal (base 8) numbers (bright cyan).
hex
-
The color of hexadecimal (base 16) numbers (bright cyan).
real
-
The color of numbers with a decimal point (bright cyan).
preprocessor
-
The color of preprocessor statements (cyan).
symbol
-
The color of any non-alphanumeric that is otherwise unrecognized (white).
The language definitions follow the colors. Each definition is started with
language
and continues until the next language
or EOF.
The following keywords can be used to define a language (where `[]'
indicates an optional component and `|' indicates one or the other):
language
name [from]
parent-
Associates name with the syntax highlighting information. This is what
is used to select a particular syntax highlight (see SyntaxSelect). If
parent exists, this language will inherit all of parent's language
definitions.
pattern
wildcards-
Must follow immediately after
language
. It is a space-separated list
of wildcards to identify a language from a file's extension (or name, or even
path).
case match | ignore
-
Determines if keywords will be case sensitive or insensitive. The default is
match.
startword
listinword
listinnumber
list-
A list (or range) of characters that may start a word (or, more correctly, an
identifier), be found within a word and be found within numbers.
comment
stringcomment
string1 string2-
Indicates string will begin a line comment (stops at the end of the
line), or that string1 and string2 will begin and end a block
comment (can extend across multiple lines). Each string can be up to four
characters and there can be two of each type of comment.
function
char-
Identifiers that are followed by char (allowing for whitespace, but
not across line boundaries) are given the
function
color.
preprocessor
char2 [spanline
char]
-
Lines that begin with char2 (one or two characters) are given the
preprocessor
color. If the line ends in char, the preprocessor
will continue on the next line.
binary
char2- | -
char2octal
char2- | -
char2hex
char2- | -
char2-
Define the format of binary, octal and hexadecimal numbers. The first form
indicates a prefix (such as C's `0x123'), the second a suffix (such as
assembly's `123h').
string
c1 [
c2] [spanline
char] [newline]
character
c1 [
c2] [
num] [spanline
char] [newline]
-
Define the starting and closing characters of string and character literals.
If c2 is missing, it is taken the same as c1. spanline
indicates the literal will continue onto the next line if this line
ends in char; newline indicates that it will continue onto the
next line, regardless. num is the maximum number of characters permitted
in a character literal. The default is one; if it is zero,
character
functions identically to string
.
escape
char-
When char is encountered within a string or character literal, the
following character is skipped over.
keyword
list-
The words in list will be displayed in the
keyword
color. Note
that all of the color keywords can be used in this fashion (when list
starts with a character from startword
).
- color list
-
Use color to display the words in list.
InflateTabs
LTabSize
Macro
PseudoMacro
PTabSize
UserMenu
-
The same as the configuration file, although macros must be defined using a
two-key combination.