{{{  Comments for this keybinding
; These keybindings are my variant of the mtool-sun-installation
;     for the origami.
;
; It works in general like the mtool-system, but the special
; codes for find/replace/attach are different. Also there are some other
; differences, which are nessessary to use the new commands.
;
; The alias-fold includes the binding of the Rx-Keys, so that you
; can use $Rx to bind them to functions.  Every function key should be defined
; in this way, because escape sequences are hard to read if you want to get
; help from the binding-file.
;
; Wolfgang Stumvoll
}}}
{{{  I call these bindings MTool
(defbinding MTool-Sun)
}}}
{{{  Alias for SUN-Keyboard (sunview and console)
; The following aliases describe the sunview-standard-keymapping for
; the Rxx-Keys and the Ins-Key.
{{{  Rxx
(alias R1  ($esc  "[ "2 "0 "8 "z))
(alias R2  ($esc "[ "2 "0 "9 "z))
(alias R3  ($esc "[ "2 "1 "0 "z))
(alias R4  ($esc "[ "2 "1 "1 "z))
(alias R5  ($esc "[ "2 "1 "2 "z))
(alias R6  ($esc "[ "2 "1 "3 "z))
(alias R7  ($esc "[ "2 "1 "4 "z))
(alias R8  ($esc "[ "A))
(alias R9  ($esc "[ "2 "1 "6 "z))
(alias R10 ($esc "[ "D))
(alias R11 ($esc "[ "2 "1 "8 "z))
(alias R12 ($esc "[ "C))
(alias R13 ($esc "[ "2 "2 "0 "z))
(alias R14 ($esc "[ "B))
(alias R15 ($esc "[ "2 "2 "2 "z))
}}}
(alias Ins ($esc "[ "2 "4 "7 "z))
}}}
{{{  definition of backspace,rubout
(alias rubout (C-?))
(alias backspace (C-H))
}}}
{{{  marktypes
(defmark pascal ( ("< "< "<)
                  (". ". ".)
                  (": ": ":)
                  ("> "> ">)
))
}}}
{{{  OCL-macros
{{{F mt-fold.fun
:::F mt-fold.fun
}}}
{{{F lookup.fun
:::F lookup.fun
}}}
{{{F delspaces.fun
:::F delspaces.fun
}}}
{{{F tab.fun
:::F tab.fun
}}}
{{{F append-to-previous-line
:::F append.fun
}}}
{{{F go-match.fun
:::F go-match.fun
}}}
{{{F fillpara.fun
:::F fillpara.fun
}}}
{{{F startup macros
:::F startup.fun
}}}
{{{F standard macros
:::F standard.fun
}}}
}}}
{{{  folding
(keybind O_AUTO_FOLD                    ($esc "a "f))
(keybind O_ATTACH_FILE                  ($esc "a "t))
(keybind O_CREATE_FOLD                  ($R15))
(keybind O_CREATE_FOLD                  ($esc "c "r))
(keybind O_FIRST_LINE_TO_FOLD_HEADER    ($esc "f "h))
(keybind O_FOLD_INFO                    ($esc "f "?))
(keybind O_ENTER_FOLD                   ($R13 $R4))
(keybind O_ENTER_FOLD                   ($esc "e "n))
(keybind O_ENTER_FOLD                   (M-C-O))
(keybind O_EXIT_FOLD                    ($R13 $R6))
(keybind O_EXIT_FOLD                    ($esc "e "x))
(keybind O_EXIT_FOLD                    (M-C-C))
(keybind O_CLOSE_FOLD                   ($R6))
(keybind O_CLOSE_FOLD                   ($esc "c "l))
(keybind O_CLOSE_FOLD                   (C-C))
(keybind O_FILE_FOLD                    ($R13 $R11))
(keybind O_FILE_FOLD                    ($esc "f "f))
(keybind O_OPEN_FOLD                    ($esc "o "p))
(keybind O_OPEN_FOLD                    ($R4))
(keybind O_OPEN_FOLD                    (C-O))
(keybind O_REMOVE_FOLD                  ($esc "r "e))
(keybind O_REMOVE_FOLD                  ($R13 $R15))
}}}
{{{  moving around
(keybind O_BOT_OF_FOLD                  ($R3))
(keybind O_BOT_OF_FOLD                  ($esc "b "O))
(keybind O_DOWN                         ($R14))
(keybind O_DOWN                         ($esc "d "n))
(keybind O_DOWN                         (C-N))
(keybind O_END_OF_LINE                  ($R9))
(keybind O_END_OF_LINE                  ($esc "e "l))
(keybind O_GOTO_LINE                    ($esc "g "o))
(keybind O_GOTO_LINE                    ($R13 "g))
(keybind O_LEFT                         ($esc "l "e))
(keybind O_LEFT                         ($R10))
(keybind O_LEFT                         (C-B))
(keybind O_PAGE_DOWN                    ($esc "p "d))
(keybind O_PAGE_DOWN                    ($R13 $R3))
(keybind O_PAGE_UP                      ($esc "p "u))
(keybind O_PAGE_UP                      ($R13 $R1))
(keybind O_RIGHT                        ($esc "r "i))
(keybind O_RIGHT                        ($R12))
(keybind O_RIGHT                        (C-F))
(keybind O_START_OF_LINE                ($R7))
(keybind O_START_OF_LINE                ($esc "s "l))
(keybind O_TOP_OF_FOLD                  ($esc "s "F))
(keybind O_TOP_OF_FOLD                  ($R1))
(keybind O_UP                           ($esc "u "p))
(keybind O_UP                           ($R8))
(keybind O_UP                           (C-P))
(keybind O_WORD_LEFT                    ($esc "l "w))
(keybind O_WORD_LEFT                    ($R13 $R10))
(keybind O_WORD_RIGHT                   ($esc "r "w))
(keybind O_WORD_RIGHT                   ($R13 $R12))
(keybind mtool-top                      ($esc "s "f))
(keybind mtool-top                      ($R13 $R8))
(keybind mtool-bot                      ($esc "b "o))
(keybind mtool-bot                      ($R13 $R14))
(keybind goto-matching-fence            ($esc "]))
}}}
{{{  editing
(keybind O_COPY                         ($R13 $R5))
(keybind O_COPY                         ($esc "c "o))
(keybind O_COPY_PICK                    ($R5))
(keybind O_COPY_PICK                    ($esc "c "p))
(keybind O_MOVE                         ($esc "m "o))
(keybind O_MOVE                         ($R13 $R2))
(keybind O_PICK                         ($esc "p "i))
(keybind O_PICK                         ($R2))
(keybind O_PUT_PICK                     ($esc "p "p))
(keybind O_PUT_PICK                     ($R11))
(keybind O_RETURN                       (C-M))
(keybind case-word-capitalize           (C-W))
(keybind case-word-lower                (C-L))
(keybind case-word-upper                (C-U))
(keybind go_to_next_tab                 ($tab))
(keybind transpose-characters           (C-T))
}}}
{{{  macros
(keybind O_DEFINE_FIX                   ($esc "d "f))
(keybind O_DEFINE_MACRO                 ($esc "d "m))
(keybind O_DEFINE_MACRO                 ($R13 "d "m))
(keybind O_EXECUTE_MACRO                ($esc "c "m))
(keybind O_EXECUTE_MACRO                ($R13 "m))
(keybind execute-macro-1                ($esc "m "1))
(keybind execute-macro-2                ($esc "m "2))
(keybind execute-macro-3                ($esc "m "3))
(keybind execute-macro-4                ($esc "m "4))
(keybind execute-macro-5                ($esc "m "5))
(keybind execute-macro-6                ($esc "m "6))
(keybind execute-macro-7                ($esc "m "7))
(keybind execute-macro-8                ($esc "m "8))
(keybind execute-macro-9                ($esc "m "9))
}}}
{{{  deletes
(keybind O_DELETE                       (C-H))
(keybind O_DEL_CHAR_RIGHT               (C-?))
(keybind O_DEL_LINE                     ($R13 $R9))
(keybind O_DEL_LINE                     ($esc "d "l))
(keybind O_DEL_TO_EOL                   ($esc "d "e))
(keybind O_UNDEL_CHAR                   ($esc "u "c))
(keybind O_UNDEL_LINE                   ($esc "u "l))
(keybind delspaces                      ($esc C-?))
(keybind append-to-previous-line        ($esc C-H))
}}}
{{{  finds
(keybind O_FIND                         ($esc "f "i))
(keybind O_FIND_REVERSE                 ($esc "f "r))
(keybind incremental-search             ($esc "i "s))
(keybind incremental-search             ($R13 "f))
(keybind query-replace-string           ($esc "r "p))
(keybind query-replace-string           ($R13 "r))
}}}
{{{  specials
(keybind O_HELP                         ($esc "h "e))
(keybind O_HELP                         ($R13 "h))
(keybind O_REFRESH                      ($esc $esc))
(keybind O_REFRESH                      ($R13 $R13))
(keybind abort                          (C-\))
(keybind describe-bindings              ($R13 "?))
(keybind describe-bindings              ($esc "h "b))
}}}
{{{  shells/filter
(keybind O_FINISH                       ($esc "f "n))
(keybind O_SHELL                        ($esc "s "h))
(keybind O_QUIT                         ($esc "q "u))
(keybind O_QUIT                         ($R13 "q))
(keybind filter-buffer                  ($esc "f "b))
(keybind pipe-from-command              ($esc "< "p))
(keybind pipe-to-command                ($esc "> "p))
(keybind shell-command                  ($esc "s "c))
(keybind suspend-origami                (C-S))
(keybind lookup                         ($esc "l "o))
}}}
{{{  files
(keybind O_INSERT_FILE                  ($esc "i "n))
(keybind O_INSERT_FILE                  ($R13 "i))
(keybind O_OPEN_NEW_FILE                ($esc "o "f))
(keybind O_OPEN_NEW_FILE                ($R13 "o))
(keybind O_SAVE_FILE                    ($esc "s "a))
(keybind O_SAVE_FILE                    ($R13 "s))
(keybind next-file                      ($esc "n "f))
(keybind previous-file                  ($esc "p "f))
(keybind write-file                     ($esc "w "f))
(keybind write-file                     ($R13 "w))
}}}
{{{  modes
(keybind O_LANGUAGE                     ($esc "l "a))
(keybind O_LANGUAGE                     ($R13 "l))
(keybind add-mode-autosave              ($esc "+ "a))
(keybind add-mode-echo                  ($esc "+ "e))
(keybind add-mode-overwrite             ($esc "+ "o))
(keybind add-mode-overwrite             ($R13 $Ins))
(keybind add-mode-view                  ($esc "+ "v))
(keybind delete-mode-autosave           ($esc "- "a))
(keybind delete-mode-echo               ($esc "- "e))
(keybind delete-mode-overwrite          ($esc "- "o))
(keybind delete-mode-overwrite          ($Ins))
(keybind delete-mode-view               ($esc "- "v))
(keybind reset-user-mode                ($esc "- "u))
(keybind set-user-mode                  ($esc "+ "u))
(keybind define-tab                     ($esc $tab))
}}}
{{{  arguments
(keybind set-argument-0                 ($esc "0))
(keybind set-argument-0                 ($R13 "0))
(keybind set-argument-1                 ($esc "1))
(keybind set-argument-1                 ($R13 "1))
(keybind set-argument-2                 ($esc "2))
(keybind set-argument-2                 ($R13 "2))
(keybind set-argument-3                 ($esc "3))
(keybind set-argument-3                 ($R13 "3))
(keybind set-argument-4                 ($esc "4))
(keybind set-argument-4                 ($R13 "4))
(keybind set-argument-5                 ($esc "5))
(keybind set-argument-5                 ($R13 "5))
(keybind set-argument-6                 ($esc "6))
(keybind set-argument-6                 ($R13 "6))
(keybind set-argument-7                 ($esc "7))
(keybind set-argument-7                 ($R13 "7))
(keybind set-argument-8                 ($esc "8))
(keybind set-argument-8                 ($R13 "8))
(keybind set-argument-9                 ($esc "9))
(keybind set-argument-9                 ($R13 "9))
}}}
{{{  bindings for standards and modes
(automacro start-up)
(keybind skip-mode ($esc "s "m))
(keybind standard-up ($esc "s "u))
(keybind standard-down ($esc "s "d))
(keybind standard-filter ($esc "s " ))
}}}
