home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.5 Applications 2004 May / SGI IRIX 6.5 Applications 2004 May.iso / dist / desktop_tools.idb / usr / lib / jot / jot.tutorial.z / jot.tutorial
Encoding:
Text File  |  1998-05-04  |  30.7 KB  |  948 lines

  1.            JOT TUTORIAL
  2.  
  3. The first section teaches you how to start jot,
  4. add text, backspace, cut, copy, paste text,
  5. select text, scroll and pan around in the file,
  6. save the results, and quit.  If you know how to do
  7. that, skip to the "ADVANCED TOPICS" section.
  8.  
  9. If you want to see why jot is a neat editor, try
  10. exercises (11, 12, 20, 21, 31, 35, 36, 37, 39) in
  11. the last section after reading about "Speed Keys"
  12. in the BASIC JOT section.
  13.  
  14. If you have previously used jot or zip and want
  15. to use original "Speed Keys" (accelerators), add
  16. the string "oldaccelerators" to your $HOME/.jotrc
  17. file.  Type "jot /usr/lib/jot/jot.tutorial.orig"
  18. to use the tutorial for the original
  19. accelerators.
  20.  
  21.         BASIC JOT
  22.  
  23. Starting jot:
  24.  
  25.     At the shell, type "jot" or "jot filename".  On
  26.     the Desktop, double click on the jot icon, or
  27.     drop the icon of the file to be edited on the
  28.     jot icon.  For what follows, use a somewhat
  29.     large file that you don't care about.
  30.  
  31. Typing text:
  32.  
  33.     Type some text.  It appears at the red
  34.     vertical bar cursor.  Type the <Backspace>
  35.     key -- one character is deleted.  Try typing
  36.     in <Tab> characters and the <Enter> key.  Try
  37.     backspacing over both types of characters.
  38.  
  39. Moving the cursor:
  40.  
  41.     Move the mouse to point the arrow cursor
  42.     between characters.  Click with the left
  43.     mouse button.  Now try typing and
  44.     backspacing.
  45.  
  46. Sweep-select:
  47.  
  48.     Press the left mouse button down over the
  49.     text and move the mouse before you release
  50.     it.  The region in white is "selected".
  51.     Notice how <Tab> characters and newlines at
  52.     the ends of lines are selected.  On a big
  53.     file, try moving the cursor above, below, to
  54.     the left, and to the right of the window as
  55.     you sweep-select.
  56.  
  57. Deleting text:
  58.  
  59.     Sweep-select the text you want to delete.
  60.     Type backspace.
  61.  
  62. Moving and copying text:
  63.  
  64.     Sweep-select some text.  Press the left mouse
  65.     button down over the word "Edit" in the bar
  66.     at the top of the window.  Keeping the button
  67.     down, slide down until the word "Copy" is
  68.     highlighted.  Release the button.  You now
  69.     have a copy of the selected text in your "cut
  70.     buffer".  Move the cursor somewhere else.
  71.     Select "Paste" from the edit menu the same
  72.     way you just did "Copy".  A copy of the text
  73.     is pasted at the cursor.  Paste again.  You
  74.     get another copy.
  75.  
  76.     Select some text.  This time, use the "Cut"
  77.     command instead of "Copy" from the "Edit"
  78.     menu.  Your text disappears, but a copy is
  79.     put in the cut buffer.  You can now paste it,
  80.     as before.  This is a good way to move text.
  81.  
  82. Undoing mistakes:
  83.  
  84.     Select the "Undo" command from the "Edit"
  85.     menu.  It will undo the last thing you did.
  86.     Use "Undo" again.  And again.  And again.
  87.     After a few Undo's, try the "Redo" command in
  88.     the same menu.  Repeat a few times.
  89.  
  90. Speed keys:
  91.  
  92.     Press the left mouse button over the "Edit"
  93.     menu and hold it down.  Note that at the
  94.     right of the "Undo" command is the text
  95.     "Ctrl+Z".  This means that if you hold down the
  96.     left <Ctrl> key and type the letter "z", it
  97.     performs the "Undo" command.  Try holding
  98.     down <Ctrl>, and type a few z's.  In this
  99.     text, we will denote it by <C-z>.
  100.  
  101.     <C-z> (Undo) is different from <C-Z>
  102.     (Uppercase).  To issue the "Uppercase"
  103.     command with a speed key, you have to hold
  104.     down both <Ctrl> and the <Shift> keys before
  105.     you type the "z".  In the jot menus a <C-Z> 
  106.     is denoted by "Ctrl+Shift+Z"
  107.  
  108.     <C-j> means hold down the <Ctrl> key and type
  109.     "j"; <C-A-m> means you must hold down both
  110.     the <Alt> and <Ctrl> keys and type "m".
  111.     <A-S-.> means the <Alt> and <Shift> keys must
  112.     be held down before you type ".".
  113.  
  114. Scrolling:
  115.  
  116.     Press the left mouse down with the cursor in
  117.     the scroll area to the right of the text.
  118.     Move the cursor up and down.  The white bar in
  119.     the scroll area shows the selected region.
  120.     Try selecting and editing in other parts of
  121.     the file.  Copy text from one part of the
  122.     file to another.
  123.  
  124.     Type text until you make a really long line.
  125.     Now hold down both the left Alt and Ctrl keys
  126.     and press the right mouse button down in the
  127.     window and move it around before releasing
  128.     it.  The text pans with it -- right, left,
  129.     up, and down.
  130.  
  131. Saving Files:
  132.  
  133.     You probably don't want to do it, but under
  134.     the "File" pull-down menu is a command called
  135.     "Save".  This will save your changes to the
  136.     file.  "Save As" will ask you for a new file
  137.     name to use.
  138.  
  139. Visiting new files:
  140.  
  141.     The "Open" command in the "File" pull-down
  142.     menu will ask you for the name of a new file
  143.     to edit.  Try it.
  144.  
  145. Quitting:
  146.  
  147.     The "Exit" command is in the "File" pull-down
  148.     menu.
  149.  
  150. Experiment:
  151.  
  152.     Look in the other pull-down menus, and
  153.     experiment.  You can probably figure out most
  154.     of the commands and learn their speed-key
  155.     equivalents.  Try the help command in the
  156.     "Help" pull-down menu.
  157.  
  158.         ADVANCED TOPICS
  159.  
  160. What follows is a table of contents of advanced
  161. or unusual topics.  Each is followed by a number
  162. or numbers.  To learn about that topic, try out
  163. the exercise at the end of this document with the
  164. corresponding number(s).  If the exercise title
  165. has numbers after it, those are recommended
  166. prerequisite exercises.
  167.  
  168. Under the Options menu is an entry that gives you
  169. more possibilities in your other pull-down menus.
  170.  
  171. Search/Replace
  172.     Forward search (1)
  173.     Reverse search (2)
  174.     Quick search for a word (37)
  175.     Incremental search (3)
  176.     Case insensitive search (4)
  177.     Replace all (5)
  178.     Query replace (6)
  179.     Pattern (regular expression) search (7)
  180.     Pattern (regular expression) replace (8)
  181.  
  182. Text
  183.     End of line word wrap (9)
  184.     Typing weird characters (10)
  185.     Indentation (11)
  186.     Reformat paragraphs (12, 23, 29)
  187.     Changing UPPER/lower-case (13)
  188.     File to file move/copy (14)
  189.     Repeat command (58)
  190.  
  191. Tabs
  192.     Setting tab sizes (15)
  193.     Backward tab (16)
  194.     Back up hacking tabs (17)
  195.     Indentation (11)
  196.  
  197. Cut buffer
  198.     Appending to cut buffer (18)
  199.     Viewing the cut buffer (19)
  200.     X windows cut buffer (56)
  201.  
  202. Advanced topics
  203.     Macros (20, 21, 29, 43, 44, 57)
  204.     Saving macro definitions (55)
  205.     Repeat counts (22)
  206.     Special editing speed-keys (25)
  207.  
  208. Selection
  209.     Word/line/paragraph select (26)
  210.     Extend selection (27)
  211.     Jump to ends of selection (28)
  212.  
  213. Viewing
  214.     Using the keyboard to move (30)
  215.     Marking places in a file (31)
  216.     Jump to line (32)
  217.     Finding the line number (33)
  218.  
  219. Writing C code
  220.     Electric C mode (34)
  221.     Indentation (11)
  222.     Matching parentheses, braces (35)
  223.     Using ctags (36)
  224.  
  225. Filters
  226.     UNIX commands on jot text (38)
  227.     Sorting lines of text (39)
  228.     Counting lines of text (40)
  229.     Mailing text (41)
  230.     Printing text (42)
  231.  
  232. Files
  233.     Inserting a file (45)
  234.     The Showcase browse gizmo (46)
  235.     Directory navigation (47)
  236.     Editing multiple files (48)
  237.  
  238. Jot Setup
  239.     The .jotrc file (0)
  240.     Changing fonts (49)
  241.     Changing colors (50)
  242.     Changing window size (51)
  243.     Changing margins (24)
  244.     Backups and checkpoints (52)
  245.     Jot as the default editor (53)
  246.     Using 2 windows (54)
  247.  
  248.  
  249.                 EXERCISES
  250.  
  251.  (0) The .jotrc file:
  252.  
  253.     Jot defaults are saved in the file called
  254.     ".jotrc" in your home directory.  Jot reads
  255.     it once when it comes up.  If you change the
  256.     file, you have to restart jot before the
  257.     changes will take effect.
  258.  
  259.  (1) Standard forward search:
  260.  
  261.     <C-F> asks for a search string.  Type it
  262.     followed by <Enter>.  If there is selected
  263.     text, <C-f> searches for the next copy of
  264.     that text; otherwise, it repeats the previous
  265.     search.
  266.  
  267.  (2) Reverse search: (1)
  268.  
  269.     <C-B> asks for a search string.  Type it
  270.     followed by <Enter>.  It is the same as
  271.     forward search, but searches backwards.  If
  272.     there is selected text, <C-b> searches
  273.     backwards for the previous copy of that text;
  274.     otherwise, it repeats the previous search.
  275.  
  276.  (3) Incremental search: (0, 1, 2)
  277.  
  278.     Put the line "incrsearch" in your .jotrc
  279.     file.  Restart jot on a file.  Now <C-F> does
  280.     nothing (but look at the window header).  Now
  281.     type the characters of the string you're
  282.     searching for.  If you make a mistake, type
  283.     backspace.  Type <Esc> to stop searching.
  284.     Try "Undo" during incremental search.  Try
  285.     <C-f> during an incremental search.  Now try
  286.     the same thing with <C-B> and <C-b>.  If you
  287.     don't like the mode, get rid of the
  288.     "incrsearch" line in your
  289.     .jotrc file.
  290.  
  291.  (4) Case-insensitive search: (1)
  292.  
  293.     If you want your search for "abc" to find
  294.     things like "AbC" and "Abc", use the "Search
  295.     by Case" command in the "Options" pull-down
  296.     menu.  Then use standard search or reverse
  297.     search commands.  You can toggle back to be
  298.     case-sensitive again.
  299.  
  300.  (5) Replace to end of file:
  301.  
  302.     <C-r> brings up a dialog box.  Type the
  303.     search string and replacement string into the
  304.     slots, and click on "Confirm".  Use the mouse
  305.     or <Enter> key to move between the slots.
  306.     The replacement is done from the cursor
  307.     position to the end of the file.
  308.  
  309.  (6) Query replace: (1)
  310.  
  311.     Type the replacement text into the file and
  312.     select it.  "Cut" it to delete it from the
  313.     file and put it in the cut buffer.  Now do a
  314.     standard search command to find the next
  315.     occurrence of the text to be (possibly)
  316.     replaced.  If you don't want to replace it,
  317.     type <C-f> (repeat the search to the next
  318.     one).  If you do, type <A-g>, which means
  319.     "Paste, and repeat the forward search".  Work
  320.     your way through the file with <C-f> and
  321.     <A-g>.
  322.  
  323.  (7) Regular expression search: (1, 7)
  324.  
  325.     Suppose you want to find the string "long"
  326.     that appears at the beginning of a line of
  327.     text.  Type <C-A-F>.  Now give the string
  328.     "^long" (without the double-quotes) as your
  329.     string.  Jot will place you on a line of with
  330.     "long" as the first word in the line.  See
  331.     the manual pages for the UNIX command "ed"
  332.     for more information on regular expressions.
  333.     <C-A-f> repeats the last regular expression
  334.     search.  Here are some more examples of
  335.     regular expressions:
  336.  
  337.     "^......$" and "^.{6}$" match lines with
  338.     exactly 6 characters in them.
  339.  
  340.     "a.*e.*i.*o.*u" matches lines in which all 5
  341.     vowels appear in order.  (Try loading
  342.     /usr/lib/dict/words and look for other
  343.     interesting words using regular expressions.)
  344.  
  345.     "and.*and" matches strings containing the
  346.     word "and" at least twice.
  347.  
  348.     "\([0-9]*\)" matches lines containing a
  349.     number enclosed in parentheses.
  350.  
  351.     "^[a-zA-Z][a-zA-Z0-9]*:" searches for lines
  352.     beginning with a C-style label.
  353.  
  354.     "a[c-z]*b[abd-z]*c[a-ce-z]*d" matches words
  355.     (in lowercase letters only) that contain the
  356.     letters "a", "b", "c", and "d" in order with
  357.     other letters possibly intervening.
  358.  
  359.  (8) Regular expression replace: (5)
  360.  
  361.     This is just like the replace command, except
  362.     that it is invoked with <C-A-r>.  The search
  363.     string is a regular expression, possibly with
  364.     parts of the expression enclosed in
  365.     parentheses and followed by numbers.  These
  366.     can be referenced in the replacement string.
  367.     (See the UNIX "ed" documentation).
  368.  
  369.     For example, suppose you would like to
  370.     replace all occurrences of numbers in
  371.     parentheses by the same numbers in square
  372.     brackets.  Use "\(([0-9]*)$1\)" as the
  373.     search string and "[$1]" as the replacement
  374.     string.
  375.  
  376.     As another example, suppose you have a bunch
  377.     of entries in a file that look like [abc,defg]
  378.     and you would like to swap the strings that
  379.     are separated by the comma, so the string
  380.     above would be converted to [defg,abc].  Use
  381.     "\[(.*)$1,(.*)$2\]" as the search string,
  382.     and "[$2,$1]" as the replacement string.
  383.  
  384.  (9) Word wrap: (0)
  385.  
  386.     Toggle the word wrap with the command in the
  387.     "Options" pull-down menu.  Now try typing a long
  388.     line (but type characters at the end, not in
  389.     the middle).  When you reach column 72, the
  390.     line will break.  You can change the margin
  391.     (see exercise 24).  You can make word
  392.     wrapping the default by adding the line
  393.     "wordwrap" to your .jotrc file.
  394.  
  395. (10) Typing weird characters:
  396.  
  397.     If you need a special character in the file,
  398.     say a formfeed, you have to know the ASCII
  399.     value of it.  Formfeed is 12.  Hold down the
  400.     <Alt> key, type "1", "2", release the <Alt>
  401.     key, and type <Esc>.  You will see a three
  402.     letter sequence "X0C" in your file, sometimes
  403.     with a box around the "X".  This represents
  404.     the hexidecimal code for the character,
  405.     namely "0C".  Try selecting, copying, and
  406.     moving the new character.  It moves as a
  407.     chunk.  To add the ASCII null character, type
  408.     <A-2><A-5><A-6><Esc>.  Jot masks the result
  409.     to 8 bits.
  410.  
  411. (11) Indentation:
  412.  
  413.     Select a set of lines whose indentation you
  414.     want to change.  Type <C-i>.  They indent by
  415.     4 columns.  <C-I> "outdents" them by 4
  416.     columns.  Try <A-2><A-1><C-i>.  This indents
  417.     them by 21 columns.  Try the same thing for
  418.     outdentation.
  419.  
  420. (12) Reformatting paragraphs:
  421.  
  422.     Select a paragraph or set of paragraphs that
  423.     has a very ragged right margin.  Now type
  424.     <C-R>.  All paragraphs are reformatted to the
  425.     current right margin.  See exercise (23) to
  426.     find out how to reformat with a different
  427.     margin.  See (24) to find out how to change
  428.     the margin.
  429.  
  430. (13) Changing to uppercase or lowercase:
  431.  
  432.     Select some text.  Type <A-U>.  Then <A-L>.
  433.     Then <A-C>.  <A-C> capitalizes the first
  434.     letter of the selection.
  435.  
  436. (14) Moving/copying text from file to file:
  437.  
  438.     The cut buffer is unchanged if you visit a
  439.     new file.  Just "Cut" or "Copy" the text in
  440.     one file, visit another file, and "Paste"
  441.     it.  If you have 2 jot windows running on two
  442.     different files, you can cut from one and
  443.     paste into the other.  See (54) for some nice
  444.     ways to make 2 jot windows.
  445.  
  446. (15) Setting tab sizes: (0)
  447.  
  448.     The default tab size is 8 columns.  To change
  449.     it, say, to 4 columns, add the line "tabsize
  450.     4" to your .jotrc file.  Then restart jot.
  451.     The <Tab> key will advance you by four
  452.     columns at a time.  Notice that it does so by
  453.     adding the correct number of spaces and tabs
  454.     to do the trick.
  455.  
  456. (16) Backward tab:
  457.  
  458.     Place the cursor in front of a bunch of white
  459.     space (which may be a mixture of tabs and
  460.     spaces).  Now type <S-Tab> a few times.  Try
  461.     it in front of non-white space.
  462.  
  463. (17) Back up hacking tabs:
  464.  
  465.     Type a few tabs.  Now type the <Backspace>
  466.     key.  Now type the <Delete> key instead -- it
  467.     is just like <Backspace>, except if it hits a
  468.     tab character, in which case it converts the
  469.     tab to spaces before backspacing.
  470.  
  471. (18) Appending to the cut buffer:
  472.  
  473.     Copy some text into the cut buffer.  Now
  474.     select some different text and type <C-C>.
  475.     Now "Paste".  <C-C> appended the second chunk
  476.     to whatever was in the cut buffer.  You can
  477.     append as many chunks as you want.  This is
  478.     great for gathering a bunch of text from
  479.     different places and putting it all in one
  480.     place.
  481.  
  482. (19) Viewing the contents of the cut buffer:
  483.  
  484.     Type <A-S-.> (hold the <Alt> and <Shift> keys
  485.     down).  A dialog box with the first few lines
  486.     of the cut buffer is displayed.
  487.  
  488. (20) Macro example:
  489.  
  490.     Suppose you would like to add a semicolon to
  491.     the end of each line.  Type <C-F1> (Use the
  492.     F1 key at the top of the keyboard).  Then
  493.     type <C-e>;<downarrow>, and then <C-F1>
  494.     again.  <C-e> moves to the end of the line;
  495.     you then type a semicolon, and the arrow key
  496.     moves to the next line.  Now type the F1 key
  497.     again.  And again.  The commands between the
  498.     two <C-F1>s are remembered and replayed each
  499.     time you type F1.
  500.  
  501. (21) Macro example (Nesting macros): (20)
  502.  
  503.     Type <C-F2>, then F1 F1 F1, and <C-F2>
  504.     again.  You've defined macro F2 to be three
  505.     calls to F1.  Type F2 to see.
  506.  
  507. (22) Repeat counts; the command multiplier:
  508.  
  509.     Type <A-5> and then "a".  The character "a"
  510.     is inserted 5 times.  Type "<A-1><A-2>k".
  511.     This adds 12 k's to the file.  Try
  512.     <A-7><Backspace>.  A command multiplier may
  513.     be specified before any command.  Usually, it
  514.     just causes the command to happen that many
  515.     times, but sometimes it has other effects.
  516.     See exercises (10, 11, 23, 31).
  517.  
  518. (23) Reformatting with an unusual margin: (12, 22)
  519.  
  520.     Put your cursor in a ragged paragraph.  Type
  521.     "<A-3><A-5><C-R>".  This reformats the
  522.     paragraph to 35 column margins.
  523.  
  524. (24) Permanently changing margins: (0, 9)
  525.  
  526.     Add the line "margin 50" to your .jotrc
  527.     file.  Then restart jot.  Turn word-wrap on,
  528.     and try typing, or reformat a paragraph.
  529.     Your right margin is now 50 columns.  The
  530.     right margin applies to word-wrap and
  531.     reformatting.  See (9, 12).
  532.  
  533. (25) Editing speed keys: (22)
  534.  
  535.     <C-d> kills the character to the right of the
  536.     cursor.  <A-d> deletes to the end of the
  537.     word.  <A-Backspace> deletes to the beginning
  538.     of the word.  <C-k> kills to the end of the
  539.     line.  If the line is empty, it kills the
  540.     newline character, joining the line to the
  541.     next.  <C-u> kills to the beginning of the
  542.     line, unless the cursor is at the beginning,
  543.     in which case it kills the previous newline,
  544.     joining the line to the previous line.
  545.     Repeat counts (see (22)) applied to <C-k> and
  546.     <C-u> turn into whole line counts.  Try
  547.     <A-5><C-k>.  It kills 5 lines, whether they
  548.     are empty or not.  <A-o> opens a line after
  549.     the cursor.  <A-O> opens a line before the
  550.     cursor.  <C-a> moves to the beginning of a
  551.     line, and <C-e> moves to the end of the
  552.     line.  <Home> also moves to the beginning of
  553.     the line.  <End> move to the end of the line.
  554.     <C-Home> moves to the top of the document and
  555.     <C-End> moves to the button of the document.
  556.  
  557. (26) Selecting words, lines, paragraphs:
  558.  
  559.     Double click with the left mouse in the text.
  560.     It selects a word.  Sweep select after double
  561.     clicking.  It sweep-selects words.  Try
  562.     clicking and sweep selecting with the leftmouse
  563.     and middlemouse while the <Ctrl> key is
  564.     pressed.  These commands select and
  565.     sweep-select lines and paragraphs.  (A
  566.     paragraph is delimited by 2 newline characters
  567.     in a row).
  568.  
  569. (27) Extend selection: (26)
  570.  
  571.     Once some text is selected, you can extend
  572.     the selection using the usual selection
  573.     mechanisms if you hold down the <Shift> key
  574.     as you do.  This applies to mouse sweep
  575.     selection of characters, words, lines, and
  576.     paragraphs.  If the <Shift> key is down, the
  577.     arrow keys also extend the selection. Try
  578.     <S-leftarrow>, etc.  If the <Alt> keys are
  579.     held down with the arrow keys, the selection
  580.     is even bigger -- to the beginning and end of
  581.     line, or up and down to the top and bottom of
  582.     the file.
  583.  
  584. (28) Viewing the top and bottom of the
  585.      selection:
  586.  
  587.     If you have a selection that is too big too
  588.     see in your window, try <A-Home> and
  589.     <A-End>.
  590.  
  591. (29) A macro for reformatting to a different
  592.      margin: (20, 23)
  593.  
  594.     Type "<C-F5><A-4><A-5><C-R><C-F5>".  This
  595.     makes the macro F5 reformat the selected
  596.     paragraphs to a right margin of 45.
  597.  
  598. (30) Moving around using the keyboard:
  599.  
  600.     Try using the arrow keys in the cluster just
  601.     to the lower right of the main keyboard (not
  602.     in the numeric key pad).  They move (if
  603.     possible) up, down, left, and right by a
  604.     character.  Hold down the <Ctrl> key and try
  605.     them.  They now move up and down by
  606.     paragraphs, and left and right by words.  Now
  607.     try them with the <Alt> key.  They move left
  608.     and right to the ends of the line, and up and
  609.     down to the top and bottom of the file.
  610.     <Ctrl> means move a bit more, and <Alt> means
  611.     move a lot more.  Try the <PageUp>,
  612.     <PageDown>, <Home>, <End>, <C-Home> and
  613.     <C-End> keys in the cluster above the arrow
  614.     keys.
  615.  
  616. (31) Setting and jumping to marks:
  617.  
  618.     Place the cursor somewhere that you'll
  619.     recognize in the file, and type <C-m>.  Now
  620.     move somewhere else in the file, and type
  621.     <C-j>.  <C-m> sets a mark, and <C-j> jumps to
  622.     it.  Notice the "0" in the scroll bar.  Now
  623.     go somewhere else in the file and type <C-m>
  624.     again.  This sets mark number 1.  Try typing
  625.     <C-j> repeatedly.  Try <A-4><C-m>.  This sets
  626.     mark number 4.  <A-4><C-j> jumps to mark 4.
  627.     Note that the marks' approximate positions
  628.     are indicated in the scroll bar by blue
  629.     numbers.  Click in the scroll bar with the
  630.     right mouse near a blue mark.  Click near
  631.     another.  Set your cursor to yet another
  632.     place in the file, and hold the <Shift> key
  633.     down while you click with the right mouse in
  634.     the scroll bar.  Mark 0 is reset to that
  635.     place.  Try deleting or adding text to the
  636.     file above the marks, and notice that you
  637.     still jump to the same place -- the marks
  638.     move as text is added/deleted.
  639.  
  640. (32) Jumping to a line:
  641.  
  642.     Type <C-l>.  Type a line number into the
  643.     dialog box and press <Enter>.  You will jump
  644.     to that line.  Now type <A-4><A-3><C-l>.  You
  645.     will jump to line 43, and will not have to
  646.     deal with the dialog box.
  647.  
  648. (33) Show current line number:
  649.  
  650.     Type <A-.>.  Try sweep-selecting a bunch of
  651.     text and type <A-.>.
  652.  
  653. (34) Electric-C mode: (0)
  654.  
  655.     Turn on electric-C mode using the toggle in
  656.     the "Misc" menu (this turns it on in any
  657.     file), or put the line "electriccmode" in
  658.     your .jotrc file, which automatically turns
  659.     it on in files with extensions ".c", ".h",
  660.     ".C, ".c++", and ".C++".
  661.  
  662.     In electric-C mode, the keys "(", "{", "[",
  663.     ",", """, "'", and the <Enter> key behave
  664.     differently.  Parentheses, brackets, and
  665.     quotes are automatically matched, and
  666.     additional text is sometimes added.  A space
  667.     is added after a comma.  The <Enter> key
  668.     usually works from the middle of the line --
  669.     you don't have to go to the end of the line
  670.     before typing it.  Try typing some C code,
  671.     including while, if, and for statements.  Try
  672.     typing structure definitions.  Try typing
  673.     function definitions.  Try typing arrays.
  674.  
  675.     If you don't want the unusual behavior of the
  676.     electric characters, hold down the <Ctrl> key
  677.     while you type them.
  678.  
  679.     You will probably find the backward tab
  680.     command (<S-Tab> -- See (16)) useful in
  681.     electric-C mode.  In electric-C, the tab size
  682.     is changed to 4 characters, and word-wrap is
  683.     disabled.
  684.  
  685.     <A-%> adds a comment to the end of the
  686.     current line.  It is put in column 48 if the
  687.     line ends before that, or at the end of the
  688.     line followed by a tab if not.  The comment
  689.     column can be changed to 60 with a line like
  690.     "commentcolumn 60" in your .jotrc file.
  691.  
  692. (35) Matching parentheses and braces:
  693.  
  694.     In some C code, place your cursor in the
  695.     middle of a bunch of parentheses, brackets,
  696.     or braces.  Type <A-[> or <A-]> (they do the
  697.     same thing).  Type <A-[> again. And again.
  698.     Each time, the smallest balanced enclosed
  699.     region is selected.  To find which brace
  700.     matches a particular closing brace, just put
  701.     the cursor just inside the brace in question,
  702.     and type <A-[>.
  703.  
  704.     If a huge chunk is selected, you might try
  705.     <A-Home> and <A-End> to see the beginning and
  706.     end of the selection.  See (28).
  707.  
  708. (36) Using ctags:
  709.  
  710.     In a directory with a bunch of C (or C++)
  711.     files, run the UNIX command "ctags *.c".
  712.     Then start jot on a .c file.  Middle click on
  713.     the function name in a function call, and
  714.     type <C-t>.  You should be moved to the
  715.     correct file and line with that function's
  716.     definition, assuming ctags found it among the
  717.     files in that directory.  See the UNIX ctags
  718.     documentation for more information on how to
  719.     use ctags to make an appropriate tags file.
  720.  
  721. (37) Quick word search:
  722.  
  723.     If you see a word in your file and you would like
  724.     to find the next occurrence of it, double click
  725.     it with the left mouse button to select it, and
  726.     type <C-f>.
  727.  
  728. (38) General UNIX filters:
  729.  
  730.     The filter command <C-G> lets you type in a
  731.     UNIX command.  The selected text is cat-ed to
  732.     the command you type, and the results are
  733.     placed in the cut buffer which can be used or
  734.     ignored.  The contents of the first few lines
  735.     of the cut buffer are shown momentarily.  See
  736.     (39, 40, 41, 42) for some examples.  If you
  737.     have the filter text in the cut buffer, you
  738.     can invoke it as <C-A-p>.  See (43, 44).
  739.  
  740. (39) Sorting a set of lines: (38)
  741.  
  742.     Select some lines of text, including the
  743.     final newline.  Type <C-G>.  Type "sort" into
  744.     the dialog box.  Then type <C-v> (Paste).
  745.     The lines of text are now sorted.
  746.  
  747. (40) Counting the lines of text in your file: (38)
  748.  
  749.     Select all the lines in your file with
  750.     <C-A>.  Type <C-G>, and use the filter "wc"
  751.     (word count).  The count in lines, words, and
  752.     characters appears momentarily.  <A-S-.> lets
  753.     you look at the cut buffer for as long as you
  754.     want.
  755.  
  756. (41) Mailing lines to text: (38)
  757.  
  758.     Suppose you want to mail some lines of text
  759.     to the person whose user name is "davis".
  760.     Select the lines (including the final
  761.     newline), type <C-G>, and use the filter
  762.     "/bin/mail davis".  The selected lines will
  763.     be mailed to user davis.
  764.  
  765. (42) Printing all or part of your file: (38)
  766.  
  767.     Select the lines of text you want to print
  768.     including the final newline, or use <C-A> to
  769.     select the whole file, if you want to print
  770.     the whole thing.  Type <C-G>, and use the
  771.     filter "lp" to print the file.  See (44).
  772.  
  773. (43) Macro example (Sorting): (20, 22, 27, 38)
  774.  
  775.     Type
  776.     "<C-F3>sort<A-4><S-leftarrow><C-x><C-A><C-G><A-v><C-F3>"
  777.     (without the double-quote characters).  This
  778.     macro sorts all the lines in your file.
  779.     (Make sure your file ends with a newline).
  780.     The macro works by adding the characters
  781.     "sort" to the file (this puts the cursor
  782.     after the "t".  <A-4> is a command
  783.     multiplier, and <S-leftarrow>
  784.     (Shift-leftarrow) extends the selection one
  785.     character to the left, but the <A-4> makes it
  786.     happen 4 times.  <C-x> puts "sort" into the
  787.     cut buffer (and removes it from the file).
  788.     <C-A> selects the entire file, <C-G>
  789.     applies the contents of the cut buffer as a
  790.     UNIX filter, putting the result (the sorted
  791.     file) into the cut buffer, and finally, <C-v>
  792.     pastes the result, clobbering the previous
  793.     contents of the file.
  794.  
  795. (44) Making a print macro: (20, 22, 27, 38, 43)
  796.  
  797.     Type
  798.     "<C-F3>lp<A-2><S-leftarrow><C-x><C-A><C-A-p><C-F3>".
  799.     The F3 key now prints your entire file.
  800.  
  801. (45) Inserting the contents of a file:
  802.  
  803.     "Insert File" from the "File" pull-down menu
  804.     inserts the contents of a file at the
  805.     cursor.  If text is selected, it is deleted
  806.     and replaced by the contents of the inserted
  807.     file.
  808.  
  809. (46) The SGI File Selection Dialog: (0)
  810.  
  811.     By default, you will get an SGI File
  812.     Selection Dialog with  file completion and
  813.     drag and drop.  If you don't want this, put
  814.     the line "nobrowsegizmo" in your .jotrc
  815.     file.
  816.  
  817. (47) Searching through directories (nobrowsegizmo): (46)
  818.  
  819.     When you are asked for any file name (try
  820.     Open, for example), and you are not using the
  821.     Showcase browse gizmo, you can cycle through
  822.     possible file names with the arrow keys.  The
  823.     <uparrow> and <downarrow> keys go through
  824.     different possible names with the prefix
  825.     you've already typed.  The left and right
  826.     arrows move up and down in the file system.
  827.  
  828. (48) Multiple files:
  829.  
  830.     If you invoke jot with more than one file,
  831.     you will visit the first one, and the other
  832.     names appear in the Reopen roll-over menu in
  833.     the "File" pull-down menu.  Each time you
  834.     visit a new file, it is added to the reopen
  835.     list.  If you just click on the "Reopen"
  836.     command without rolling over, you will go
  837.     back to the last file you visited.  Note that
  838.     you go back to the same place, and all marks
  839.     are preserved.
  840.  
  841. (49) Changing fonts: (0)
  842.  
  843.     Invoke jot with "-F 9" or "-F 15" to get a
  844.     font that is 9 or 15 pixels wide.  The defaut
  845.     width is 8 pixels.  You can add a line to
  846.     your .jotrc file like "fontwidth 9" to make
  847.     this size the default.  At present, 9 and 15
  848.     are the only possibilities.
  849.  
  850. (50) Changing colors: (0)
  851.  
  852.     If you don't like the colors jot uses, put a
  853.     line like "colors # # # #", Where each # is
  854.     an index into the color map.  Make sure
  855.     they're all different.  In order, they are
  856.     the background color, the text color, the
  857.     cursor color, and the selection color.
  858.  
  859. (51) Changing window size (0)
  860.  
  861.     Invoke jot as "jot -P 100,600,200,800" to
  862.     make a window that goes from 100 to 600 in
  863.     the x direction and 200 through 800 in the y
  864.     direction.  To make this permanent, put the
  865.     line "position 100 600 200 800" in the .jotrc
  866.     file.
  867.  
  868. (52) Backups and checkpoints (0)
  869.  
  870.     If you add the line "backups" to your .jotrc
  871.     file, jot will copy each file as you edit it
  872.     and add the extension ".bak".  If you have a
  873.     line like "autosavecount 300" in your .jotrc
  874.     file, every 300 keystrokes, jot will write
  875.     out a copy of the file with the extension
  876.     ".sav".
  877.  
  878. (53) Jot as the default editor
  879.  
  880.     If you want to use jot as your default visual
  881.     editor, make a file (called, say, visjot),
  882.     that contains the following text:
  883.  
  884.     #!/bin/sh jot -f $1
  885.  
  886.     Then make it executable and put it in your
  887.     path.  Set your environment variable VISUAL
  888.     to the pathname for visjot.
  889.  
  890.     To make it work in Workspace, you've go to
  891.     set the environment variable WINEDITOR to
  892.     jot.
  893.  
  894. (54) Two window jot:
  895.  
  896.     Make an executable file called jot2
  897.     containing the following:
  898.  
  899.     #! /bin/csh -f jot -p500,1272,520,992
  900.     $argv[1] jot -p500,1272,8,480 $argv[2]
  901.  
  902.     Put it in your path.  Then "jot2 file1 file2"
  903.     will fire up two jots on the two files.  You
  904.     can cut and paste between them.
  905.  
  906. (55) Saving macro definitions
  907.  
  908.     Select Options->Save Macros from the pulldown
  909.     menus to save all the current macro
  910.     definitions to the file ~/.jotmacs.  Each
  911.     time you restart jot, .jotmacs is read.
  912.  
  913. (56) X windows cut buffer
  914.  
  915.     To cut and paste between X applications and
  916.     jot, use the XCut, XCopy, and XPaste commands
  917.     (<C-A-x>, <C-A-c>, and <C-A-v>,
  918.     respectively).  This cutbuffer is independent
  919.     of the regular jot cutbuffer.
  920.  
  921. (57) Using the textpointers in a macro (20, 22,
  922.      27, 31, 38, 43)
  923.  
  924.     The commands <A-k>, <A-K>, and <C-A-k> copy
  925.     the textpointers into marks 8 and 9, copy
  926.     marks 8 and 9 into the textpointers, or swap
  927.     the marks 8 and 9 with the textpointers,
  928.     respectively.  A macro to print the selected
  929.     lines might look like this:
  930.     "<C-F3><A-k><C-a>lp<A-2><S-leftarrow><A-x><A-K><C-A-p><C-F3>".
  931.     It saves the marks, puts the string "lp" in
  932.     the cut buffer, re-selects the text, and then
  933.     applies the lp filter.  This macro could be
  934.     improved somewhat by adding a carriage return
  935.     at the end of the selection to make sure lp
  936.     works.  (Go to mark 9, add a return, print,
  937.     delete the return, ...)
  938.  
  939. (58) Repeat command
  940.  
  941.     The <Insert> button repeats the last command
  942.     issued, or retypes the last sequence of
  943.     text.  For example, if you want to replace a
  944.     few words in your text by "abcde", select the
  945.     first word, type "abcde", select the second
  946.     word, type <Insert>, select the third, type
  947.     <Insert>, and so on.
  948.