# shift-(cursor key): up and down one page, left and right one word
map `s-up' `pageup'
map `s-dow' `pagedown'
map `s-lef' `wleft'
map `s-rig' `wright'
# alt-(cursor key): top and bottom of screen, left and right 40 characters
map `a-up' `screentop'
map `a-dow' `screenbottom'
map `a-lef' `repeat 40 left'
map `a-rig' `repeat 40 right'
# shift-alt-(cursor key): top and bottom of file, first and last character of line
map `sa-up' `top'
map `sa-dow' `bottom'
map `sa-lef' `first'
map `sa-rig' `last'
# ctrl-(cursor key): scroll up and down
map `c-up' `scrollup'
map `c-dow' `scrolldown'
# allow use of mouse to select, copy and delete blocks of text; separate clipboards are maintained for the left and right mouse-buttons;
# shift-(left-mouse-button click): define start and end of current block; automatically copies block into left clipboard; automatically undefines old block
# ctrl-(left-mouse-button click): goto start of current block
# alt-(left-mouse-button click): goto end of current block
# shift-alt-(left-mouse-button click): copy contents of left clipboard above to the line clicked upon
# ctrl-shift-alt-(left-mouse-button click): delete current block after copying it into left clipboard
# return: return-with-indent which handles DME bug of adding 2 lines at the end of a file;
# shift-return: return-with-indent-and-text-split which handles DME bug of adding 2 lines at the end of a file;
map `return' `last ifelse b `split firstnb down down deline' `split firstnb down' '
map `s-return' `ifelse b `split down down deline up firstnb' `split firstnb' repeat cleft `first down ` ' up' firstnb down'
# del: TRUE delete, including end-of-line join; handles rich and varied set of bugs with join command
# shift-del: TRUE word-delete, etc.
# shift-alt-del: line-delete
map `del' `ifelse !r del `ifelse l `if !b deline' `resettoggle 1 resettoggle 2 source ram:join.edrc'''
map `s-del' `ifelse ca `resettoggle 0' `settoggle 0' settoggle 3 while 3 `ifelse !r del `ifelse l `if !b deline' `resettoggle 1 resettoggle 2 source ram:join.edrc'' ifelse 0 `resettoggle 3' `if !ca `resettoggle 3''''
map `sa-del' `deline'
# bs: TRUE backspace, including end-of-line join; handles rich and varied set of bugs with join command
# shift-bs: TRUE word-backspace, etc.
# shift-alt-bs: line-delete
map `bs' `ifelse l `ifelse t up `up last'' left ifelse !r del `ifelse l `if !b deline' `resettoggle 1 resettoggle 2 source ram:join.edrc'''
map `s-bs' `settoggle 3 while 3 `ifelse l `ifelse t up `up last'' left ifelse l `resettoggle 3' `left if !ca `resettoggle 3' right' if !ca `resettoggle 3' ifelse !r del `ifelse l `if !b deline' `resettoggle 1 resettoggle 2 source ram:join.edrc''''
map `sa-bs' `deline'
# prompt: replace current file with new one; prompt: open new window with new file
map `f1' `escimm `newfile ''
map `s-f1' `escimm `newwindow newfile ''
# prompt: insert file before current line; prompt: change name of current file
map `f2' `escimm `insfile ''
map `s-f2' `escimm `chfilename ''
#prompt: save file as ?; save current file
map `f3' `escimm `saveas ''
map `s-f3' `saveold'
#safe quit; save current file then quit
map `f4' `quit'
map `s-f4' `saveold quit'
#execute the right and left clipboards as macros
map `f5' `source dme.R.clip'
map `s-f5' `source dme.L.clip'
# open small windows to view contents of the left and right clipboards
# find/replace previous occurrence of find-string; differs from prevr in that it will change word under the cursor (allowing you to selectively find-and-replace with a minimum of keystrokes)
# prompt: find/replace all previous occurrences of find-string
map `f7' `prev'
map `s-f7' `ifelse r `if !b `down first'' `right' prevr'
# find/replace next occurrence of find-string; differs from findr in that it will change word under the cursor (allowing you to selectively find-and-replace with a minimum of keystrokes)
# prompt: find/replace all subsequent occurrences of find-string
map `f8' `next'
map `s-f8' `ifelse l `if !t `up last'' `left' nextr'
# this macro is required for the del-key and bs-key definitions; if you use this macro in your .edrc file, be sure to change the pathname to that of the directory containing your copy of the join macro