fte Manual


About FTE



fte

Version 
0.44

(c) Copyright 1995,1996 Marko Macek




The latest version can be always downloaded from:


http://ixtas.fri.uni-lj.si/~markom/fte


Please send comments/suggestions/bug reports to:


Marko.Macek@snet.fri.uni-lj.si
 or 
mark@hermes.si


See file 
HISTORY
 for recent changes.

See file 
TODO
 for possible future additions.

See file 
README
 for last minute notes.



Installation

This section covers installation and configuration of editor.

OS/2



The following files are included in the archive:



README


Release notes, read first!

fte.exe


Text-mode executable

ftepm.exe


Presentation Manager executable

fte-def.cnf


Default compiled configuration file.

fte.inf
, 
fte.ipf
, 
fte.html
, 
fte.txt


This file, in various formats.

config\*.fte


Configuration files in source form.

clipserv.exe


Clipboard server (required for PM clipboard support in text-mode version).

cliputil.exe


Utility to copy/paste to/from clipboard from command line.

HISTORY


Revision history.

TODO


Todo list.

file_id.diz


Program description for BBS upload.




 The default configuration files are precompiled into

fte-def.cnf
. This file should be copied to 
fte.cnf

for text-mode version, and  to 
ftepm.cnf
 for PM version. Or,
you may want to compile your own configuration from
source using

cfte
 configuration file compiler.


 For minimal installation of the text mode version, only

fte.exe
 and 
fte.cnf
 are required. For PM clipboard
support 
clipserv.EXE
 is needed and must be running whenever
you wish to use PM clipboard from
FTE.


 To install PM version, 
ftepm.exe
 and 
ftepm.cnf

are needed.


 To recompile source files, 
cfte.exe
 and

config\*.fte
 files are needed. 



 Place executable files somewhere on your 
PATH
. Compiled
configuration files should be located in the same directory
as
executable and have the same basename with extension 
.CNF
.




Unix


The following files are included in the archive:



README


Readme file.

fte


Linux console-only executable

Xfte


X11 Xlib executable.

fte-def.cnf


Default compiled configuration file

fte.html


Reference manual

config\*.fte


Configuration files in source form.

HISTORY


History of changes.

TODO


Todo list.

file_id.diz


Program description for BBS upload.

fte-0.38.lsm


LSM entry for FTE.




 The default configuration files are precompiled into

fte-def.cnf
. This file should be copied to 
~/.fterc

to be automatically loaded by FTE. You may want to compile your
own
configuration from source using 
cfte
 configuration file
compiler.


 Suggested installation directories:


        /usr/local/bin/fte
        /usr/local/bin/Xfte
       
