home *** CD-ROM | disk | FTP | other *** search
/ Fish 'n' More 2 / fishmore-publicdomainlibraryvol.ii1991xetec.iso / dirs / uedit-stuff_429.lzh / Uedit-Stuff / Indent.doc < prev    next >
Text File  |  1991-01-10  |  10KB  |  185 lines

  1.  
  2.                  PAUL KIENITZ'S UEDIT INDENTATION COMMANDS
  3.  
  4.     Have you ever wished that you could leave your tab ruler with stops every
  5. eight spaces (because that's what most other software uses) but still conven-
  6. iently indent things by multiples of four spaces, or three or five?  Here is
  7. a new set of indent related commands for that purpose.  And there are a few
  8. other miscellaneous goodies floating around in this stuff too.
  9.  
  10.     The basic commands are alt-], which indents the present line by more
  11. spaces, and alt-[ which indents it by less.  They both use the optimum
  12. combination of tabs and spaces according to your present tab table for the
  13. new indentation, if trueTabs is on.  The size of the increment they indent by
  14. is set by the command shftAlt-], which prompts you to press a digit key to
  15. specify the indent size from one to ten spaces (press a zero for ten).  It
  16. can be changed to accept any number; see the comments in SA-].  If you do not
  17. set the distance, it defaults to four spaces.  To change this default, search
  18. for places in the Indent file marked with the string "default @@".  You'll
  19. need to change 4 to the new value in alt-[, alt-], and lAmiga-[.
  20.  
  21. There is also another pair of commands which were not present in the earlier
  22. version of this file:  lAmiga-[ and lAmiga-].  LAmiga-[ looks back at several
  23. previous lines (currently it looks at the last six; this is easily changed)
  24. until it finds one that is indented less than the present line, but not
  25. completely unindented, and then matches the indentation of the present line
  26. to that one.  Here's an example of what it does:
  27.  
  28.                            BEFORE PRESSING LAMIGA-[
  29.                 third line above the cursor
  30. second line which it ignores because it's not indented at all
  31.                             first line above the cursor
  32.                                                  the line the cursor is on
  33.  
  34.                          AFTER PRESSING LAMIGA-[ ONCE
  35.                 third line above the cursor
  36. second line which it ignores because it's not indented at all
  37.                             first line above the cursor
  38.                             the line the cursor is on
  39.  
  40.                         AFTER PRESSING LAMIGA-[ AGAIN
  41.                 third line above the cursor
  42. second line which it ignores because it's not indented at all
  43.                             one line above the cursor
  44.                 the line the cursor is on
  45.  
  46.     If it doesn't find a line above to give guidance, it outdents by the
  47. distance that alt-] indents.  There is also a function lAmiga-] which
  48. outdents the current line to match up with the next text after whitespace in
  49. the line immediately above.  (Actually if the line(s) directly above are
  50. blank it looks further up for a non-blank line.  Example:
  51.  
  52.                             BEFORE PRESSING LAMIGA-]
  53. the_line:    above        ; the cursor
  54.      line the cursor is on
  55.  
  56.                             AFTER PRESSING LAMIGA-]
  57. the_line:    above        ; the cursor
  58.                 line the cursor is on
  59.  
  60.                             AFTER PRESSING LAMIGA-] AGAIN
  61. the_line:    above        ; the cursor
  62.                 line the cursor is on
  63.  
  64. and so on.  As you might be able to tell from the example, I intended this to
  65. be useful for assembly language programmers.  When it reaches the last word
  66. of the line above it aligns with the end of that line.  (Maybe I should have
  67. made lAmiga-[ do this the opposite direction and used some other key for what
  68. it does now.)
  69.  
  70.     Also included is a new version of normal-tab which runs alt-] if it is in
  71. the leading indent of the line, and just inserts a tab normally (or equiva-
  72. lent spaces if trueTabs is off) if it's elsewhere.  This gives the effect of
  73. tab stops every howevermany spaces at the beginning of the line.  And there's
  74. a version of backspace that runs alt-[ when it's in the leading indent, but
  75. it's commented out because of slowness.  (This slowness is apparently in the
  76. display updater, not the command itself.  The command itself runs in ten
  77. milliseconds or so in those cases when it doesn't run alt-[.)
  78.  
  79.     This file also includes replacements for the fairly useless alt-l and
  80. alt-r commands, which in the standard config move the hilite region one space
  81. left or right, but don't work if the line has leading tabs.  The new versions
  82. move the lines left or right several spaces using alt-[ and alt-], and don't
  83. move any lines that aren't visibly hilited (lines with the hilite marker at
  84. one end).  These commands are noticeably slow, since each alt-[ or alt-]
  85. takes an unfortunately large fraction of a second.
  86.  
  87.     To move a line, or a hilited group of lines, left or right by only one
  88. space, use altCtl-[, altCtl-], altCtl-l, or altCtl-r.  Think of the control
  89. key as "shortening" whichever other key it's applied to.  And shftAltCtl-r
  90. asks for a number, positive or negative, and indents (or outdents if
  91. negative) the hilite region by that many spaces.
  92.  
  93.     Another key provided is ctl-[ which moves the cursor to the end of the
  94. indent; that is, to the first visible character on the line.  Be careful
  95. about moving this to another key, because all the others runKey this one.
  96.  
  97.     Also thrown in is shftAlt-[ ( think of it as alt-{ ) which creates a pair
  98. of C braces with an indented line between them.  The amount of indentation is
  99. the amount used by alt-].  Example:
  100.  
  101.             Blah blah blah <- that's where the cursor is
  102. becomes:
  103.             Blah blah blah {
  104.                 <- that's where the cursor is
  105.             }
  106.  
  107.     Here's a Help! file excerpt for these commands:
  108.  
  109. INDENT:
  110. ======
  111. C-[:    Move to first non-whitespace on line
  112. A-]:    Increase indentation by amount set with SA-] (default 4 spaces)
  113. A-[:    Decrease indentation by amount set with SA-[ (default 4 spaces)
  114. A-r:    Indent hilite region by amount set by SA-]
  115. A-l:    Un-indent hilite region by amount set by SA-]
  116. AC-]:   Increase indentation of this line by one space
  117. AC-[:   Decrease indentation of this line by one space
  118. AC-r:   Indent hilite region by one space more
  119. AC-l:   Indent hilite region by one space less
  120. SAC-r:  Ask how many spaces to indent or un-indent hilite region by
  121. SA-]:   Set indentation amount for alt-[ and alt-]
  122. SA-[:   Insert C braces with indented line between ( sort of alt-{ )
  123. L-[:    Reduce indentation to match nearest less indented line above
  124. L-]:    Indent to match next word after whitespace in line above
  125.  
  126. Also remember alt-4 which indents the current line to match the one before
  127. it, and alt-1 which moves the line all the way to the left.
  128.  
  129. Technical notes:  The useful thing about ctl-[ is that after you run it, the
  130. number of spaces currently indented is in n50.  The core of the system is
  131. virtual-[ which indents the current line to the column in n54 (by temporarily
  132. changing leftMargin), and then moves the cursor to locA, which it assumes you
  133. have used to store the initial position of the cursor.  Changing shftAlt-[ to
  134. use inputNum (so that it's not limited to one digit values) should be
  135. straightforward; there are hints there.
  136.                         A FEW OTHER RANDOM GOODIES
  137.  
  138.     Well lessee...  Have you ever wished you knew WHAT JUST HAPPENED when the
  139. cat walked on the keyboard and you couldn't regognize the mess on the screen? 
  140. There's a prekey and an alt-q which tell you what the last eight inputs were.
  141. The prekey is commented out for the sake of those who might mass-compile the
  142. whole file without looking at each command first.  There are lines in the
  143. prekey that cause normal-buttondown and normal-buttonup inputs to be left out
  144. of the record, easily removed if you desire.  There's a commented-out line
  145. that would make it ignore all inputs that just insert characters.  The alt-q
  146. command may be a useful example for someone who wants to convert macronums to
  147. readable key names.  The n-variables used are n10 through n18 (easily
  148. changeable).
  149.  
  150.     There's a new'n'improved ctl-x Toggle Hex/Decimal which allows the cursor
  151. to start in the middle of the number, allows a trailing L and doesn't
  152. convert anything to 0X with no digits after it.  (Personally, I swap this
  153. with ctl-d.)
  154.  
  155.     There's a command for ümlautïng the next vöwël, useful for writing in
  156. German or reviewing heavy metal albums.  It also makes some other odd
  157. characters like ß © ¡ ¿ « » ñ.  It's on alt-/.  (These characters won't
  158. display correctly if you have the last version of 2.4g before 2.4h.)
  159.  
  160.     There are commands to uppercase and lowercase whole words (ctl-l and
  161. ctl-u); the cursor can start in the middle.  There's ctl-c which capitalizes
  162. the letter the cursor is on (or the next letter if not on one) and lowercases
  163. the rest of the word if the letter after the one capitalized was uppercase. 
  164. I recommend swapping the ctl-c Make Control Character command to ctl-q.
  165.  
  166.     There's a command to save curFile with an icon, but not make icons with
  167. later saves.  It's on lAmiga-f2.  It might not make an icon if you run it
  168. while there are files in the save queue.  There's a replacement for ctl-1
  169. which shows your file size and your position in it in characters and lines
  170. and as a percentage.
  171.  
  172.     And a few other simple things that are self explanatory, like things to
  173. move the cursor to either end of the hilite or invert region, and one to
  174. reset the color permutation if you hit alt-help by mistake, and so on.
  175.  
  176.  
  177.  
  178.                                 Hope all this is useful.
  179.                                 Feedback is appreciated.
  180.  
  181.                 email: none             Paul Kienitz
  182.                 bbses: 415-845-4812     6430 San Pablo ave.
  183.                        415-222-9416     Oakland, CA, 94608
  184.                                         USA
  185.