NOTE: This docs is pre-alpha (:)) and will probably not make much sense.



                            ww (0.09 beta)
                                 
            
Contents
-----------------------------------------------------------------------


   1. Installation
   2. Command line options
   3. Working with ww
   3.1. Status line 
   3.2. Default keyboard bindings
   4. Configuration
   4.1. Modes
   4.2. Keybindings
   4.3. Colors
   5. Command reference


1. Installation   
-----------------------------------------------------------------------

   The following files are included in the archive:
   
       ReadMe.ww               Release notes, check first
       ww.Txt                  Some docs (this file)
       ww.Exe                  The main executable (REQUIRED)
       ww.Cfg                  Config file (REQUIRED)
       ToDo.ww                 What to expect in the future
       History.ww              List of added features, bug fixes,...

   Only ww.Exe and ww.Cfg are required for proper function of the editor.
   They should be both put in the same directory along your PATH.
   Optionally you can create a program object for ww.
   

2. Command line options
-----------------------------------------------------------------------

    ww [[options] [files] ...]
    
    options
    
       -#<line>[,<column>]     Go to line (and column) in next file
       -m<mode>                Set mode for next files to <modE>
       -m                      Reset default mode
       --                      The rest are not options
       -+                      The next one is not an option
    
    
    Examples:
    
      ww -mBIN ww.exe                      -- load ww.exe in BIN mode
      ww -#100,30 window.cpp               -- go to (100,30) in window.cpp
      ww window.cpp                        -- load file window.cpp
      ww -mBIN ww.exe -m ww.cpp            -- load ww.exe in bin, window.cpp
                                              in default mode (C/C++)
      ww -mBIN -+ -bla-                    -- load file -bla- in BIN mode
      ww -- -1 -2 -3 -4 -5 -6              -- load files -1, -2, -3, -4, -5, -6
      
  
3. Working with ww
-----------------------------------------------------------------------

3.1. Status line:

Status line is as follows:

<position> <flags> <mode> [<curchar>]<mod?><filename>

position> = <line>:<column>,<character number>

flags     = I    Insert                                           
            A    Autoindent                                       
            T    Tabs Expanded (only on display, not file)        
            C    Highlighting                                     
            R    Read only                                        
            U    Undo/Redo active                                 
            E    Blanks are trimmed on ends of lines              
            B    Backups are created                              
            SLC  Stream, Line, Column block mode                  
            X    Autoextend block mode                            

mode      = Mode name as specified in config file

curchar   = Dec,Hex ascii code of current character

mod?      = * if file was modified.
         
         
3.2. Default keyboard bindings
-----------------------------------------------------------------------
See ww.cfg for details. This needs to be finished.

4. Configuration
-----------------------------------------------------------------------
All configuration is done in ww.cfg file which must reside in the same
directory as the ww.exe executable. Most of the settings in the cfg file
are CASE SENSITIVE. '#' on the beginning of line is used for comments.
Blank lines are ignored.


4.1. Modes
-----------------------------------------------------------------------
ww 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>   <parent mode>      <.ext.ext.ext.>

Modes can inherit settings from it's parent mode.


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.

TabSize        {1,2,4,8,16,32}

	Tab size when tabs are expanded. Only 1,2,4,8,16,32 are 
        currently supported.

AutoIndent     {0,1}

	Should be set to 1 if autoindent is to be used.
   
Insert         {0,1}

	If set to 1, Insert mode is active by default. If set to 0,
        Overwrite mode is activated.
	
StripChar      13
	
        This characted will be stripped when the file is being loaded.
        If it is set to -1, no characted will be stripped.

LineChar       10

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

AddCR          {0,1}

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

AddLF          {0,1}

        If set to 1, 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 this.


Here are examples for previous five settings.

To load/save DOS/Win/OS2/NT text files:

StripChar 13
LineChar  10
AddCR     1
AddLF     1
ForceNewLine 0

To load/save UNIX text files:

StripChar -1
LineChar  10
AddCR     0
AddLF     1
ForceNewLine 0

To load/save MAC text files (this is hopefully correct):

StripChar    -1
LineChar     13
AddCR        1
AddLF        0
ForceNewLine 0

--


Hilit          {0,1}
	
        If set to 1, syntax highliting will be active
    
Indent         {0,1}

	If set to 1, smart autoindent will be active.
        
        