/usr/local/bin/cfte
        /usr/local/lib/fte/etc/*.fte
       
/usr/local/lib/fte/lib/fte.html
        /usr/local/lib/fte/lib/TODO
       
/usr/local/lib/fte/lib/HISTORY
        /usr/local/lib/fte/lib/README






Execution

The FTE command line syntax is:



fte [[options] [files] ...]



Options:



-!


Ignore any external configuration file and use internal configuration.

-c[&lt;file&gt;]


Use specified configuration file (compiled). If no argument, use internal
configuration.

-l&lt;line&gt;[,&lt;column&gt;]


Go to line (and column) in next file on command line

-m&lt;MODE&gt;


Set mode for next files to &lt;MODE&gt;

-m


Reset to default mode

-d[&lt;.dsk&gt;]


Load/save desktop from file &lt;.dsk&gt;. If no argument, disable desktop
load/save.

-h[&lt;.his&gt;]


Load/save history from file &lt;.his&gt;. If no argument, disable history
load/save.

-T&lt;tags&gt;


Load tags file 'tags'.

-t&lt;tag&gt;


Lookup tag 'tag' and display file containing it.

--


The rest of the arguments are not options, but filenames.

-+


The next argument is not an option even if starting with a '-'.




There should not be any delimiter between option and it's arguments.


Examples:



fte -mBIN fte.exe


load fte.exe in BIN mode

fte -#100,30 win.c


go to (100,30) in win.c

fte window.cpp


load file window.cpp

fte -mBIN fte.exe -m fte.cpp


load fte.exe in binary mode, window.cpp in default mode (C/C++)

fte -mBIN -+ -bla-


load file -bla- in BIN mode

fte -- -1 -2 -3 -4 -5 -6


.load files -1, -2, -3, -4, -5, -6




 Under OS/2 default history and desktop file names are

FTE.DSK
 and 
FTE.HIS
 respectively. Under Unix they
are named 
.fte-desktop
 and 
.fte-history
. The global
desktop and history files will be searched in program directory
under
OS/2 and in user home directory under Unix.




Configuration Files

FTE configuration files are version specific, and must be recompiled
for
each new version of the editor.


 On startup, editor will attempt to load a configuration file with
the
basename as the executable and extension 
.CNF
. The
configuration file is produced by compiling source files with 
CFTE
.


 If the command line option 
-!
 is used, editor will not
attempt to load a configuration file and will use
default built-in
settings.


Compiling configuration files.


Configuration files are compiled using 
CFTE
 program.


cfte
 should be invoked on 
main.fte
, for example:


[C:\FTE] cfte config\main.fte
$ cfte config/main.fte




This will automatically compile all 
*.fte
 files included
from 
main.fte
 and produce 
fte-new.cnf
 if there
are no errors in source files.


 When configuration source files are sucessfully compiled, the resulting file
fte-new.cnf
 should be copied to

fte.cnf
 and 
ftepm.cnf
, or under Unix to 
~/.fterc



Source Configuration files


 Comments start with character 
 and last until the end
of line.

 Strings can be specified using any of 
' " /
 characters.


 Single quoted strings perform no substitution. To enter  

or 
 into a string precede it with a backslash. 


 Double quoted strings perform the following substitutions:

 
\t  ->  tab character
\r  ->  CR 
\n  ->  LF
\v  ->  vertical tab
\b 
->  ^H, backspace
\a  ->  ^G, bell




 Strings started by 
 character require no escaping. Mostly
useful for specifying 
regular expressions

without double backslashes.




Global Configuration


Global Settings

The following settings can be used in the 
GLOBAL
 section of the
configuration file.


ScreenSizeX

Number of columns visible on screen or window


ScreenSizeY

Number of lines visible on screen or window


CursorInsertStart

Starting percentage of cursor size (from top) when in insert mode.


CursorInsertEnd

Ending percentage of cursor size when in insert mode.


CursorOverStart

Starting percentage of cursor size when in overstrike mode


CursorOverEnd

Ending percentage of cursor size when in overstrike mode.


SysClipboard

When set to 1, editor will use external (PM) clipboard instead of
internal
one.


SelectPathname

If set to 1, pathname will be selected by default when prompting for
a
file in 
FileOpen
 function. If set to 0,
pathname will not be selected, this allows you to
quickly type a new
filename, without erasing an entire entryfield.


OpenAfterClose

If set to 1, editor will prompt for another file when all files
are
closed.


ShowMenuBar

If set to 1, main menu bar will be visible.


ShowVScroll

If set to 1, scroll bar will be visible.


DefaultModeName

Default mode name for loading/editing files. If not set or invalid,
first
mode in the configuration file will be used instead. By default
set to
'PLAIN'.


CompletionFilter

Files matching this regexp are ignored when doing filename completion.


CompileRx

Defines 
regular expressions
 and thers subpattern
indices to match when searching for errors and
warnings in compilation
output. First number is an index of the subpattern
that matches 
filename. The second must match the line number, the third
parameter is
the regular expression to match to each line of the compiler
output.


C_*

Define the C mode smart indentation parameters


 See section on 
configuring C mode indentation
.


REXX_Indent

Defines the REXX basic indentation level


KeepHistory

If set to 1, last file position and imput prompt history will
be loaded on
startup and saved on exit. Can be overriden
with command line option
'-h'.


LoadDesktopOnEntry

If set to 1, all files listed in FTE.DSK in current directory or
FTE.EXE
directory will be loaded into FTE. The desktop file can
be overriden with
command line option '-d'.


SaveDesktopOnExit

If set to 1, desktop will be automatically saved when 
ExitEditor
 command is issued.


KeepMessages

If set to 1, compiler messages will be kept until deleted by user.


ScrollBorderX

Horizontal offset to the border before window starts scrolling.


ScrollBorderY

Vertical offset to the border before window starts scrolling.


ScrollJumpX

Scroll window by this many columns when cursor reaches scrolling
border.


ScrollJumpY

Scroll window by this many lines when cursor reaches scrolling border.


Colors


Colors are configured in COLOR.FTE file.


Syntax for color settings is:

color
 { { 'name', 'value' } ... }

Value is the PC character attribute first char is background color,
the
second is foreground color.

Colors are as follows:


        0        Black
        1        Dark Blue
        2        Dark
Green 
        3        Dark Cyan
        4        Dark Red
        5     
  Dark Magenta
        6        Orange
        7        Pale Gray
       
8        Dark Gray
        9        Blue
        A        Green
        B 
      Cyan
        C        Red
        D        Magenta
        E       
Yellow
        F        White






CMode Smart Indentation



Settings for CMode smart indentation






C_Indent
Basic C indentation level

C_BraceOfs
Brace '{' offset

C_CaseOfs
Offset of case and default statements

C_CaseDelta
Offsets of statements following case/default.

C_ClassOfs
Offset of public, private and protected

C_ClassDelta
Offset of statements following public, private, protected

C_ColonOfs
Offset of labels

C_CommentOfs
Offset of comments

C_CommentDelta
Offset of second line of comments




Example 1:



class line {
public:                   // C_ClassOfs = 0
    line();     
         // C_ClassDelta = 4
    ~line();
};

int main() {
    int x =
1;
    
    /*                    // C_CommentOfs = 0
     * check value  
     // C_CommentDelta = 1
     */
    
    puts("main");         //
