Next: , Previous: Overview, Up: Top


Usage

The general format for running TDE is:

     tde [-v] [-i config] [-w [workspace]]
         [options] [filename(s)] [options] [-f|F|g|G[=] pattern filename(s)]

Everything is optional — running without any parameters will either bring up a prompt to load a filename (or display the directory list for a pattern), or automatically load the workspace if tde.wsp is present in the current directory (.tdewsp in UNIX). The three options -v, -i and -w must be first, but can appear in any order amongst themselves.

-v
Enter viewer mode, where every file is loaded read-only.
-i
Read the specified configuration file (after reading the global and local files; see Configuration).
-w
If this is used by itself, TDE will load the workspace from its home directory; if it doesn't exist the usual prompt is displayed. If workspace is present, but no other options, TDE will load the given workspace. When used with other options, TDE will load as normal, using workspace as the filename of the workspace.
-f
-F
-g
-G
These options cause TDE to search files for pattern. The lower case letter will ignore case, whilst the upper case letter will match it. F will perform a text-based search; G will perform a regular expression search. The normal operation is to load the first matching file, positioned at the first match; adding = immediately after the letter will instead create a window containing the matching lines from all files. If a directory is specified all files in that directory will be searched.

Filenames (and directories) can include wildcards (see DirList, see DefineGrep). If a directory is specified, the directory list will be brought up for it.

Options begin with either - or +. An option starting with - will apply to all following files; an option starting with + will apply to only one file. A lower case option letter will apply to the file(s) coming after it; an upper case letter will apply to the file before it (and possibly those after it). For options that apply to following files, the normal behavior can be restored by adding - after the letter.

a
Usually files are only loaded into the editor at the request of the user (by closing the current file or explicitly loading the next); this option will load all files into the editor immediately.
b[n]
b!
Load files as binary, using n as the line length (default is 64); if n is zero, force loading files as text; if n is negative, load text files as normal and use the positive value of n as the line length for binary files (without prompting). Alternatively, skip binary files altogether.
c title
Name the window title; use `.' for the filename (which won't be split like it usually is). This option always applies to only one file.
e macro
Execute macro after loading each file. If macro refers to an existing file, it will be read as a macro file.
l[lang]
If lang is absent, syntax highlighting will be disabled; otherwise it will be used as the language, overriding the filename test.
n
Create a new (scratch) window.
r
Load files as read-only.
s
Set the scratch flag for files.
t[n]
Use a physical tab size of n (default is 8; 0 will deflate tabs).
[line][:col]
Start at the specified position. If line is negative it will be taken from the end of the file (i.e. `-1' is the last line, `-2' is the second last, etc.). If col is negative it will be taken from the end of the line (i.e. `0' is EOL, `-1' is the last character, `-2' is the second last, etc.). This option always applies to only one file — start with + for the next file, - for the previous (sic).
+offset
Move to the specified offset (prefix with `0x' for hexadecimal) in the file. It can be used with text files, but offset is not the same as the file offset, since line endings are not counted. This option always applies to only one file, as above.

There are also a number of help options. These options must be the only argument present.

/?
-?
--help
Display a (long) help screen, including version and contact information.
--version
Just display the current version and release date.
-g?
-G?
Display the regular expression help screen.
-??
Display the wildcard help screen.

Finally, TDE can be used as a filter, where it reads from standard input and writes to standard output. In this instance, input is treated as an implicit (scratch) file after the command, so it is always read first and the upper case version of options is required.

Examples

     tde -b file1 -b- file2
     tde file1 +B file2

Both load file1 as binary (using the default line length of 64) and auto-detect the type of file2.

     dir | tde >dir.lst

Pipe the output of dir into TDE and save its output into dir.lst.

     unzip -c tde51ss | tdv -Lc

View TDE's source using C syntax highlighting (tdv is equivalent to `tde -v').

     tde -lpascal file.c file.bat -l file.for -l- file.cbl

This will load file.c and file.bat using Pascal syntax highlighting, disable syntax highlighting for file.for and use the filename to determine if file.cbl should have it.

     tdv -b! ...

View every text file in the current directory and all subdirectories.

     tde -F s_output .;[dwu]*/*.[ch]

Do a case-sensitive, text-based search for `s_output', in all the .c and .h files in the current directory and the subdirectories starting with d, w and u. UNIX users can use `:' instead of `;'.

     tde -e "JumpToPosition \"-1:0\" Rturn LineDown BottomLine LineUp" file

Load file, moving to EOL of the last line, with EOF at the bottom of the window.