ShowTab        {0,1}

	If set to 1, tabs will be visible as circles (EPM-like).
	
IndentMode     {PLAIN,CMODE}

	Activates the specified smart indent mode.
        (PLAIN is not really smart :))

HilitMode      {PLAIN,CMODE,HTML,MAKE,REXX}

	Activates the specified coloring mode.
        
        CMODE/HTML modes should work correctly nearly 99% of the
        time (if you find bugs in be sure to report them).
        MAKE mode is very primitive and fails often (especially for 
        non-UNIX makefiles). PLAIN specifies no coloring.
        

4.2. 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 +

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

Keys are bound using the Key command:

Key   <key_spec>  <Up to four editor commands>

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

See section 5 for a list of commands.

See ww.cfg for examples.


4.3. Colors
-----------------------------------------------------------------------

 Syntax for color settings is

 Color <color> <2-char-hex-value> 
 
 The second value is the PC attribute.
 First character is background, the second is foreground
 Colors are as follows:
 0 - black
 1 - blue
 2 - green 
 3 - cyan
 4 - red
 5 - magenta
 6 - orange
 7 - white
 8-F are repeated as bright 0-7

 NOTE: in Full-Screen sessions bright backgrounds will blink. (FIXME)
 
 Colors:
 
	Status.Normal    70
     
	Message.Normal   1F
	Message.Bold     1B
	Message.Error    14

	Entry.Field      1B
	Entry.Prompt     1F

	Plain.Normal     1B
	Plain.Background 17
	Plain.Selected   30

	C.Normal         17
	C.Keyword        1F
	C.Number         1D
	C.HexNumber      1C
	C.NonAlpha       1B
	C.String         1E
	C.Comment        1A
	C.CPP            1A

	HTML.Normal      17
	HTML.Command     1B
	HTML.String      1E
	HTML.Char        1A
	HTML.Slashed     1F

	MAKE.Normal      17
	MAKE.Comment     1E
	MAKE.DotCmd      1F
	MAKE.Command     1B


5. Command reference
-----------------------------------------------------------------------

The Commands are:

    Cursor movement:
    
        MoveLeft
        MoveRight
        MoveUp
        MoveDown
        MovePrev
        MoveNext
        MoveWordLeft
        MoveWordRight
        MoveWordPrev
        MoveWordNext
        MoveLineStart
        MoveLineEnd
        MovePageUp
        MovePageDown
        MovePageLeft
        MovePageRight
        MovePageStart
        MovePageEnd
        MoveFileStart
        MoveFileEnd
        MoveBlockStart
        MoveBlockEnd
        MoveToPos
        MoveToLine
        MoveToColumn
        MoveFirstNonWhite
        ScrollLeft
        ScrollRight
        ScrollDown
        ScrollUp
    
    Text deleting:
    
        KillLine
        KillChar
        KillCharPrev
        KillWord
        KillWordPrev
        KillToLineStart
        KillToLineEnd
        KillBlock
    
    Line commands:
    
        LineInsert
        LineAdd
        LineSplit
        LineJoin
        LineNew
        LineIndent
    
    Inserting characters
    
        InsertChar
        InsertTab
        SelfInsert
        ToggleInsert
        
    Block commands:
        
        BlockBegin
        BlockEnd
        BlockUnmark
        BlockCut
        BlockCopy
        BlockPaste
        BlockKill
        BlockIndent
        BlockUnindent
        BlockClear
        BlockMarkStream
        BlockMarkLine
        BlockMarkColumn
        BlockReadFrom
        BlockWriteTo
        BlockCaseUp
        BlockCaseDown
        BlockCaseToggle
        BlockExtendBegin
        BlockExtendEnd
        
    File commands:    
        
        FileSave
        FileSaveAll
        FileSaveAs
        FileWriteTo
        FileQuit
        FileQuitAll
        FileLoad
        FilePrev
        FileNext
        FileGoBuffer
        
    Window commands:    
        
        WinHSplit
        WinClose
        WinNext
        WinPrev
        WinZoom
        
    Undo/Redo:    
        
        Undo
        Redo
        
    Search commands:    
        
        Search
        SearchAgain
        SearchReplace
        SearchReplaceAgain
        SearchB
        SearchAgainB
        SearchReplaceB
        SearchReplaceAgainB
    
    Other commands:
    
        ExitEditor
        RunCommand
        ViewBuffers
        ViewModeMap
        ChangeMode

