// ************************************************************************ // // KEYS.VDM (C) C.Z. 03.07.94 // 20.07.95 // // ************************************************************************ // // several useful key macros ... // // ************************************************************************ // Collect lines: // -------------- // F11 delete text register 1 // F12 append the actual line to text register 1 // // Key_Add("F11","[VISUAL EXIT] Reg_Empty(1)",OK) // Key_Add("F12","[MENU]Gc1[RETURN][T-REG COPY][CURSOR DOWN][T-REG COPY]+1",OK) // // or: ... and delete the line in the original text // // Key_Add("F12","[MENU]Gc1[RETURN][T-REG MOVE][CURSOR DOWN][T-REG MOVE]+1",OK) // ************************************************************************ // Handle C comments: // ------------------ // F11 delete C comments /*...*/ // F12 comment out the actual line with C comments from cursor pos. to end // // Key_Add('F11',' [VISUAL EXIT] DOV("\LE\") #0=CP BOL SB("/*",CP,#0,NOERR) if (EF){L(1,NOERR) Return()} DC(2) S("*/",NOERR) DC(2) L(1,NOERR)',OK) // Key_Add('F12',' [VISUAL EXIT] #1=WH IT("/*") DOV("\LB\") DOV("\LE\") IT("*/") L(1,NOERR) repeat (#1-1){DOV("\CR\")}',OK) // ************************************************************************ // Align the actual line on cursor: // -------------------------------- // F11 delete blanks on cursor position, up to a non blank. // then move the cursor down for repetition // F12 insert blanks to align the word on or left from the cursor to align // the word with the cursor position. // then move the cursor down for repetition // // Key_Add('Alt-F11',' [VISUAL EXIT] repeat(ALL){ if (CC<>32){Break}else{DC(1)}} DOV("\CD\")',OK) // Key_Add('Alt-F12',' [VISUAL EXIT] #1=WH #2=CL DOV("\CR\") DOV("\PW\") if (CL<>#2){Return} #0=#1-WH repeat(ALL) {if (#0==0){Break} IT(" ") #0-=1 } DOV("\CD\")',OK) // ************************************************************************