fte allows each file extension to have a different editing mode. Mode is a collection of editor settings such as keybindings, tab settings, autoindent settings, syntax highlighting,...

Syntax of mode command is

mode NAME { mode settings }
mode NAME: PARENT { mode settings }

Mode with name NAMEinherits settings from mode PARENT if parent mode is specified at mode declaration.

When editor is searching for a mode to use for a file it will first check if the mode has been overriden by a FileOpenInMode command or a command line option (-m).

Then it will check if the file name matches FileNameRx defined in mode declarations.

If the mode has still not been found, it will read the first line (max 80 chars) of the file, and attempt to match the FirstLineRx with the first line.

If this fails, the editor will use mode specified by DefaultModeName global setting to load a file. If that mode does not exist, first mode defined in the configuration file will be used.

Mode Settings

The following settings can be specified for each mode:



Should be set to 1 if tabs are to be expanded when displayed. Use ToggleExpandTabs command to toggle during editing.



Tab size when tabs are shown expanded on display.



Should be set to 1 if autoindent is to be used. Use ToggleAutoIndent command to toggle it on/off during editing.



If set to 1, Insert mode is active by default. If set to 0, Overwrite mode is active by default.

Use ToggleInsert command to toggle it on/off during editing.


{ASCII code/-1}

This characted will be stripped if it is found the end of any line when the file is being loaded. If it is set to -1, no characted will be stripped.

Usually used to strip 13 (CR) characters from DOS text files.


{ASCII code/-1}

This character is used as a line separator when loading a file. If set to -1, there is no line separator. (WARNING: File will be loaded as one line if LineChar is set to -1).

Usually set to 10 (LF) as standard text file line separator.



If set to 1, CR (13, \r) character will be added to end of line when saving.



If set to 1, LF (10, \n) characted will be added to end if line when saving.



Normally, when saving, the last line is saved without any CR/LF characters. This setting will override that behaviour.



If set to 1, syntax highliting will be active.



If set to 1, tabs will be visible as circles (EPM-like).



Activates the specified smart indent mode. (PLAIN mode specifies no smart audoindenting, just normal autoindent).


Specifies a previously declared colorize mode to use for syntax highlighting in this editing mode.


Specify the name of existing eventmap to use for current mode.



Limit undo to this many recent commands (-1 = unlimited)



If set to 1, all cursor movements will be recorded on undo stack.



If set to 0, backup files will be deleted after a successful save operation.



If set to 0, searches will be case insensitive. This can be toggled via ToggleMatchCase command when editor is running.



If set to 1, BackSpace will kill entire tabs instead of converting them to spaces.



If set to 1, Delete will kill entire tabs instead of converting them to spaces.



If set to 1, BackSpace will unindent to previous indentation level if issued on beginning of line.



If set to 1, InsertTab command will insert spaces instead of tabs.



If set to 1, indentation will be done using tabs instead of spaces.



If set to 1, editor wrap current line when right margin is reached. If set to 2, editor will wrap current paragraph continously. Paragraphs as recognised by WrapPara command must be separated by blank lines.



Left margin for word wrap (WrapPara command).



Right margin for word wrap (WrapPara command).



If set to 1, spaces on the end of line will be trimmed when editing.



If set to 1, end of line and end of file markers will be shown.



If set to 1, editor will allow cursor to be positioned inside tabs.



Default search options for Find command.



Default search/replace options for FindReplace command.



If 0, folds are not saved. If 1, folds are saved at beginning of line, if 2 folds are saved at end of line.

Folds are saved as comments in source files, depending on active editing mode.

See mode settings CommentStart and CommentEnd for configuration of fold comments.



String that starts comments (for saving folds)



String that ends comments



If set to 1, editor will automatically highlight the matching bracket if it is visible on screen. This is equivalent to executing HilitMatchBracket command.



If set to 1, abbreviation expansion will be active in this mode.



If set to 1, BackSpace command will delete block if it is marked, otherwise it will delete the previous character.



If set to 1, Delete command will delete block if marked, instead of deleting the character below cursor.



If set to 1, blocks will stay marked even if cursor is moved in the file, if set to 0, block is unmarked as soon as the cursor is moved.



If set to 1, the marked block is deleted when a new character is typed.



Must be set to regexp that matches names of files that should be edited in this mode. Has priority over FirstLineRx



Must be set to regex that matches the first line of files that should be edited in this mode. This is checked only if no FileNameRx matches the filename.



Regular expression that matches function header.

Used by editor commands: ListRoutines, MoveFunctionPrev, MoveFunctionNext, BlockMarkFunction, IndentFunction.

Loading files in various formats

Here are settings for loading files in various formats:

DOS/Win/OS2/NT text files (CR/LF delimited):
          StripChar      13
          LineChar       10
          AddCR          1
          AddLF          1

Unix text files (LF delimited):
          StripChar      -1
          LineChar       10
          AddCR          0
          AddLF          1
MAC text files (CR delimited):
          StripChar      -1
          LineChar       13
          AddCR          1
          AddLF          0
Binary files (fixed record length):
          StripChar      -1
          LineChar       -1
          AddCR          0
          AddLF          0
          LoadMargin     64
          ForceNewLine   0

Configuration of Tab options