C_Indent = 4
    if (x)
    {                     // C_BraceOfs = 0
      
 switch (x) {
        case 1:           // C_CaseOfs = 0
           
puts("ok");   // C_CaseDelta = 4
            break;
        }
   
}
end:
    return 0;
}





Example 2:



class line {
  public:                     // C_ClassOfs = 2
    line(); 
                 // C_ClassDelta = 2
    ~line();
};

int main() {
   
int x = 1;
    
      /*                      // C_CommentOfs = 2
      **
check value          // C_CommentDelta = 0
      */
    
    puts("main");
            // C_Indent = 4
    if (x)
    {                         //
C_BraceOfs = 0
        switch (x) {
            case 1:           //
C_CaseOfs = 4
                puts("ok");   // C_CaseDelta = 4
            
   break;
        }
    }
end:
    return 0;
}






Mode Configuration



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 
NAME
inherits 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:

ExpandTabs

{0,1}


Should be set to 1 if tabs are to be expanded when displayed. Use

ToggleExpandTabs
 command to toggle
during editing.


TabSize

{1-32}

Tab size when tabs are shown expanded on display.


AutoIndent

{0,1}

Should be set to 1 if autoindent is to be used. Use

ToggleAutoIndent
 command
to toggle it on/off during editing.


Insert


{0,1}


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

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


StripChar

