!* * Here we define some reasonable default function key macros. * Their corresponding command-line editing macros begin with . *! !* * Edit command line to move chars, updating existing move ops. * The command line at the time of call looks like: (123C)(M[FOO *! @#c{{U.c <-A-("=-D1;' -D> .-4"< Oins ' -2A-C"N -2A-R"N Oins ' ' -A-)"N Oins ' \U.v .-1,Z-2D 0A-R"=-'Q.v%.c 2D !ins! I( Q.c"> Q.c\IC | -Q.c\IR ' I) }} !* * Make DELETE an ESCAPE surrogate. * Macro is enabled everywhere. *! @[ DC]{} !* * Make SHIFT+DELETE a rubout/re-insert key. * This reverses the ^G modifier for BACKSPACE. * The macro is enabled everywhere. *! @[ SDC]{} !* * Command line editing macros. * They are enabled only in the start state (i.e. they * have no effect in string arguments, etc.). *! @[HOME]{ 0+.U.p Q.pU.l Q.pESGETCOLUMN,4EJ Q.p-.M#c } @[ HOME]{(M[HOME]} 1U[ HOME] @[END]{ :-1ESGETLINEENDPOSITIONU.p Q.pESGETCOLUMN,4EJ Q.p:-.M#c } @[ END]{(M[END]} 1U[ END] @[NPAGE]{ 0,4EJ :-1+ESLINESONSCREEN ESPOSITIONFROMLINEU.p Q.p"< Z | Q.p: '-.M#c } @[ NPAGE]{(M[NPAGE]} 1U[ NPAGE] @[PPAGE]{ 0,4EJ :-1-ESLINESONSCREENU.l Q.l"< 0 | Q.lESPOSITIONFROMLINE: '-.M#c } @[ PPAGE]{(M[PPAGE]} 1U[ PPAGE] @[LEFT]{ ."=0|.-1'U.p Q.pESGETCOLUMN,4EJ Q.p-.M#c } @[ LEFT]{(M[LEFT]} 1U[ LEFT] @[SLEFT]{ 1,0,ESWORDSTARTPOSITIONESWORDSTARTPOSITIONU.p Q.pESGETCOLUMN,4EJ Q.p:-.M#c } @[ SLEFT]{(M[SLEFT]} 1U[ SLEFT] @[RIGHT]{ .-Z"=.|.+1'U.p Q.pESGETCOLUMN,4EJ Q.p-.M#c } @[ RIGHT]{(M[RIGHT]} 1U[ RIGHT] @[SRIGHT]{ 0,1,ESWORDENDPOSITIONESWORDENDPOSITIONU.p Q.pESGETCOLUMN,4EJ Q.p:-.M#c } @[ SRIGHT]{(M[SRIGHT]} 1U[ SRIGHT] @[UP]{ 4EJ,:-2ESFINDCOLUMN:-.M#c } @[ UP]{(M[UP]} 1U[ UP] @[DOWN]{ 4EJ,:ESFINDCOLUMN:-.M#c } @[ DOWN]{(M[DOWN]} 1U[ DOWN] @[ CLOSE]{(EX)} 1U[ CLOSE] !* * F1 toggles __all__ folds. *! @[ F1]{(2ESFOLDALL{-14D}} 1U[ F1] !* * Zoom with F9/F10 if function keys are enabled. * This is automatically rubbed out. *! @[ F9]{(ESZOOMOUT{-13D}} 1U[ F9] @[ F10]{(ESZOOMIN{-12D}} 1U[ F10] !* * Mouse integration. * Might be disabled unless bit 7 (64) is enabled in ED. * * Left click: Edit command line to jump to position. * Ctrl+left click: Jump to beginning of line. * Right click: Insert position or position range (when dragging). * Double right click: insert range for word under cursor * Ctrl+right click: Insertion beginning of line * Scroll wheel: scrolls (faster with shift) * Ctrl+scroll wheel: zoom (GTK-only) * * Also, you can click on the folding margin to toggle folds. *! @[MOUSE]{ -2EJESCHARPOSITIONFROMPOINTU.p -2EJU.x ESGETMARGINLEFTU.r ESGETMARGINS< Q.rU.l Q.iESGETMARGINWIDTHN%.r Q.x-Q.l+1"> Q.x-Q.r"< !* mouse within margin i *! Q.iESGETMARGINMASKN&(-33554432)"N !* folding margin *! -EJ-1"= !* mouse released *! Q.pESLINEFROMPOSITIONESTOGGLEFOLD {-9D} ' ' 1; !* handle like click in text area *! ' ' %.i> -4EJ&2"N Q.pESLINEFROMPOSITIONESPOSITIONFROMLINEU.p ' 1,Q.pESWORDSTARTPOSITION:U.#ws 1,Q.pESWORDENDPOSITION:U.#we Q.p:U.p -EJOpressed,released,scrollup,scrolldown !pressed! !* left click *! -3EJ-1"= Q.pESGETCOLUMN,4EJ Q.p-.M#c !* not reached *! ' { -9D !* right click *! -3EJ-3"= Q.p"U I(\.p ' ' !* middle click *! -3EJ-2"= :Q~"U I(g~) ' ' } !released! { -9D -3EJ-3"= Q.p"U !* right click *! <-A-("=1;'R> \U.o Q.o-Q.p"= .-1"> -2A-)"= R <-A-("=1;'R> \-Q.p"= !* double right-click *! .,ZD I\.#ws,\.#we ' ' ' ZJ I) | Q.o-Q.p"> Q.o,Q.p U.oU.p ' !* right drag *! .,ZD I\.o,\.p) ' ' ' } !scrollup! -4EJ&2"= -4EJ&1"=-2|-4',0ESLINESCROLL | ESZOOMIN ESSCROLLCARET ' {-9D} !scrolldown! -4EJ&2"= -4EJ&1"=2|4',0ESLINESCROLL | ESZOOMOUT ESSCROLLCARET ' {-9D} } @[ MOUSE]{(M[MOUSE]} 1U[ MOUSE]