############################### .EDRC ###############################
#
# This is a very comfortable configuration file for the text editor DME by Matt
# Dillon. It is my favorite editor and I hope that you will like it as much as
# I do, especially with this comfortable configuration with 10 menus and many
# functions. This file may be freely distributed.
#
# If you want to use this configuration on an NTSC machine, you have to cut
# some items off from most menus to get everything on the screen.
# The key mappings are designed for a german keymap. You might have some
# problems accessing all function with other keymaps. You must also change
# the shortcuts displayed in the menus, because the shifted keys are mapped
# with 'map ...s-...' and the menus show the char that is available by shifting
# the key on a german keyboard (E.g. map 's-3', but shortcut '' -> change the
# shortcut to '#' on a USA keyboard).
#
# Cut the part below this comment and place it into your "s:" directory as
# "s:.edrc".
#
# Enjoy this configuration !
#
# ####  ! Wizard Works !       ####  AmNet    : STEFAN;HTH
# ####  Stefan Zeiger          ####  Fido     : STEFAN%HTH.AMN 2:247/12.5
# ####  Seligenstdter Weg 24  ####  Zerberus : STEFAN%HTH@AMNET.ZER
# ####  D-W-8756 Kahl          ####
# ####  Voice: (49)-6188-2525  ####
#
######################### <-- CUT BELOW --> #########################

# CONFIG 1.38 for DME 1.46 / 14.12.1990 - 01.02.1992 / by Stefan Zeiger
# 1990,1991,1992 by ! Wizard Works !
# Inspired by CEd, but with many extras

ignorecase on
savetabs off
wordwrap off
margin 80
tabstop 8
pageset 98

title (Doing setup. Please wait...)
addpath sys:text/texts/doc
set Esc (( ) left Tlate 27 right)
set LineNum (first insertmode on (     ) first insertmode off (\$lineno) down insertmode on)

# Unmap all except (s- ) (tab) (s-tab) (esc) (c-esc) (up) (dow) (rig) (lef)
# (L-lmb) (L-mmo)
unmap (bac)
unmap (c-1)
unmap (ent)
unmap (ret)
unmap (del)
unmap (s-del)
unmap (c-del)
unmap (a-up)
unmap (s-up)
unmap (c-up)
unmap (a-dow)
unmap (s-dow)
unmap (c-dow)
unmap (s-rig)
unmap (s-lef)
unmap (c-q)
unmap (f1)
unmap (c-w)
unmap (f2)
unmap (f3)
unmap (a-r)
unmap (c-r)
unmap (f6)
unmap (a-u)
unmap (f7)
unmap (c-u)
unmap (c-i)
unmap (f8)
unmap (c-o)
unmap (f9)
unmap (c-p)
unmap (f10)
unmap (c-[)
unmap (c-])
unmap (c-nk/)
unmap (c-s)
unmap (a-s)
unmap (sa-s)
unmap (a-d)
unmap (c-f)
unmap (c-g)
unmap (c-j)
unmap (a-l)
unmap (c-l)
unmap (R-rmb)
unmap (c-c)
unmap (a-c)
unmap (c-b)
unmap (c-n)
unmap (a-m)

