home *** CD-ROM | disk | FTP | other *** search
/ High Voltage Shareware / high1.zip / high1 / DIR8 / VMAC.ZIP / VDEMACRO.LIB next >
Text File  |  1993-07-31  |  37KB  |  720 lines

  1.  
  2.                        A SMALL LIBRARY OF MACROS FOR VDE
  3.                           for compilation by VMAC.COM
  4.                                  Richard Cowell
  5.  
  6.  
  7. THE PURPOSE of this library is to provide people who are disinclined to 
  8.     learn VDE macro code, or who have no time to work out macros, with a 
  9.     way to save time on some editing chores. These macros do simple, 
  10.     practical things -- nothing fancy. If you are a macro adept, they may 
  11.     hold no surprises for you.
  12.  
  13. TO USE the library:
  14.     * Copy the macro you need to a .VTF or .VTK file.
  15.     * Type in the key name and make sure it's in the proper order.
  16.     * Compile the file with VMAC.COM.
  17.     * Load the resulting .VDF or .VDK file into VDE with the <Alt U> 
  18.     command.
  19.  
  20. SMALL CHANGES may be required in some macros to suit your needs. For 
  21.     example, you may need to change the ^PS print toggle/switch to the one 
  22.     you want, or you may want to adjust the Insert status (insert, 
  23.     overwrite, word insert) or the Auto-format status at the end of a macro. 
  24.  
  25. *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
  26.  
  27. The macros are grouped under the following headings:
  28.  
  29.          CHARACTERS
  30.          WORDS
  31.          LINES
  32.          SENTENCES
  33.          PARAGRAPHS
  34.          FILE
  35.          MISCELLANEOUS
  36.  
  37.  
  38. ________________________________________________________________________________
  39. *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*  CHARACTERS  *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
  40. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  41. Transpose Characters Right
  42.  
  43. [ ] B = ^G^D^U
  44.  
  45. --------------------------------------------------------------------------------
  46. Transpose Characters Left
  47.  
  48. [ ] B = ^G^S^U
  49.  
  50. --------------------------------------------------------------------------------
  51. CUre the DOuble-CAp BLues.
  52.     IF you notice farther down the line that you didn't lift your finger 
  53.     off the shift key fast enough and typed two capital letters instead of 
  54.     one, this macro will go back and change the second one to a small 
  55.     letter and return the cursor to the end of the line.
  56.     This requires VDE Version 1.63+.
  57.  
  58. [ ] B = ^A[Esc]>Z[[Esc]<A[         ;; Word left. If not capital letter, Start.
  59.       = ^D[Esc]>Z[[Esc]<A[         ;; Right. If not capital letter, Start.
  60.       = ^^^Qd                      ;; Change case, End of line.
  61.  
  62.  
  63. ________________________________________________________________________________
  64. *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=* WORDS *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
  65. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  66. Transpose Words Right:
  67.  
  68. [ ] B = ^T^F^U
  69.  
  70. --------------------------------------------------------------------------------
  71. Transpose Words Left:
  72.  
  73. [ ] B = ^T^A^U
  74.  
  75. --------------------------------------------------------------------------------
  76. Change Word to Upper Case (and go to next word)
  77.     This macro changes the word under the cursor to upper case. If the 
  78.     cursor is on whitespace, it changes the previous word, so it will 
  79.     change the word you've just typed. This requires VDE Version 1.63+.
  80.  
  81.     For lower case, change (") --> (').
  82.     To toggle case, change (") --> (`^).  Notice the special character here.
  83.  
  84. [ ] B = [Esc]$1[Esc]<!1^D            ;; Set error. If whitespace, 1). Else Right
  85.       = [Esc]1^A^KB^F^KK^K"^QK^KH    ;; 1) Word left, Mark & Change. Unmark.
  86.       = [Esc]~^M]^F                  ;; If end of line, Word right.
  87.  
  88. --------------------------------------------------------------------------------
  89. End of Word
  90.     This macro puts the cursor at the end of the current word, and
  91.     if called repeatedly, it steps along the ends of succeeding words.
  92.     This requires VDE Version 1.63+.
  93.  
  94. [ ] B = ^D[Esc]> 1^F                 ;; If next char is whitespace, Next word
  95.       = [Esc]1^D[Esc]> 1^S           ;; Go right until whitespace. Left.
  96.  
  97. --------------------------------------------------------------------------------
  98. Quick Underlining (etc.) of words and phrases.
  99.     The first macro puts an underline print code (^PS) at the start of the 
  100.     word under the cursor, and goes to the whitespace at the end of the 
  101.     word. If called again immediately, it jumps to the end of the next 
  102.     word, and so on until the end of the line.
  103.  
  104.     The second macro puts another underline print code at the end of the 
  105.     word just before the cursor. (If there is a punctuation mark at the end 
  106.     of the word, it puts the code in front of it.)
  107.  
  108.     These macros are very easy to use when assigned to adjacent function 
  109.     keys. Change ^PS to the printer code(s) you want to use, e.g. ^PB^PS.
  110.  
  111.     This requires VDE Version 1.63+.
  112.  
  113. [ ] B = [Esc]> 1[Esc]=^M]            ;; If not whitespace, 1). If CR, done.
  114.       =    ^F[Esc]=^M][Esc]!2        ;;    Word right. If CR, done. Else 2)
  115.       = [Esc]1^D^A^PS                ;; 1) Go to start of word. Underline.
  116.       = [Esc]2^F[Esc]<!]^S[Esc]<!]   ;; 2) Wrd rgh. If < !,done. Left. If < !,done
  117.       =    ^F[Esc]!2                 ;;    Wrd rgh. Try again at 2).
  118.  
  119. [ ] B = ^S[Esc]<![                   ;; Left to non-whitespace character
  120.       = [Esc]<a2[Esc]>z2
  121.       = [Esc]1^D^PS[Esc]!4           ;; 1) [Letters & Numbers]: Right, Underline.
  122.       = [Esc]2[Esc]<03[Esc]<:1
  123.       =    [Esc]<A3[Esc]<[1
  124.       = [Esc]3^Ps                    ;; 3) [Other]: Underline
  125.       = [Esc]4^F                     ;; 4) Word right
  126.  
  127.  
  128. ________________________________________________________________________________
  129. *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=* LINES *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
  130. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  131. Transpose Lines Down:
  132.  
  133. [ ] B = ^Y^X^U
  134.  
  135. --------------------------------------------------------------------------------
  136. Transpose Lines Up:
  137.  
  138. [ ] B = ^Y^E^U
  139.  
  140. --------------------------------------------------------------------------------
  141. Split Line at Cursor, deleting any spaces immediately in front of cursor
  142.  
  143. [ ] B = ^S[Esc]= <^D[Esc]~ 1^T[Esc]1^N
  144.  
  145. --------------------------------------------------------------------------------
  146. Change Whole Line to Upper Case
  147.     For lower case, change (") --> (').
  148.     To toggle case, change (") --> (`^).  Notice the special character.
  149.  
  150. [ ] B = ^QS^KB^QD^KK^K"^KH^X
  151.  
  152. --------------------------------------------------------------------------------
  153. Change Line to Upper Case from start to cursor
  154.  
  155.     For lower case, change (") --> (').
  156.     To toggle case, change (") --> (`^).  Notice the special character.
  157.  
  158. [ ] B = ^KK^QS^KB^K"^QK^KH
  159.  
  160. --------------------------------------------------------------------------------
  161. Indent Current Line to Next Tab Stop
  162.  
  163. [ ] B = [Esc]$1[Esc]*i^QS^S^M                ;; Give previous line hard CR.
  164.       = [Esc]1[Esc]= >[Esc]*F[Esc]*I^I       ;; Go to non-space char. Tab.
  165.     { = [Esc]*f[Esc]*i }                     ;; {Change settings, if desired}
  166.  
  167. --------------------------------------------------------------------------------
  168. Indent Current Line to First Tab Stop
  169.     This assumes the current line starts at, or to the right of, the left 
  170.     margin.
  171.  
  172. [ ] B = [Esc]$1^QS^S[Esc]*i^M                ;; Give previous line hard CR
  173.       = [Esc]1[Esc]$2^B^E                    ;; Reformat. Up
  174.       = [Esc]2[Esc]$4^QS^S[Esc]$3^S[Esc]= 2  ;; Beginning of paragraph.
  175.       =     ^D[Esc]3^D
  176.       = [Esc]4[Esc]*I ^H^I                   ;; Ins on. Cursor to LM. Tab
  177.       =    [Esc]~ ]^T                        ;; If no space, done. Del spaces.
  178.                                  --- The following lines can be used in place
  179.                                  --- of the last line to change the settings
  180.     { =    [Esc]~ 5^T                        ;; If no space, 5). Del spaces. }
  181.     { = [Esc]5[Esc]*i                        ;; Turn Ins off                 }
  182.  
  183. --------------------------------------------------------------------------------
  184. Enhance Whole Line
  185.     This macro brackets the non-space characters on a line with printer 
  186.     codes.
  187.     Change ^PS to the printer code or codes you want to use.
  188.  
  189. [ ] B = ^QS[Esc]~ 1^F[Esc]1^PS  ;; Put code in front of 1st non-space character
  190.       = ^QD^S[Esc]= <^D^PS      ;; Put code after last non-space character
  191.  
  192. --------------------------------------------------------------------------------
  193. Center and Enhance
  194.     This macro centers a line and brackets it with printer codes.
  195.     Subsitute the printer codes you want to use for ^PS, e.g. ^PS^PB.
  196.  
  197. [ ] B = ^OC^S^QD^PS             ;; Center. Go to end of centered line. Code      = ^Qs[Esc]~ 1^F                 ;; Go to first character
  198.       = ^QS[Esc]~ 1^F           ;; Go to first character
  199.       = [Esc]1^PS^X^QS          ;; Code. Down. Beginning of line.
  200.  
  201. --------------------------------------------------------------------------------
  202. Center a Line of Double-Width Characters.
  203.     This assumes that you have assigned the printer control code for double- 
  204.     width characters to ^PD. If not, change 'D' to the appropriate letter.
  205.     If you want to add other printer codes like underlining, change ^PD to 
  206.     ^PD^PS or whatever.
  207.  
  208. [ ] B = [Esc]*f^QS[Esc]~ 1^F               ;; Auto-format off.  Go to 1st char
  209.       = [Esc]1^KB^QD                       ;; Left mark. End
  210.       = [Esc]2^S[Esc]~ 3^G[Esc]!2[Esc]3^D  ;; Delete trailing spaces
  211.       = ^KK^KC^OC                          ;; Right mark. Copy. Center.
  212.       = ^KY^PD^QD^PD                       ;; Del block, Code. End. Code.
  213.                                            ;; (^Ky moves cursor to 1st char)
  214.       = [Esc]*F                            ;; Turn auto-format on
  215.                                      { The last line can be deleted if desired }
  216.  
  217.          Operational note: Copying the line to double the length before 
  218.          centering yields accurate results even when proportional spacing is 
  219.          in effect, unlike methods that count the number of characters and 
  220.          use an equal number of spaces at the end of the line.
  221.  
  222. --------------------------------------------------------------------------------
  223.                                  Vertical Line
  224.  
  225.     In both pairs of macros, the first one sets one tab at the cursor 
  226.     position, and then chains to the second macro. Since the No-Repeat mode 
  227.     is not specified for the second one, you will be prompted for the 
  228.     number of times to repeat i.e. the length of the line. You may need to 
  229.     reset the insert status and the tabs after using these macros.
  230.  
  231.     Possible changes:
  232.         1)  The key name of the second macro can be changed to any letter 
  233.             or number key. (Function keys cannot be used for chaining.) If 
  234.             it is changed, be sure to change the X in the [Esc]&X command of 
  235.             the first macro.
  236.         2)  You should substitue the character you want to use for @GV, for 
  237.             example | or @GL.
  238.  
  239. Vertical Line (Overwrite Mode).
  240.     This macro overwrites any characters that happen to be where the line is 
  241.     drawn. 
  242.     For VDE version prior to 1.63, change ^ON* to ^OI#
  243.  
  244.  
  245. [ ] B = [Esc]*f[Esc]*i^ON*^M^OI^M  ;; AF off. Ins off. Clear tabs. Set tab.
  246.       = [Esc]&X                    ;;  chain to [X]
  247. [X] Q = @GV^M^I                    ;; Write character, CR, Tab.
  248.  
  249.  
  250. Vertical Line (Insert Mode).
  251.     This macro shifts any characters that happen to be where the line is 
  252.     drawn one column to the right.
  253.     For VDE version prior to 1.63, change ^ON* to ^OI#
  254.  
  255. [ ] B = [Esc]*f^ON*^M^OI^M       ;; AF off. Clear tabs. Set tab at cursor.
  256.       = [Esc]&X                  ;;   chain to [X]
  257. [X] Q = [Esc]*I@GV[Esc]*i^M^I    ;; Ins on. Write character. Ins off. CR, Tab.
  258.  
  259.  
  260. ________________________________________________________________________________
  261. *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*  SENTENCES  *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
  262. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  263. Beginning of Sentence (1).
  264.     This assumes sentences end with a period.
  265.     This requires VDE Version 1.63+.
  266.  
  267. [ ] B = ^A[Esc]<![                 ;; Word left. If whitespace, GoTo start.
  268.       = [Esc]~.<                   ;; Go back to previous period
  269.       = ^D[Esc]> [                 ;; If next char not whitespace, GoTo start.
  270.       = [Esc]2^D[Esc]<!2           ;; Go forward past whitespace
  271.  
  272. ------------------------------------------------------------------------------------------------------------------------
  273. Beginning of Sentence (2).
  274.     This assumes sentences end with a period or question mark. This macro is 
  275.     slower than the previous one.
  276.     This requires VDE Version 1.63+.
  277.  
  278. [ ] B = ^A[Esc]<![                 ;; Word left. If whitespace, GoTo start.
  279.       = [Esc]1^S[Esc]=?2[Esc]~.1   ;; 1) Left. If '?',2). If not '.', 1)
  280.       = ^D[Esc]> [                 ;; If char. after '.' is not white,GoTo start
  281.       = [Esc]2^D[Esc]<!2           ;; 2) Go forward past whitespace
  282.  
  283. --------------------------------------------------------------------------------
  284. Next Sentence (1).
  285.     This assumes sentences end with a period.
  286.     This requires VDE Version 1.63+.
  287.  
  288. [ ] B = [Esc]~.>                   ;; Go forward to period
  289.       = ^D[Esc]<!1^F[Esc]![        ;; If next char. whitespace, 1),else Start
  290.       = [Esc]1^D[Esc]<!1           ;; Go forward past whitespace
  291.  
  292. --------------------------------------------------------------------------------
  293. Next Sentence (2).
  294.     This assumes sentences end with a period or question mark. This macro is 
  295.     slower than the previous one.
  296.     This requires VDE Version 1.63+.
  297.  
  298. [ ] B = [Esc]>?1[Esc]=.2[Esc]=?3   ;; If > '?', 1).   If '.', 2).   If '?', 3).
  299.       = [Esc]1^D[Esc]![            ;; 1) Forward. GoTo Start.
  300.       = [Esc]2^D[Esc]> 1           ;; 2) If char after '.' not white, 1)
  301.       = [Esc]3^D[Esc]<!3           ;; 3) Go forward past whitespace
  302.  
  303. --------------------------------------------------------------------------------
  304. Transpose Sentences Right.
  305.     This assumes sentences end with a period. The cursor can be anywhere in 
  306.     the first sentence.
  307.     This requires VDE Version 1.63+.
  308.     NOTE: If auto-format is off, you will probably need to reformat the 
  309.     paragraph.
  310.  
  311.                                   --- Beginning of Sentence
  312. [ ] B = [Esc]$1[Esc]~.<           ;; Go back to previous period. If none, 1).
  313.       =    ^D[Esc]<!0             ;;    If next char whitespace, 1)
  314.       =    ^A[Esc]![              ;;    Word left. GoTo start.
  315.       = [Esc]0^D[Esc]1[Esc]<!0          ;; 1) Go forward past whitespace
  316.       =    ^KB                    ;;    Left mark.
  317.                                   --- End of Sentence
  318.       = [Esc]2[Esc]$][Esc]~.>     ;; 2) Go forward to period
  319.       =    ^D[Esc]> 2             ;;    If next char not whitespace, 2)
  320.       =    ^D^KK                  ;;    Right. Right mark
  321.                                   --- Delete Whitespace
  322.       = [Esc](1)[Esc]> 3^T        ;; Count=1. If not white, 3), else del word
  323.                                   --- End of Next Sentence
  324.       = [Esc]3[Esc]$4[Esc]~.>     ;; 3) Go forward to period
  325.       =    ^D[Esc]=^M4            ;;    Right. If EOF or CR 4)
  326.       =       [Esc]<!5[Esc]!3     ;;           If white, 5), else 3)
  327.       = [Esc]4^_[Esc]+            ;; 4) Insert space. Count+
  328.       = [Esc]5^D                  ;; 5) Skip space.
  329.                                   --- Move
  330.       = [Esc]6^KV^QK^KH[Esc]-]^H  ;; 6) Move. GoTo Right Mark. If EOF or CR was
  331.                                         found, delete final space.          
  332.  
  333.  
  334. ________________________________________________________________________________
  335. *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*  PARAGRAPHS  *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
  336. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  337. Beginning of Paragraph
  338.     This macro puts the cursor at the beginning of a paragraph. If it's 
  339.     already at the beginning, it goes to the start of the previous 
  340.     paragraph.
  341.  
  342. [ ] B =  ^S[Esc]=^M<                 ;; Left. Skip CRs
  343.       =  [Esc]1^QS^S^S[Esc]= 1^D^D   ;; Go to beginning of paragraph
  344.  
  345. --------------------------------------------------------------------------------
  346. End of Paragraph
  347.     This macro puts the cursor on the CR at the end of a paragraph. If 
  348.     it's already at the end, it goes to the end of the next paragraph.
  349.  
  350. [ ] B = [Esc]=^M>[Esc]1^D^D^QD^S[Esc]= 1^D
  351.  
  352. --------------------------------------------------------------------------------
  353. Next Paragraph
  354.  
  355. [ ] B = ^D[Esc]1^D^D^QD^S[Esc]= 1     ;; Go to end of paragraph
  356.       = ^D[Esc]=^M>[Esc]= >           ;; Skip CRs and spaces
  357.  
  358. --------------------------------------------------------------------------------
  359. Transpose Paragraphs Down.
  360.  
  361. [ ] B = [Esc]$2^QS^S[Esc]$1^S[Esc]= [         ;; Beginning of paragraph.
  362.       =    ^D[Esc]1^D
  363.       = [Esc]2^KB                             ;; Left block mark.
  364.       = [Esc]3^D^D^QD^S[Esc]= 3               ;; End of paragraph.
  365.       =    ^D^D[Esc]~^M4^D
  366.       = [Esc]4^KK[Esc]=^M>[Esc]$6             ;; Rgh. Rgh mark. Skip blank lines
  367.       = [Esc]5^D^D^QD^S[Esc]= 5               ;; End of paragraph. Right.
  368.       =    ^D^D[Esc]~^M7^D[Esc]!7
  369.       = [Esc]6^M                              ;; If end of file, CR.
  370.       = [Esc]7^KV^KH                          ;; Move. Unmark.
  371.  
  372. --------------------------------------------------------------------------------
  373. Soften Paragraph (1).
  374.     This assumes that the left margin is at Column 1, and that a new 
  375.     paragraph is indicated either by indentation or a blank line. The 
  376.     cursor should be placed on the first line of the paragraph.
  377.  
  378. [ ] B = ^QD^D[Esc]=^M][Esc]= ]     ;; Start of next line. If CR or space, done
  379.       =   ^S^S[Esc]= 1^D`          ;; Go back. If soft CR, 1). Else add space
  380.       =   [Esc]1^D^D[Esc]![        ;; Go to next line. Go back to Start
  381.  
  382. --------------------------------------------------------------------------------
  383. Soften Paragraph (2).
  384.     This assumes that paragraphs are separated by blank lines. The left 
  385.     margin can be anywhere. The cursor should be placed on the first line 
  386.     of the paragraph.
  387.  
  388. [ ] B = ^QD^D[Esc]=^M]          ;; Start of next line.  If blank, done
  389.       =   ^S^S[Esc]= 1^D`       ;; Go back. If soft CR, 1). Else add space
  390.       =   [Esc]1^D^D[Esc]![     ;; Go to next line. Go back to Start
  391.  
  392. --------------------------------------------------------------------------------
  393. Outdent Paragraph
  394.     This assumes the left margin (LM) is at Column 1 or a tab stop. The 
  395.     cursor can be anywhere in the paragraph.
  396.  
  397.                LM  Tab                          LM  Tab
  398.             ____|___|______________          ____|___|______________
  399.            │                       │        │                       │
  400.            │    AAAAAA bbb cccc    │        │    AAAAAA bbb cccc    │
  401.            │    ddddd eee ff gg    │  ===>  │        ddddd eee ff   │
  402.            │    hhhh iiiiii        │        │        gg hhhh iiiiii │
  403.            │_______________________│        │_______________________│
  404.                                                                     
  405. [ ] B = [Esc]$2^QS^S[Esc]$1^S[Esc]= [   ;; Beginning of paragraph.
  406.       =    ^D[Esc]1^D
  407.       = [Esc]2[Esc]$]^QD^S[Esc]~ 3^QS   ;; If 1st line ends in hard CR, 3)
  408.       =    [Esc]*F^OG[!Tab]             ;; AF on. parGrph Tab, Shift-Tab
  409.       =    [Esc]~ 3^T                   ;; If 1st char is space, del spaces
  410.       = [Esc]3^B                        ;; 3) Reformat
  411.  
  412.                                         This line can be added if desired.
  413.     { = [Esc]*f                         ;; Turn Auto-format off     }
  414.  
  415. --------------------------------------------------------------------------------
  416. Start New Indented Paragraph at cursor.
  417.     This macro splits the line at the cursor and indents the new line
  418.  
  419. [ ] B = [Esc]*I                       ;; Ins on
  420.       = [Esc]= 1^S                    ;; If space, 1). Left.
  421.       =   [Esc]1[Esc]= <^D[Esc]~ 2^T  ;; 1) remove spaces in front of cursor
  422.       =   [Esc]2^M^I                  ;; 2) split line, indent new line
  423.       = ^E^QD                         ;; Return to end of previous line
  424.  
  425.                                   One of these lines can be added if desired.
  426.     { = [Esc]*i                       ;; Turn Ins off   }
  427.     { = [Esc]*W                       ;; Turn WIns on   }
  428.  
  429. --------------------------------------------------------------------------------
  430. Block Paragraph Reformat
  431.     This macro sets the left margin to the start of the paragraph before 
  432.     reformatting. It's useful if you use various left margin settings in 
  433.     one document.
  434.  
  435. [ ] B = [Esc]$2^QS^S[Esc]$1^S[Esc]= [   ;; Beginning of paragraph.
  436.       =     ^D[Esc]1^D
  437.       = [Esc]2[Esc]= >                  ;; Skip spaces
  438.       = ^OL^M^B                         ;; Set left margin. Reformat.
  439.  
  440.  
  441. ________________________________________________________________________________
  442. *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=* FILE *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
  443. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  444.      The range of these macros can be limited with the Zoom feature of VDE.
  445.  
  446. --------------------------------------------------------------------------------
  447. Remove All Blank Lines from a file                     (EOF = end of file)
  448.  
  449. [ ] B = [Esc]$Z^QR                   ;; Set error. Beginning of file
  450.       = [Esc]1[Esc]=^M2              ;; 1) If blank line, 2)
  451.       =    ^X[Esc]!1                 ;;      Next line. Loop back to 1).
  452.       = [Esc]2^Y^X^E[Esc]!1          ;; 2) Delete blank. Check for EOF. 1)
  453.       = [Esc]Z^QR                    ;; Beginning of file
  454.  
  455. --------------------------------------------------------------------------------
  456. Remove Leading Spaces from all lines in a file.
  457.     This macro makes every line flush against the left side of the screen.
  458.  
  459. [ ] B = [Esc]*f[Esc]$Z^QR          ;; AF off. Set error. Beginning of file
  460.       = [Esc]1[Esc]~ 2^T           ;; 1) If not space, 2), else Del word right
  461.       = [Esc]2^X[Esc]!1            ;; 2) Down. Loop back to 1)
  462.       = [Esc]Z^QR[Esc]*F           ;; Beginning of file. Auto-format on.
  463.                                       { [Esc]*F can be deleted if desired }
  464.  
  465. --------------------------------------------------------------------------------
  466. Auto-Numbering starting at 1, from cursor to end of file
  467.  
  468. [ ] B = ^KB^QC^KK                 ;; left mark, GoTo end of file, right mark
  469.       = ^K#1^M                    ;; auto-number starting at 1
  470.       = ^QB^KH                    ;; GoTo left mark, unmark
  471.  
  472. --------------------------------------------------------------------------------
  473. Remove Extra Spaces from ends of lines
  474.     This macro cleans up the ends of lines prior to reformating or prior to 
  475.     printing by removing all but one space at the ends of lines with a soft 
  476.     CR.
  477.  
  478. [ ] B = [Esc]*f[Esc]$Z^QR            ;; AF off. Set error. Beginning of file.
  479.       = [Esc]1^D^D^D^QD              ;; 1) Right(3x), End of line.
  480.       =   ^S[Esc]~ 1                 ;;    Left. If not space, 1)
  481.       = [Esc]2^S[Esc]~ 1^G[Esc]!2    ;; 2) Left. If not space, 1), else Del, 2)
  482.       = [Esc]Z^QR[Esc]*F             ;; Beginning of file. Auto-format on.
  483.                                         { [Esc]*F can be deleted if desired }
  484.  
  485. --------------------------------------------------------------------------------
  486. Reformat Indented Paragraphs (single-spaced text)
  487.     This macro preserves the indentation of single lines ending in a hard 
  488.     CR, that is, it does not move them to the left margin as the usual ^B 
  489.     command does.
  490.     It assumes that the left margin has not been changed!!
  491.     It is useful for adding or eliminating proportional spacing or changing 
  492.     the right margin. 
  493.  
  494. [ ] B = ^QR[Esc]*F[Esc]*I[Esc]$Z    ;; BOF. AF on. Ins on. Set error.
  495.       = [Esc]1[Esc]=^M> ^H          ;; 1) Skip CRs. Nudge to place cursor.
  496.       = [Esc]~ 2                    ;; If no initial space, jump to reformat
  497.       = ^QD^S[Esc]= 2^D[Esc]!1      ;; If soft CR, 3).Else right. Back to 1)
  498.       = [Esc]2^B[Esc]!1             ;; 3) Reformat. Loop back.
  499.       = [Esc]Z^QR[Esc]*W            ;; 4) BOF.
  500.  
  501. Reformat Indented Paragraphs (double-spaced text)
  502.     This is similar to the above macro but for double-spaced text. It will 
  503.     also change single-spaced to double-spaced text. Again, it assumes that 
  504.     the left margin hasn't been changed.
  505.  
  506. [ ] B = ^QR[Esc]*F[Esc]*I[Esc]*D[Esc]$Z  ;; BOF. AF on. Ins on. DS on. Set error
  507.       = [Esc]1[Esc]=^M>                  ;; Skip CRs
  508.       = ` ^H[Esc]~ R^QD^S[Esc]= R        ;; Nudge. If no space, or soft CR, jump
  509.       = ^QS^_^G^X^X[Esc]!1               ;; Nudge again. Down. Down. Loop back.
  510.       = [Esc]R^B[Esc]!1                  ;; Reformat. Loop back.
  511.       = [Esc]Z^QR                        ;; BOF
  512.  
  513. --------------------------------------------------------------------------------
  514. Block Paragraph Reformat (with varying left margins)
  515.     This macro sets the left margin to the start of each paragraph before 
  516.     reformatting. It is useful if you use different left margins in the 
  517.     same document and want to change the right margin or change to 
  518.     proportional spacing.
  519.  
  520. [ ] B = [Esc]$Z^QR                      ;; Set error. BOF
  521.         = [Esc]1[Esc]=^M>[Esc]= >       ;; 1) Skip CRs. Skip spaces.
  522.         = ^OL^M^B[Esc]!1                ;; Set left margin, Reformat, 1)
  523.         = [Esc]Z^QR                     ;; Z) BOF
  524.  
  525.  
  526. ________________________________________________________________________________
  527. *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*  MISCELLANEOUS  *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
  528. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  529.                                   ___________
  530.                                   TABLE MAKER
  531.                                   ~~~~~~~~~~~
  532.  
  533.  Starting                          Finishing
  534.  cursor               Tab          cursor               Tab
  535.    |     ______________|_________    |    _______________|_________
  536.    `--->│Xaaaaaaaa               │   `-->│Xaaaaaaaa      eeeeeee   │
  537.         │bbbbbbb                 │       │bbbbbbb        fffff     │
  538.         │ccccc                   │       │ccccc          gggggggg  │
  539.         │ddddddd                 │       │ddddddd        hhhhhh    │
  540. blank   │<-                      │ ====> │               iiii      │
  541.         │eeeeeee                 │       │                         │
  542.         │fffff                   │       │                         │
  543.         │gggggggg                │       │                         │
  544.         │hhhhhh                  │       │                         │
  545.         │iiii                    │       │                         │
  546. blank   │<-                      │       │                         │
  547.         │________________________│       │_________________________│
  548.                                                                    
  549.     This macro operates on two sets of data separated by one blank line. 
  550.     The second set should also end with a blank line if it's not the end of 
  551.     the file. As illustrated above, it moves the second set up to the tab 
  552.     stop on the same lines as the first set. The starting cursor can 
  553.     actually be anywhere on the first line of the first set of data. The 
  554.     number of lines in each data set does not have to be the same.
  555.  
  556.     Since this macro uses a Place Marker (^KM), there shouldn't be any 
  557.     Place Markers in the file when the macro is called. If there are, first 
  558.     use the zoom feature of VDE on the relevant lines. For VDE versions 
  559.     prior to 1.64, change ^KM to ^PZ and ^QM to ^QZ.
  560.  
  561. [ ]  B = [Esc](1)[Esc]*i[Esc]*f   ;; Counter = 1. Ins off. AF off
  562.        = ^QS[Esc]$4               ;; Home. Set error.
  563.                              --- Main loop ---
  564.        = [Esc]1^KM                ;; 1) Set Place
  565.        = [Esc]2^X[Esc]~^M2^X      ;; 2) Go to line after 1st blank one
  566.        =    [Esc]=^M3             ;;   If blank, 3)
  567.        =    [Esc]+^Y^QM^I^U       ;;   Count+, Del line. GoTo Place, Tab, Undo
  568.        =    ^QS^G^X^G             ;;   Home, Del Place. Down, Del blank line.
  569.        = [Esc]~^M1^N[Esc]!1       ;; If not blnk, 1), else insert line so
  570.                                   ;;    that the loop at 2) works, 1)
  571.                              --- Clean-up ---
  572.        = [Esc]3^G^QM^H            ;; 3) Del blank line. GoTo Place, Del Place.
  573.        =    ^X[Esc]~^M5^G[Esc]!5  ;;    Down. If blank, delete. 5)
  574.        = [Esc]4^H^H[Esc]-]        ;; 4) [EOF]: Del Place, Decrement count
  575.        = [Esc]5^E[Esc]-6[Esc]!5   ;; 5) Up to top of column
  576.        = [Esc]6[Esc]*I[Esc]*F     ;; Ins on, Auto-format on
  577.                              {Delete [Esc]*I or change to [Esc]*W if necessary}
  578.  
  579.                              This line can be substituted for the last two lines 
  580.                              if no adjustment of the insert and auto-format 
  581.                              status is needed.
  582.     {  = [Esc]5^E[Esc]-][Esc]!5       ;; 5) Up to top of column. Finished.  }
  583.  
  584. --------------------------------------------------------------------------------
  585. Clear Next Tab.  Companion macro for the Table Maker.
  586.     This is for making several columns successively. Set up the data 
  587.     separated by blank lines, and set the tabs for the columns. After using 
  588.     the Table Maker, use this macro to clear the next tab; and without 
  589.     moving the cursor, call the Table Maker again.
  590.     If you assign the Table Maker to a function key and assign this macro 
  591.     to a neighboring key, they are very easy to use.
  592.  
  593. [ ] B = [Esc]*i^I^ON^M
  594.  
  595. --------------------------------------------------------------------------------
  596. --------------------------------------------------------------------------------
  597.                           ________________________
  598.                           PRINTING DOUBLE COULUMNS
  599.                           ~~~~~~~~~~~~~~~~~~~~~~~~
  600.  
  601.                On Screen                            On Paper
  602.         ________________________         _______________________________
  603.        │aa bbbbbb cc            │       │ aa bbbbbb cc   zzzzzzzzz aaa  │
  604.        │ddd eeeee f             │       │ ddd eeeee f    bbbb cccc dd   │
  605.        │ggg hh iiiii            │       │ ggg hh iiiii   eeeee fff ggg  │
  606.        │jj kkkkkkk ll           │       │ jj kkkkkkk ll  hhh ii jjjjj k │
  607.        │mmmm nnnnnnnn           │ ====> │ mmmm nnnnnnnn  lllll mmmm nnn │
  608.        │ooo ppppp qqq           │       │ ooo ppppp qqq  ooooo ppppp qq │
  609.        │rrrrr sss t u           │       │ rrrrr sss t u  rrrr sss ttttt │
  610.        │vvvvv wwwwww            │       │ vvvvv wwwwww   uuu vv wwww xx │
  611.        │xxxxx yyyyy             │       │ xxxxx yyyyy    yyy zzzzz aaaa │
  612. Page   │------------------------│       │-------------------------------│
  613. Break  │zzzzzzzzz aaa           │       │                               │
  614.        │bbbb cccc dd            │       │                               │
  615.        │eeeee fff ggg           │       │  (1st pass)      (2nd pass)   │
  616.        │hhh ii jjjjj k          │       │                               │
  617.                                                                         
  618.  
  619.     The principle is very simple. In VDE, set the right margin to the width 
  620.     of a column and set the page length to the length of a standard page. 
  621.     Proportional spacing can also be set to get more words per line. Then 
  622.     just type normally.
  623.  
  624.     The printing is done in two passes.
  625.     1) First, the printer margins are set for the left column and all the 
  626.     odd-numbered pages are printed using the 'O' option in the printer 
  627.     setup in ^KP.
  628.     2) Then, the printer margins are set for the right column and, using 
  629.     the same paper, all the even-numbered pages are printed with the 'E' 
  630.     option.
  631.  
  632.     Three macros are needed. One to set the margins and page length in VDE, 
  633.     and two for printing the left and right columns. The values used in the 
  634.     macros below provide 1-column wide left and right margins with a 
  635.     2-column spacer in the center, and a page length of 60 with a 3-line top 
  636.     margin. These values can be changed to suit your needs.
  637.  
  638.                     ----------------------------------------
  639.  
  640. Margins and Page Length
  641.  
  642. [ ] B = ^OR38^M^OP60^M            ;; Right margin = 38, Page length = 60
  643.  
  644.                     ----------------------------------------
  645.  
  646. Printer Setups (Epson)
  647.     If you don't want to see the setups on the screen, change the macro 
  648.     mode to B and add ^M to the end of the macro.
  649.  
  650.     Left Column (1st Pass):
  651.  
  652. [ ] N = ^KP'^P[Esc]`@^P[Esc]l^A^P[Esc]Q'''OT3
  653.             ~~~~~~~~~\~~~~~~~~~\~~~~~~~~~\~\~\Top margin: 3 lines
  654.                       \         \         \ \
  655.                        \         \         \ \Odd pages
  656.                         \         \         \
  657.                          \         \         \RM = 39: Esc Q ' {Use '' in VDE}
  658.                           \         \
  659.                            \         \LM = 1: Esc l 1  {small L, ^A = one}
  660.                             \
  661.                              \Initialization: Esc @   {Use `@ for VMAC}
  662.  
  663.  
  664.     Right Column (2nd Pass):
  665.  
  666. [ ] N = ^KP'^P[Esc]`@^P[Esc]l)^P[Esc]QO'ET3
  667.             ~~~~~~~~~\~~~~~~~~\~~~~~~~~\~\~\Top margin: 3 lines
  668.                       \        \        \ \
  669.                        \        \        \ \Even pages
  670.                         \        \        \
  671.                          \        \        \RM = 79: Esc Q O
  672.                           \        \
  673.                            \        \LM = 41: Esc l )
  674.                             \
  675.                              \Initialization: Esc @   {Use `@ for VMAC}
  676.  
  677.  
  678. --------------------------------------------------------------------------------
  679. --------------------------------------------------------------------------------
  680.                                      ______
  681.                                      BLANKS
  682.                                      ~~~~~~
  683.              _____________________           ____________________
  684.              │                    │         │                    │
  685.              │ xxxxx @xxx xxx# xx │         │ xxxxx _________ xx │
  686.              │ xx xxxxxx xxxx xxx │         │ xx xxxxxx xxxx xxx │
  687.              │ xxxxx xxx xx @xxxx │  ===>   │ xxxxx xxx xx _____ │
  688.              │ xxx xxxxxx# xxx xx │         │ ___________ xxx xx │
  689.              │ xxxxx xxxxx xxxx x │         │ xxxxx xxxxx xxxx x │
  690.              │ xxxx @x x xx# xxx  │         │ xxxx ________ xxx  │
  691.              │                    │         │                    │
  692.              │____________________│         │____________________│
  693.                                                                  
  694.     This macro creates an underlined blank space between, and including, all 
  695.     the pairs of special characters in a file. In the macro below the 
  696.     characters are:
  697.                         Start:   @
  698.                         Finish:  #
  699.     but they can be changed to anything you like.
  700.  
  701.     To use, go through a file and mark the places that you want to turn 
  702.     into blanks with '@'-'#' pairs, go to the beginning of the file, and 
  703.     then call the macro. It will bracket each place with the underline 
  704.     print toggle (^PS) and overwrite '@', '#', and everything in between 
  705.     with spaces.
  706.  
  707. [ ] B = [Esc]*i[Esc]*f[Esc]$4         ;; Overwrite. AF off. Set error.
  708.       =    ^QF`@^MG^M                 ;;     Find '@'
  709.       = [Esc]1^PS                     ;; 1) Underline
  710.       = [Esc]2 [Esc]=#3[Esc]~^M2      ;; 2) Overwrite with spces until '#' or CR
  711.       =   ^PS^X^QS^PS[Esc]=#3[Esc]!2  ;;   [CR]: Undrlin. Down. Home. Undrlin.2)
  712.       = [Esc]3 ^PS^L[Esc]$4[Esc]!1    ;; 3) [#]: Space, Underline, Again '@', 1)
  713.       = [Esc]4[Esc]*I[Esc]*F          ;; 4) Ins on, Auto-format on
  714.                             { Delete [Esc]*I or change to [Esc]*W if necessary}
  715.  
  716.                                   This line can be substituted for the last two 
  717.                                   lines if no adjustment of the insert and auto- 
  718.                                   format status is needed.
  719.     { = [Esc]3 ^PS^L[Esc]!1             ;; 3) [#]: Space, Underline, Again '@', 1)  }
  720.