{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.


LineChar

{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.


AddCR

{0,1}


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


AddLF


{0,1}

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


ForceNewLine

{0,1}

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


Hilit

{0,1}

If set to 
, syntax highliting will be active.


ShowTab

{0,1}

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


IndentMode

{PLAIN,C,REXX}

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


Colorizer

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


EventMap

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


UndoLimit

{Number}

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


UndoMoves

{0,1}

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


KeepBackups

{0,1}

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


MatchCase

{0,1}

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


BackSpKillTab

{0,1}

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


DeleteKillTab

{0,1}

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


BackSpUnindents

{0,1}

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


SpaceTabs

{0,1}

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


IndentWithTabs

{0,1}

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


WordWrap

{0,1,2}

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.


LeftMargin

{1-xx}

Left margin for word wrap (
WrapPara
 command).


RightMargin

{1-xx}

Right margin for word wrap (
WrapPara
 command).


Trim

{0,1}

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


ShowMarkers

{0,1}

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


CursorTroughTabs

{0,1}

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


DefFindOpt

'options'

Default 
search options
 for 
Find
 command.


DefFindReplaceOpt

'options'

Default 
search/replace
 options for 
FindReplace
 command.


SaveFolds

{0,1,2}

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.


CommentStart

"comment-start-string"

String that starts comments (for saving folds)


CommentEnd

"comment-end-string"

String that ends comments


AutoHilitParen

{0,1}

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


Abbreviations

{0,1}

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


BackSpKillBlock

{0,1}

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


DeleteKillBlock

{0,1}

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


PersistentBlocks

{0,1}

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.


InsertKillBlock

{0,1}

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


FileNameRx

"regexp"

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



FirstLineRx

"regexp"

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.


RoutineRegexp

"regexp"

 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





EventMap configuration


eventmap section is used to bind editor commands to user events.


Keybindings



Keybindings are inherited from parent modes unless overriden.


Here are some examples of key specifiactions:



[A]
Uppercase a

[a]
Lowercase a 

[;]
Semicolon

[A+A]
Alt+A

[C+B]
Ctrl+B

[A+C+F1]
Alt+Ctrl+F1

[A+C+S+F1]
Alt+Ctrl+Shift+F1

[A+Space]
Alt+Space

[C+K_C+B]
Ctrl+K and then Ctrl+B (two keys)

[C+A_C+B_C+C]
Ctrl+A Ctrl+B Ctrl+C must be pressed in sequence.

[G+-]
Gray -

[G++]
Gray +

[C-S-X]
X, ignore the state of Ctrl and Shift keys.

[C+\\]
Ctrl+Backslash

[C+\[]
Ctrl+[

[C+G-Left]
Ctrl+Left, ignore difference between the two Left keys.

[C+A-A]
Ctrl+A, ignore the state of Alt key.



The following special keys are available (case sensitive):

F1-F12 Home End PgUp PgDn Insert Delete Up Down Left Right 
Enter Esc BackSp
Space Tab Center


Keyname can be preceeded by modifiers 
(A, C, G, S)
. If modifier is followed
by a 
 (plus), the modifier key must be pressed to match the key 
specification.
If the modifier key is followed by 
 (minus), the state
of the modifier key is ignored.

Multiple-key combinations can be specified by separating
them with 
 (underline)

Keys are bound using the 
key
 command:

key
[keyspec]
 { 
editor commands
 }

ASCII characters >= 32 are bound to TypeChar by default.

Any number of commands can be bound to a key combination or menu item.
They
are executed in sequence until one of them fails.

See 
ui_fte.fte
 configuration file for examples and default
configuration.


Abbreviations


Abbreviations are used to automatically replace some text or run
an
editor macro when some word is typed in. When a non-word character
is
entered, the previous word is searched for in the list of
abbreviations.
When it is found, it is either replaced with a new
string or a macro is
executed.


Syntax:



abbrev 'old-word' 'new-string'

abbrev 'old-word' { Macro }




 Some examples of abbreviations:



    abbrev 'wcsw' 'WinCreateStdWindow';
    
    abbrev 'ifx' {
       
KillWordPrev; InsertString 'if () {'; LineIndent; LineNew; 
       
InsertString '}'; LineIndent; 
        MoveUp; MoveLineEnd; 3:MoveLeft; 
  
     Fail; # do not insert typed character
    }




The first one defines a replacement string, while the second one
defines
an editor macro to be run.


For abbreviations to work, setting

Abbreviations
 must be set to 1 for
active mode.


EventMap Settings



MainMenu

"menu"

Main menu displayed when editing in this mode.


LocalMenu

"menu"

Local menu used when editing in this mode.





Colorizer Configuration


Configuration of syntax highlighting modes.

Syntax:


colorize &lt;mode&gt;[:&lt;parent&gt;] { &lt;settings&gt; }




Settings



SyntaxParser

{PLAIN,C,HTML,MAKE,REXX,DIFF,IPF,PERL,MERGE,Ada,...}


 Activates the specified syntax parser for colorization mode.

PLAIN
 specifies no syntax parser, only keyword highlighting
is available.

 New syntax parsers can be defined using state machines
by using a name of
SIMPLE.


Keywords


Syntax:


keyword &lt;color-specifier&gt; { list of keywords }



Multiple keyword sets with different colors can be defined.

 '-' can be used for color specifier do use the default keyword
color
specified in global settings.


Colors


Syntax:



color { list-of color-name,color-spec pairs }



Color settings are inherited from parent mode.


 The following color-names are available, which ones
will actually be used
depends on the SyntaxParser setting used:




...







Configurable Syntax Parser



This is not fully stabilized yet. Might change in the future.



When 
SyntaxParser
 is set to "SIMPLE", the following commands
can be used to configure the
state machine used for parsing the
text.




h_state

Defines a new state for the state machine




h_state
state_number
 {
    
default_color_name

}




h_state
 command takes the following parameters:




state_number

States must be numbered sequentially from 0 without skipping
any
number.


default_color_name

Contains the name of default color used for characters that are not
matched
by any transition string or keyword.





h_wtype

Specifies the keyword matching parameters for current
state. There can be
only one 
h_wtype
 keyword per state.




h_wtype
 {
    
next_state_if_matched
,
    
next_state_if_not_matched
,
    
next_state_if_no_keyword
,
    
state_flags
,
    
keyword_charset

}




h_wtype
 takes the following arguments:




next_state_if_matched

The number of the next state if any keyword is matched. Can
be -1 to keep
current state.


next_state_if_not_matched

The number of the next state if no keyword is matched. Can
be -1 to keep
current state.


next_state_if_no_keyword

The number of next state if no keyword is found at all. Can
be -1 to keep
current state.


state_flags

String containing zero or more of the following characters:




 i

 Keyword matching is performed case-insensitively.







h_trans

Defines a new state transition for current state.




h_trans
 {
    
next_state
,
    
trans_flags
,
    
trans_match
,
    
color_name

}




h_trans
 command takes the following parameters:




next_state

The number of next state to go if a match is successful.


trans_flags

Determines options for matching. Can contain zero or more of the
following
characters:




^

Matches only at the beginning of the line.

$

Matches only at the end of the line.

i

Match is case-insensitive.

s

trans_match
 is a character set. Matches only if the
next character is part of the
set.

S

Same as 's' but next character must not be part of the set.

-

After successfull match, the pointer is not advanced, matching
will resume
at the same position in next state. (WARNING: this
can cause infinite
loops).

&lt;

The matched character(s) are tagged with current state number.
This is
important for proper operation of 
MatchBracket
 command.
MatchBracket will only match braces tagged with same state
number.

&gt;

The matched character(s) are tagged with next state number.

q

On successful match quote the next character (the next character
is not used
for matching).

Q

On successful match quote the end of line (the end of line
is not used for
matching).




trans_match

When 'S' or 's' option is used, a character set to be matched. When
'S' or
's' options are not used, a string to be matched.





h_words

Specifies the set of keywords to match in this state. All
characters in
keywords must be part of the 
keyword_charset

in 
h_wtype
 command for this mode.





h_words &lt;color-specifier&gt; { 'list', 'of', 'keywords' }




 Works the same way as the 
keyword
 but keywords
are for current state only.


 Multiple keyword sets with different colors can be defined.

 '-' can be used for color specifier do use the default keyword
color
specified in global settings.






Status Line


Status line displays the following status information:

position|flags|mode|curchar|mod? filename|winno


position
 = line:column

flags




Insert

Autoindent

Matches are case sensitive

SLC
Stream, Line, Column block-mode

wW
Automatic word wrap active (w = line, W = paragraph).



mode
      = Mode name as specified in configuration file

curchar
   = Decimal ASCII code of character under cursor, or EOL/EOF

mod?
      = 
 if file was modified, 
 if file is read-only




Editor Commands


These commands can be bound to keys in configuration file:



Cursor Movement



MoveLeft

Moves cursor left one character. Stops at first column.


MoveRight

Move cursor right one character. Does not stop at the end of line.


MoveUp

Moves cursor up one line.


MoveDown

Moves cursor down one line


MovePrev

Moves cursor to previous character. When the start of line is
reached,
wraps to end of previous line.


MoveNext

Move cursor to next character. Then the end of line is reached, wraps
to
the beginning of the next line.


MoveWordLeft

Moves cursor one word left. Stops at the start of line.


MoveWordRight

Moves cursor one word right. Stops at the end of line.


MoveWordPrev

Moves cursor to start of previous word. When the start of line
is reached,
wraps to the end of previous line.


MoveWordNext

Moves cursor to start of next word. When the end of line is reached,
wraps
to the start of next line.


MoveLineStart

Moves cursor to beginning of line


MoveLineEnd

Moves cursor to end of line.


MovePageUp

Move cursor to previous page.


MovePageDown

Moves cursor to next page.


MovePageLeft

Moves cursor one page to the left.


MovePageRight

Moves cursor one page to the right.


MovePageStart

Moves cursor to the top of the page.


MovePageEnd

Moves cursor to the bottom of the page.


MoveFileStart

Moves cursor to the start of buffer.


MoveFileEnd

Moves cursor to end of buffer.


MoveBlockStart

Moves cursor to the start of block.


MoveBlockEnd

Moves cursor to the end of block.


ScrollLeft

Scroll screen left 8 characters


ScrollRight

Scroll screen right 8 characters


ScrollDown

Scroll screen down 1 line


ScrollUp

Scroll screen up 1 line


MoveFirstNonWhite

Moves cursor to first non whitespace character on line.


MoveLastNonWhite

Moves cursor after last non whitespace character on line.


MovePrevEqualIndent

Moves cursor to first line above the cursor with indentation equal
to
current line.


MoveNextEqualIndent

Moves cursor to first line below the cursor with indentation equal
to
current.


MovePrevTab

Moves cursor to previous tab stop.


MoveNextTab

Moves cursor to next tab stop.


MovePrevPos

Moves cursor to previous cursor position.


SavePos

Saves current cursor position.


MoveSavedPos

Moves cursor to saved position.


MoveSavedPosCol

Moves cursor to saved position column without leaving the current
line.


MoveSavedPosRow

Moves cursor to saved position line without leaving the current
column.


MoveLineTop

Reposition current line to top of window.


MoveLineCenter

Reposition current line to center of window.


MoveLineBottom

Reposition current line to bottom of window.


MoveTabStart

When inside of tab character, move cursor to start of tab.


MoveTabEnd

When inside of tab character, move cursor to end of tab.


MoveFoldTop

Move to the top of current fold.


MoveFoldPrev

Move to the top of previous fold.


MoveFoldNext

Move to the top of next fold.


MoveFunctionPrev

Move to start of previous function.


A function is determined by two lines matching 
RoutineRegexp
.


MoveFunctionNext

Move to start of next function.


A function is determined by two lines matching 
RoutineRegexp
.




Text deleting

Commands for deleting text in buffer.

KillLine

Delete current line. If we are on the last line of file, only the line

contents is deleted.


KillChar

Delete character under cursor.


KillCharPrev

Delete character before cursor.


KillWord

Delete next word.


KillWordPrev

Delete previous word.


KillToLineStart

Delete text to line start.


KillToLineEnd

Delete text to line end.


KillBlock

Kill text in block.


KillBlockOrChar

Kill block if marked, otherwise kill char under cursor.


KillBlockOrCharPreV

Kill block if marked, otherwise kill char before cursor.


BackSpace

Delete character before cursor.


Can be configured with the following mode settings:



WordWrap

BackSpUnindents

BackSpKillTab

Trim




Delete

Delete character under cursor (configurable).


Can be configured with the following mode settings



DeleteKillTab

WordWrap

Trim






Line commands

Text line operations.

LineInsert

Insert empty line before current line.


LineAdd

Add line after current.


LineSplit

Split line at current cursor position.


LineJoin

Join line with next one.


LineNew

Add new line after current one, move to next line and indent
(indentation
depends on currently active indentation mode).


LineIndent

Reindent current line. The behaviour depends on currenty active

indentation mode.


 In PLAIN mode, reindent the line to the same level as previous
line.


LineTrim

Trim spaces at the end of current line


LineDuplicate

Duplicate current line.




Text insertion

Text insertion commands.

InsertString

Insert string given as argument.


InsertChar

Insert character with ASCII code given as argument. Does not
check for
possible abbreviations.


InsertSpace

Insert Space character (ASCII 32)


TypeChar

Insert character with ASCII code given as argument. Checks
for possible
abbreviations and performs the expansion.


SelfInsert

Insert character defined by last key.


InsertTab

Insert Tab character (ASCII 9)


InsertSpacesToTab

Insert Space characters to next tab stop, simulating a tab.


InsPrevLineChar

Insert character above current character.


InsPrevLineToEol

Insert previous line from current column to end of line.


CompleteWord

Complete word with previous occurance of the word in the file.


WrapPara

Word wrap paragraph (paragraphs are separated by blank lines).




Blocks

Block manipulation commands.

BlockBegin

Set block beginning to current position.


BlockEnd

Set block end to current position.


BlockUnmark

Unmark selected block.


BlockCut

Cut selected block to clipboard.


BlockCutAppend

Cut selected block and append it to clipboard.


BlockCopy

Copy selected block to clipboard.


BlockCopyAppend

Append selected block to clipboard.


BlockPaste

Paste clipboard to current position.


BlockPasteStream

Paste clipboard to current position as stream block.


BlockPasteLine

Paste clipboard to current position as line block.


BlockPasteColumn

Paste clipboard to current position as column block.


BlockKill

Delete selected text.


BlockIndent

Indent block by 1 character.


BlockUnindent

Unindent block by 1 character.


BlockMarkStream

Start/stop marking stream block.


BlockMarkLine

Start/stop marking line block.


BlockMarkColumn

Start/stop marking column block.


BlockExtendBegin

Start extending selected block.


BlockExtendEnd

Stop extending selected block.


BlockReIndent

Reindent entire block (C/REXX mode)


BlockRead

Read block from file.


BlockWrite

Write marked block to file.


BlockPrint

Print a block to configured device.


BlockSelectLine

Select current line as block.


BlockSelectWord

Select word under cursor as word.


BlockUnTab

Remove tabs from marked lines.


BlockEnTab

Generate and optimize tabs in marked lines.


BlockMarkFunction

Mark current function as block.


A function is determined by two lines matching 
RoutineRegexp
.


BlockSort


Sorts the marked block in ascending order.


If mode setting MatchCase is set, characters will be compared
case
sensitively.


When block is marked in 
Stream
 or

Line
 mode, the entire lines in marked
block will be compared.


When block is marked in 
Column

mode, only characters within marked columns will be compared.


BlockSortReverse


Sorts the marked block in descending order.
See 
BlockSort
 for more information.




File commands


FileSave

Save current file.


FileSaveAll

Save all loaded files.


FileSaveAs

Save current file under a new name, changing the name of loaded file.


FileWriteTo

Save current file under a new name, without changing name of loaded
file.


FileClose

Close current file.


FileCloseAll

Close all files.


FileOpen

Open a file given as argument. If no argument is given for
command, prompt
user to enter a filename.


FileOpenInMode

Load a file in a specified mode.


FileReload

Reload current file.


FileNext

Select next file in buffer ring.


FilePrev

Select previous file in buffer ring.


FileLast

Select previously active file. Used to switch between two last
used
files.




Window commands

Window commands.

WinHSplit

Split window horizontally.


WinNext

Activate next window.


WinPrev

Activate previous window.


WinZoom

Make current window the only one (close all others).


WinRefresh

Repaint entire screen.


WinResize

Resize window (takes integer argument, -x = smaller, +x = bigger).


WinClose

Close current window.




Undo/Redo

Undo commands.

Undo

Undo last operation.


Redo

Redo last undone operation.




Character translation

Character translation commands.

CharCaseUp

Convert current character to uppercase


CharCaseDown

Convert current character to lowercase


CharCaseToggle

Toggle case of current characters


CharTrans

Translate current character as specified by two arguments.


Examples:



    CharTrans 'A-Za-z' 'a-zA-Z'
    CharTrans 'A-D' 'DCBA'




LineCaseUp

Convert characters on current line to uppercase


LineCaseDown

Convert characters on current line to lowercase


LineCaseToggle

Toggle case of characters on current line


LineTrans

Translate characters on current line as specified
by two arguments.


BlockCaseUp

Convert characters in selected block to uppercase


BlockCaseDown

Convert characters in selected block to lowercase


BlockCaseToggle

Toggle case of characters in selected block


BlockTrans

Translate characters in block as specified by two arguments.




Searching

Search/Replace commands.

Find

Search for text, w/options


FindReplace

Search and replace text w/options. 


FindRepeat

Repeat last search/replace operation


FindRepeatReverse

Repeat last search/replace operation in opposite direction


FindRepeatOnce

Repeat last search/replace operation only once.


MatchBracket

Search for matching bracket


HilitMatchBracket

Show matching bracket highlited if visible in window.


IncrementalSearch

Search incrementally for text.


SearchWordPrev

Search for previous occurance of word under cursor.


SearchWordNext

Search for next occurance of word under cursor.


Search

Search for text


SearchB

Search for text backwards


SearchRx

Search for regexp


SearchReplaceRx

Search and replace using regexp


SearchAgain

Search for text again


SearchAgainB

Search for text again backwards


SearchReplace

Search for text and replace


SearchReplaceB

Search and replace backwards



Folding

Folding commands.


FoldCreate

Create fold

FoldCreateByRegexp

Create folds at lines matching regexp.


FoldDestroy

Destroy fold at current line.


FoldDestroyAll

Destroy all folds in file.


FoldOpen

Open fold at current line.


FoldOpenAll

Open all folds in file.


FoldOpenNested

Open current fold and all nested folds


FoldClose

Close current fold


FoldCloseAll

Close all folds in file


FoldToggleOpenClose

Toggle open/close fold.


FoldPromote

Make fold a higher level fold


FoldDemote

Make fold a lower level fold




Compile commands

Running external tools such as compilers.

Compile

Run compile command in background


ViewMessages

View compiler output


CompilePrevError

Jump to previous compiler error


CompileNextError

Jump to next compiler error


ClearMessages

Clear compiler messages.




Bookmarks



PlaceBookmark

Place a named bookmark at current buffer position


GotoBookmark

Goto a named bookmark in current buffer


RemoveBookmark

Remove a named bookmark from current buffer




Settings

Changing editing options.


ToggleAutoIndent
Toggle automatic indentation

ToggleInsert
Toggle insert/overwrite mode

ToggleExpandTabs
Toggle tab expansion on display.

ToggleShowTabs
Toggle tab visibility (as circles).

ToggleUndo
Toggle undo/redo information saving.

ToggleReadOnly
Toggle read only file.

ToggleKeepBackups
Toggle backup files.

ToggleMatchCase
Toggle case sensitivity for searches

ToggleBackSpKillTab
Enable/disable BackSp killing entire tabs.

ToggleDeleteKillTab
Enable/disable Delete killing entire tabs.

ToggleSpaceTabs
Toggle insertion of spaces instead of tabs on Tab key.

ToggleIndentWithTabs
Toggle indentation with tabs.

ToggleBackSpUnindents
Toggle unindentation on previous indent level on BackSp.

ToggleWordWrap
Toggle automatic word wrap.

ToggleTrim
Toggle trimming of spaces at end of line.

ToggleShowMarkers
Toggle EOL/EOF marker visibility.

ToggleSysClipboard
Toggle usage of system clipboard.

SetLeftMargin
Set left margin to current cursor column.

SetRightMargin
Set right margin to current cursor column.

ChangeTabSize
Prompt for tab size.

ChangeCIndent
Prompt for indentation level for CMode smart indentation.

ChangeCBraceOfs
Change brace offset for CMode smart indentation.

ChangeREXXIndent
Prompt for indentation level for REXX smart indentation

ChangeLeftMargin
Prompt for left margin for word wrap.

ChangeRightMargin
Prompt for right margin for word wrap.



Tags


TagLoad
Load tags database (merge with currently loaded tags).

TagClear
Remove all loaded tags from memory.

TagFind
Prompt for tag and locate it.

TagFindWord
Locate tag under cursor.

TagPop
Return to position before TagFind or TagFindWord command.

TagNext
Search for next occurrance of current tag.

TagPrev
Search for previous occurance of current tag.

Other


ExitEditor

Close all files, save desktop and exit the editor.


RunProgram

Run external program in foreground.


ViewBuffers

View buffer list.


ChangeMode

Activate another mode for current file.


ShowEntryScreen

Show saved shell screen if available.


SwitchTo

Switch to buffer with a number.


ChangeKeys

Change current keymap to keymap of another mode.


ChangeFlags

Change current flags to flags of another mode.


ShowMenu

Show and select from menu.


MainMenu

Activate menu bar.


LocalMenu

Activate local popup menu.


ASCIITable

Select and insert character from ASCII table.


DesktopSave

Save current desktop to active desktop file.


DesktopSaveAs

Ask for a new desktop file and save current desktop into it.


ListRoutines

Show the list of functions in the current buffer.


A function is determined by two lines matching 
RoutineRegexp
.


IndentFunction

Indents the current function. Applys the

LineIndent
 command to every line of function.


 A function is determined by two lines matching 
RoutineRegexp
.




Search and Replace


Search/Replace Commands


Find
Search for text with 
options
.

FindReplace
Search and replace text w/options. 

FindRepeat
Repeat last search/replace operation

FindRepeatReverse
Repeat last search/replace operation in opposite direction

FindRepeatOnce
Repeat last search/replace operation only once.

MatchBracket
Search for matching bracket

IncrementalSearch
Search incrementally for text.

Search
Search for text

SearchB
Search for text backwards

SearchRx
Search for regexp

SearchReplaceRx
Search and replace using regexp

SearchAgain
Search for text again

SearchAgainB
Search for text again backwards

SearchReplace
Search for text and replace

SearchReplaceB
Search and replace backwards


Search and Replace Options






Search for all occurances

Search in block only

Search through entire file/block (globally).

Ignore case

Reverse search

Use 
regular expression
 matching

Delete found line

Join found line

Search for entire words (only when 'x' not used).

No prompting




Commands affected by 
DefFindOpt
 mode setting:



Find





Commands affected by 
DefFindReplaceOpt
 mode setting:



FindReplace





Commands affected by 
MatchCase
 mode setting:



IncrementalSearch


Search


SearchB


SearchRx


SearchReplaceRx


SearchReplace


SearchReplaceB







Regular Expressions



Regular expressions are a way to specify text patterns when searching
for
a text in a buffer. Regular expressions consist of normal
characters
and special operator characters with a special meanings.
Operators
allow you to anchor matches, match classes of characters, match
given
pattern several times or match alternate patterns. Operators can
be
also used to group patterns.



Search Operators



 

 
Quotes next character. Character will lose it's special meaning. Can also be
used to match special characters.
 
\n

 
Matches a 0x0A (LF) character.
 
\r

 
Matches a 0x0D (CR) character.
 
\t

 
Matches a 0x09 (TAB) character.
 
\e

 
Matches an escape character (0x1B)
 
\s

 
Matches whitespace (CR, LF, TAB, SPACE) characters.
 
\S

 
Matches non-whitespace (the reverse of \s)
 
\w

 
Matches word character [a-zA-Z0-9]
 
\W

 
Matches non-word character
 
\d

 
Matches a digit [0-9].
 
\D

 
Matches a non-digit.
 
\U

 
Matches uppercase characters (A-Z)
 
\L

 
Matches lowercase characters (a-z)
 
\x##

 
Matches specified hex value (\x0A, \x0D, \x09, etc.)
 
\o###

 
Matches specified octal value (\o000, \o015, etc.)
 
\N###

 
Matches specified decimal value (\N000, \N013, \N009, etc.)
 
\C

 
Starts case sensitive matching.
 
\c

 
Starts case insensitive matching.
 

 
Match a beginning of line.
 

 
Match an end of line.
 

 
Match any character.
 
&lt;

 
Match beginning of word (word consists of [A-Za-z0-9]).
 
&gt;

 
Match end of word.
 
[ ]

 
Specifies a class of characters ([abc123], [\]\x10], etc).
 
[ - ]

 
Specified a range of characters ([0-9a-zA-Z_], [0-9], etc)
 
[^ ]

 
Specifies complement class ([^a-z], [^\-], etc)
 

 
Matches preceeding pattern optionally (a?bc, filename\.?, $?, etc)
 

 
Matches preceeding or next pattern (a|b, c|d, abc|d). Only one character will
be used as pattern unless grouped together using {} or ().
 

 
Match zero or more occurances of preceeding pattern. Matching is greedy and
will match as much as possible.
 

 
Match one or more occurances of preceeding pattern. Match is greedy.
 

 
Match zero or more occurances of preceeding pattern. Matching is non-greedy
and will match as little as possible without causing the rest of the pattern
match to fail.
 

 
Match one or more occurances of preceeding pattern. Matching is non-greedy.

{ }

 
Group patterns together to form complex pattern. ( {abc}, {abc}|{cde},
{abc}?, {word}?)
 
( )

 
Group patterns together to form complex pattern. Also used to remember the
matched substring which can be used for substitution operation. Up to 9 can
be used.





Replace Operators:



 

 
Causes the next character to lose it's special meaning.
 
\n

 
Inserts a 0x0A (LF) character.
 
\r

 
Inserts a 0x0D (CR) character.
 
\t

 
Inserts a 0x09 (TAB) character.
 
\#

 
Recalls stored substring from matched pattern ()'s. (\1, \2, \3, to \9)
 
\0

 
Recalls entire matched pattern.
 
\u

 
Convert next character to uppercase
 
\l

 
Convert next character to lowercase
 
\U

 
Convert to uppercase till \E or \e
 
\L

 
Convert to lowercase till \E or \e






Performance Tips


If you want to achieve top performance (necessary for 
some text editing
tasks), here are some tips:




Use PLAIN hilit mode

Disable Tab Expansion

Disable ShowMarkers

Disable Undo

Disable AutoHilitBracket

Disable Abbreviations.