map ret (ifelse b `split down first down deline' `split down first')
map ent (ret)
map back (ifelse l `up last join' `back')
map del (ifelse r `join' `del')
map ML-lmb (tomouse block)
map sML-lmb (unblock)
map aML-lmb (tomouse bcopy)
map asML-lmb (tomouse bmove)
map cML-lmb (bdelete)

# Proj
map As-7 (newfile unnamed)
map A-? (newwindow)
map A-o (arpload)
map As-o (arpinsfile)
map A-n (escimm (BSave ) )
map A-w (saveold)
map As-w (arpsave)
map A-p (bsave prt:)
map As-p (saveas prt:)
map c-] (ref)
map c-[ (ctags)
map A-7 (escimm (chfilename ))
map c-7 (escimm (cd ))
map f9 (scanf %s modified off newfile \$scanf)
map f10 (scanf %s execute (sys:sas/lc/files >t:dy -n -type d \$scanf) modified off newfile t:dy execute (sys:sas/lc/files >t:dy -n -type f \$scanf) bottom downadd insline down insfile t:dy top first modified off)
map A-q (quit)
map As-q (saveold quit)
map s-help (resize 77 29)
map As-i (iconify)
map help (iconify)

# Block
map A-b (block)
map As-b (unblock)
map A-c (bcopy)
map A-x (bmove)
map As-d (bdelete)
map A-f (bsource)
map A-y (remeol)
map A-4 (goto start first)
map As-4 (goto end last)
map A-5 (bsave clips:block.dme)
map As-5 (insfile clips:block.dme)
map A-6 (pushmark)
map As-6 (popmark)
map A-8 (swapmark)
map As-8 (purgemark)
map As-1 (goto block while cb (last tlate 13 down))
map As-2 (goto block while cb (last left if c=13 del down))
map A-1 (goto block while cb (first (  ) down))
map A-2 (goto block while cb (first repeat 2 (if c=32 del) down))
map A-3 (goto block while cb (justify full down))
map As-3 (goto block while cb (unjustify down))
map A-9 (goto block while cb (\$LineNum) insertmode on)

# Edit
map c-u (undo)
map A-g (ifelse cl (tlate -32) (if cu (tlate +32)) right)
map As-g (wleft if c=34 right if c=39 right if c=96 right ifelse cl (tlate -32) (if cu (tlate +32)) while ca right)
map A-u (wleft if c=34 right if c=39 right if c=96 right if cl `tlate -32' while ca (if cl (tlate -32) right))
map As-u (wleft if c=34 right if c=39 right if c=96 right if cu `tlate +32' while ca (if cu (tlate +32) right))
map A-k (deline)
map A-l (undeline)
map a-del (wleft if c=34 right if c=39 right if c=96 right while ca (del))
map s-del (deline)

# Repl
map As-s (escimm (FindStr ))
map As-r (escimm (RepStr ))
map A-s (next)
map A-a (prev)
map A-r (nextr)
map As-a (prevr)
map c-r (repeat -1 nextr)
map c-a (wleft if c=34 right if c=39 right if c=96 right if cl `tlate -32' while ca right)
map c-s (wleft if c=34 right if c=39 right if c=96 right if cu `tlate +32' while ca right)

# Extra
map A-- (( ) left escimm (Tlate ))
map a-f1 (pong 1)
map a-f2 (pong 2)
map a-f3 (pong 3)
map a-f4 (pong 4)
map a-f5 (pong 5)
map as-f1 (ping 1)
map as-f2 (ping 2)
map as-f3 (ping 3)
map as-f4 (ping 4)
map as-f5 (ping 5)
map A-d (escimm (Execute ))
map As-e (execute (execute sys:shell))
map A-m (escimm (Margin ))
map c-m (escimm (SetParCol ))
map A-M (reformat)

# ANSI
map As-f1 ($Esc)
map As-f2 ($Esc (c))
map As-f3 ($Esc ([3m))
map As-f4 ($Esc ([23m))
map As-f5 ($Esc ([4m))
map As-f6 ($Esc ([24m))
map As-f7 ($Esc ([1m))
map As-f8 ($Esc ([22m))
map A-f1 ($Esc ([30m))
map A-f2 ($Esc ([31m))
map A-f3 ($Esc ([32m))
map A-f4 ($Esc ([33m))
map A-f6 ($Esc ([40m))
map A-f7 ($Esc ([41m))
map A-f8 ($Esc ([42m))
map A-f9 ($Esc ([43m))

# Move
map left (ifelse l `ifelse t (left) (up last)' `left')
map right (ifelse r `ifelse b (right) (down first)' `right')
map A-j (escimm (goto ) first)
map as-up (screentop)
map as-down (screenbottom)
map as-left (firstnb)
map s-up (pageup)
map s-down (pagedown)
map s-left (ifelse l `up' `first')
map s-right (if r `down' last)
map a-up (repeat (12) (up) )
map a-down (repeat (12) (down) )
map a-left (repeat (12) (left) )
map a-right (repeat (12) (right) )
map c-up (top first)
map c-down (bottom last)
map c-left (wleft)
map c-right (wright)

# Env
map A-nk1 (setfont topaz.font 8)
map A-nk2 (setfont topaz.font 9)
map A-nk3 (setfont topaz.font 11)
map A-nk4 (setfont look.font 8)
map A-nk5 (setfont Editor.font 9)
map A-nk6 (setfont realtopaz.font 8)
map A-nk7 (setfont mydpaint.font 8)
map A-nk8 (setfont russian.font 10)
map A-nk9 (setfont ibm.font 8)
map c-w (escimm (Source ))
map A-e (source s:.edrc)
map c-e (source ram:.edrc)
map As-f (saveas t:dme.tmp source t:dme.tmp)
map As-l (pushmark block block bsource unblock popmark)
map c-x (saveconfig)
map A-t (escimm (Tabstop ))
map c-p (escimm (PageSet ))

# Opts
map a-nk1 (savetabs off)
map as-nk1 (savetabs on)
map a-nk2 (ignorecase on)
map as-nk2 (ignorecase off)
map a-nk3 (insertmode on)
map as-nk3 (insertmode off)
map a-nk4 (wordwrap off)
map as-nk4 (wordwrap on)
map a-nk5 ( unmap nk0 unmap nk. unmap nk1 unmap nk2 unmap nk3 unmap nk4 unmap nk5 unmap nk6 unmap nk7 unmap nk8 unmap nk9 )
map as-nk5 ( map nk0 (insertmode toggle) map nk. () map nk1 (screenbottom last) map nk2 (down) map nk3 (pagedown) map nk4 (left) map nk5 () map nk6 (right) map nk7 (screentop first) map nk8 (up) map nk9 (pageup) )
map a-nk6 (fgpen 1 bgpen 0 hgpen 2 tpen 0)
map as-nk6 (fgpen 2 bgpen 1 hgpen 3 tpen 1)
map a-nk7 (tabstop 8)
map as-nk7 (tabstop 2)

# Macros
map f1 (`void __stdargs main(void)' return `{' return `  ')
map s-f1 ``void __stdargs main(int argc, char **argv)' return `{' return `  ''
map f2 ``struct IntuitionBase *IntuitionBase=NULL;' return'
map s-f2 ``struct GfxBase *GfxBase=NULL;' return'
map f3 ((/*))
map s-f3 ((*/))
map f4 ((#include ))
map f5 ``  if(!(IntuitionBase=(struct IntuitionBase *)OpenLibrary("intuition.library",0))) cleanexit();' return'
map s-f5 ``  if(!(GfxBase=(struct GfxBase *)OpenLibrary("graphics.library",0))) cleanexit();' return'
map f6 ((\\\\n))

menuoff
menuclear

menuadd Proj (Clear              A-/) (newfile unnamed)
menuadd Proj (Open new           A-?) (newwindow)
menuadd Proj (Open...            A-o) (arpload)
menuadd Proj (Include file...    A-O) (arpinsfile)
menuadd Proj (Save block...      A-n) (escimm (BSave ))
menuadd Proj (Save               A-w) (saveold)
menuadd Proj (Save as...         A-W) (arpsave)
menuadd Proj (Open [cursor]       f9) (scanf %s modified off newfile \$scanf)
menuadd Proj (Directory [cursor] f10) (scanf %s execute (sys:sas/lc/files >t:dy -n -type d \$scanf) modified off newfile t:dy execute (sys:sas/lc/files >t:dy -n -type f \$scanf) bottom downadd insline down insfile t:dy top first modified off)
menuadd Proj ( ) ()
menuadd Proj (Open reference     c-]) (ref)
menuadd Proj (Open tag           c-[) (ctags)
menuadd Proj (  ) ()
menuadd Proj (Change filename... A-7) (escimm (chfilename ))
menuadd Proj (Change directory.. c-7) (escimm (cd ))
menuadd Proj (   ) ()
menuadd Proj (Print block        A-p) (bsave prt:)
menuadd Proj (Print file         A-P) (saveas prt:)
menuadd Proj (    ) ()
menuadd Proj (Quit               A-q) (quit)
menuadd Proj (Save & quit        A-Q) (saveold quit)
menuadd Proj (     ) ()
menuadd Proj (Full size       s-HELP) (resize 77 29)
menuadd Proj (Iconify       HELP/A-I) (iconify)

menuadd Block (Mark block      M-lmb/A-b) (block)
menuadd Block (Unmark block   sM-lmb/A-B) (unblock)
menuadd Block (Copy block     aM-lmb/A-c) (bcopy)
menuadd Block (Move block    asM-lmb/A-x) (bmove)
menuadd Block (Delete block   cM-lmb/A-D) (bdelete)
menuadd Block (Save block to file... A-n) (escimm (BSave ))
menuadd Block (Run block             A-f) (bsource)
menuadd Block (Go to beg. of block   A-4) (goto start first)
menuadd Block (Go to end of block    A-$) (goto end last)
menuadd Block (Copy to clipboard     A-5) (bsave clips:block.dme)
menuadd Block (Paste from clipboard  A-%) (insfile clips:block.dme)
menuadd Block ( ) ()
menuadd Block (Push marks            A-6) (pushmark)
menuadd Block (Pop marks             A-&) (popmark)
menuadd Block (Swap marks            A-8) (swapmark)
menuadd Block `Clear stack           A-(' (purgemark)
menuadd Block (  ) ()
menuadd Block (Convert LF -> CRLF    A-!) (goto block while cb (last tlate 13 down))
menuadd Block (Convert CRLF -> LF    A-") (goto block while cb (last left if c=13 del down))
menuadd Block (Indent                A-1) (goto block while cb (first (  ) down))
menuadd Block (Backdent              A-2) (goto block while cb (first repeat 2 (if c=32 del) down))
menuadd Block (Justify               A-3) (goto block while cb (justify full down))
menuadd Block (Unjustify             A-) (goto block while cb (unjustify down))
menuadd Block (Insert line numbers   A-9) (goto block while cb (\$LineNum) insertmode on)

menuadd Edit (Undo current line     c-u) (undo)
menuadd Edit ( ) ()
menuadd Edit (Delete word         a-del) (wleft if c=34 right if c=39 right if c=96 right while ca (del))
menuadd Edit (  ) ()
menuadd Edit (Delete line     s-del/A-k) (deline)
menuadd Edit (Undelete line         A-l) (undeline)
menuadd Edit (Delete to EOL         A-y) (remeol)

menuadd Repl (Set search pattern... A-S) (escimm (FindStr ))
menuadd Repl (Set replace string... A-R) (escimm (RepStr ))
menuadd Repl (Search forwards       A-s) (next)
menuadd Repl (Search backwards      A-a) (prev)
menuadd Repl (Replace forwards      A-r) (nextr)
menuadd Repl (Replace backwards     A-A) (prevr)
menuadd Repl (Replace until EOF     c-r) (repeat -1 nextr)
menuadd Repl ( ) ()
menuadd Repl (Change case letter    A-g) (ifelse cl (tlate -32) (if cu (tlate +32)) right)
menuadd Repl (Change case word      A-G) (wleft if c=34 right if c=39 right if c=96 right ifelse cl (tlate -32) (if cu (tlate +32)) while ca right)
menuadd Repl (Upper case word       A-u) (wleft if c=34 right if c=39 right if c=96 right if cl `tlate -32' while ca (if cl (tlate -32) right))
menuadd Repl (Lower case word       A-U) (wleft if c=34 right if c=39 right if c=96 right if cu `tlate +32' while ca (if cu (tlate +32) right))
menuadd Repl (Capitalize word       c-a) (wleft if c=34 right if c=39 right if c=96 right if cl `tlate -32' while ca right)
menuadd Repl (Uncapitalize word     c-s) (wleft if c=34 right if c=39 right if c=96 right if cu `tlate +32' while ca right)

menuadd Extra (Send Dos command...      A-d) (escimm (Execute ))
menuadd Extra (New shell                A-E) (execute (execute sys:shell))
menuadd Extra ( ) ()
menuadd Extra (Command mode...          esc) (esc)
menuadd Extra (Recall last command... c-esc) (recall)
menuadd Extra (  ) ()
menuadd Extra (Enter ascii...           A--) (( ) left escimm (Tlate ))
menuadd Extra (   ) ()
menuadd Extra (Mark location 1        as-f1) (ping 1)
menuadd Extra (Mark location 2        as-f2) (ping 2)
menuadd Extra (Mark location 3        as-f3) (ping 3)
menuadd Extra (Mark location 4        as-f4) (ping 4)
menuadd Extra (Mark location 5        as-f5) (ping 5)
menuadd Extra (Jump to mark 1          a-f1) (pong 1)
menuadd Extra (Jump to mark 2          a-f2) (pong 2)
menuadd Extra (Jump to mark 3          a-f3) (pong 3)
menuadd Extra (Jump to mark 4          a-f4) (pong 4)
menuadd Extra (Jump to mark 5          a-f5) (pong 5)
menuadd Extra (    ) ()
menuadd Extra (Set right margin...      A-m) (escimm (Margin ))
menuadd Extra (Set left margin...       c-m) (escimm (SetParCol ))
menuadd Extra (Reformat paragraph       A-M) (reformat)

menuadd ANSI (ESC            As-f1) ($Esc)
menuadd ANSI (Reset          As-f2) ($Esc (c))
menuadd ANSI (Italics on     As-f3) ($Esc ([3m))
menuadd ANSI (Italics off    As-f4) ($Esc ([23m))
menuadd ANSI (Underline on   As-f5) ($Esc ([4m))
menuadd ANSI (Underline off  As-f6) ($Esc ([24m))
menuadd ANSI (Boldface on    As-f7) ($Esc ([1m))
menuadd ANSI (Boldface off   As-f8) ($Esc ([22m))
menuadd ANSI (Foreground 0    A-f1) ($Esc ([30m))
menuadd ANSI (Foreground 1    A-f2) ($Esc ([31m))
menuadd ANSI (Foreground 2    A-f3) ($Esc ([32m))
menuadd ANSI (Foreground 3    A-f4) ($Esc ([33m))
menuadd ANSI (Background 0    A-f6) ($Esc ([40m))
menuadd ANSI (Background 1    A-f7) ($Esc ([41m))
menuadd ANSI (Background 2    A-f8) ($Esc ([42m))
menuadd ANSI (Background 3    A-f9) ($Esc ([43m))

menuadd Move (Jump +/-/abs...       A-j) (escimm (goto ) first)
menuadd Move (Beg of screen       as-up) (screentop)
menuadd Move (End of screen       as-do) (screenbottom)
menuadd Move (First non-blank     as-le) (firstnb)
menuadd Move (------ CURSOR KEYS ------) ()
menuadd Move (Up 1 line) (up)
menuadd Move (Down 1 line) (down)
menuadd Move (Left 1 char) (left)
menuadd Move (Right 1 char) (right)
menuadd Move (--------- SHIFT ---------) ()
menuadd Move (Up 1 page) (pageup)
menuadd Move (Down 1 page) (pagedown)
menuadd Move (Beg of line) (first)
menuadd Move (End of line) (last)
menuadd Move (---------- ALT ----------) ()
menuadd Move (Up 12 lines) (repeat (12)(up))
menuadd Move (Down 12 lines) (repeat (12)(down))
menuadd Move (Left 12 chars) (repeat (12)(left))
menuadd Move (Right 12 chars) (repeat (12)(right))
menuadd Move (---------- CTRL ---------) ()
menuadd Move (Beg of file) (top first)
menuadd Move (End of file) (bottom last)
menuadd Move (Prev word) (wleft)
menuadd Move (Next word) (wright)

menuadd Env (--------- FONT --------) ()
menuadd Env (Topaz      8      A-nk1) (setfont topaz.font 8)
menuadd Env (Topaz      9      A-nk2) (setfont topaz.font 9)
menuadd Env (Topaz     11      A-nk3) (setfont topaz.font 11)
menuadd Env (Look       8      A-nk4) (setfont look.font 8)
menuadd Env (Russian   10      A-nk8) (setfont russian.font 10)
menuadd Env (IBM        8      A-nk9) (setfont ibm.font 8)
menuadd Env (-------- CONFIG -------) ()
menuadd Env (Run script...       c-w) (escimm (Source ) )
menuadd Env (Run default script  A-e) (source s:.edrc)
menuadd Env (Run 'RAM:.EDRC'     c-e) (source ram:.edrc)
menuadd Env (Run this file       A-F) (saveas t:dme.tmp source t:dme.tmp)
menuadd Env (Run block           A-f) (bsource)
menuadd Env (Run line            A-L) (pushmark block block bsource unblock popmark)
menuadd Env (Save configuration  c-x) (saveconfig)
menuadd Env (------- SETTINGS ------) ()
menuadd Env (Tab size...         A-t) (escimm (Tabstop ))
menuadd Env (Right margin...     A-m) (escimm (Margin ))
menuadd Env (Left margin...      c-m) (escimm (SetParCol ))
menuadd Env (Page size in %...   c-p) (escimm (PageSet ))

menuadd Opts (---- a-/as-nkx ----) ()
menuadd Opts (1. Save spaces) (savetabs off)
menuadd Opts (   Save tabs) (savetabs on)
menuadd Opts (2. Case InSensitive) (ignorecase on)
menuadd Opts (   Case Sensitive) (ignorecase off)
menuadd Opts (3. Insert) (insertmode on)
menuadd Opts (   Overwrite) (insertmode off)
menuadd Opts (4. Word wrap off) (wordwrap off)
menuadd Opts (   Word wrap on) (wordwrap on)
menuadd Opts (5. Keypad: Numbers) ( unmap nk0 unmap nk. unmap nk1 unmap nk2 unmap nk3 unmap nk4 unmap nk5 unmap nk6 unmap nk7 unmap nk8 unmap nk9 )
menuadd Opts (   Keypad: Movement) ( map nk0 (insertmode toggle) map nk. () map nk1 (screenbottom last) map nk2 (down) map nk3 (pagedown) map nk4 (left) map nk5 () map nk6 (right) map nk7 (screentop first) map nk8 (up) map nk9 (pageup) )
menuadd Opts (6. Normal colors) (fgpen 1 bgpen 0 hgpen 2 tpen 0)
menuadd Opts (   Alternate colors) (fgpen 2 bgpen 1 hgpen 3 tpen 1)
menuadd Opts (7. Text) (tabstop 8)
menuadd Opts (   C-Source) (tabstop 2)

menuadd Macros `f1 main()' (f1)
menuadd Macros `s1 main(arg...)' (s-f1)
menuadd Macros (f2 IntuitionBase) (f2)
menuadd Macros (s2 GfxBase) (s-f2)
menuadd Macros (f3 /*) (f3)
menuadd Macros (s3 */) (s-f3)
menuadd Macros (f4 #include) (f4)
menuadd Macros (f5 Open Intuition) (f5)
menuadd Macros (s5 Open Graphics) (s-f5)
menuadd Macros (f6 \\\n) (f6)

menuon
