home *** CD-ROM | disk | FTP | other *** search
- JOT TUTORIAL
-
- The first section teaches you how to start jot,
- add text, backspace, cut, copy, paste text,
- select text, scroll and pan around in the file,
- save the results, and quit. If you know how to do
- that, skip to the "ADVANCED TOPICS" section.
-
- If you want to see why jot is a neat editor, try
- exercises (11, 12, 20, 21, 31, 35, 36, 37, 39) in
- the last section after reading about "Speed Keys"
- in the BASIC JOT section.
-
- If you have previously used jot or zip and want
- to use original "Speed Keys" (accelerators), add
- the string "oldaccelerators" to your $HOME/.jotrc
- file. Type "jot /usr/lib/jot/jot.tutorial.orig"
- to use the tutorial for the original
- accelerators.
-
- BASIC JOT
-
- Starting jot:
-
- At the shell, type "jot" or "jot filename". On
- the Desktop, double click on the jot icon, or
- drop the icon of the file to be edited on the
- jot icon. For what follows, use a somewhat
- large file that you don't care about.
-
- Typing text:
-
- Type some text. It appears at the red
- vertical bar cursor. Type the <Backspace>
- key -- one character is deleted. Try typing
- in <Tab> characters and the <Enter> key. Try
- backspacing over both types of characters.
-
- Moving the cursor:
-
- Move the mouse to point the arrow cursor
- between characters. Click with the left
- mouse button. Now try typing and
- backspacing.
-
- Sweep-select:
-
- Press the left mouse button down over the
- text and move the mouse before you release
- it. The region in white is "selected".
- Notice how <Tab> characters and newlines at
- the ends of lines are selected. On a big
- file, try moving the cursor above, below, to
- the left, and to the right of the window as
- you sweep-select.
-
- Deleting text:
-
- Sweep-select the text you want to delete.
- Type backspace.
-
- Moving and copying text:
-
- Sweep-select some text. Press the left mouse
- button down over the word "Edit" in the bar
- at the top of the window. Keeping the button
- down, slide down until the word "Copy" is
- highlighted. Release the button. You now
- have a copy of the selected text in your "cut
- buffer". Move the cursor somewhere else.
- Select "Paste" from the edit menu the same
- way you just did "Copy". A copy of the text
- is pasted at the cursor. Paste again. You
- get another copy.
-
- Select some text. This time, use the "Cut"
- command instead of "Copy" from the "Edit"
- menu. Your text disappears, but a copy is
- put in the cut buffer. You can now paste it,
- as before. This is a good way to move text.
-
- Undoing mistakes:
-
- Select the "Undo" command from the "Edit"
- menu. It will undo the last thing you did.
- Use "Undo" again. And again. And again.
- After a few Undo's, try the "Redo" command in
- the same menu. Repeat a few times.
-
- Speed keys:
-
- Press the left mouse button over the "Edit"
- menu and hold it down. Note that at the
- right of the "Undo" command is the text
- "Ctrl+Z". This means that if you hold down the
- left <Ctrl> key and type the letter "z", it
- performs the "Undo" command. Try holding
- down <Ctrl>, and type a few z's. In this
- text, we will denote it by <C-z>.
-
- <C-z> (Undo) is different from <C-Z>
- (Uppercase). To issue the "Uppercase"
- command with a speed key, you have to hold
- down both <Ctrl> and the <Shift> keys before
- you type the "z". In the jot menus a <C-Z>
- is denoted by "Ctrl+Shift+Z"
-
- <C-j> means hold down the <Ctrl> key and type
- "j"; <C-A-m> means you must hold down both
- the <Alt> and <Ctrl> keys and type "m".
- <A-S-.> means the <Alt> and <Shift> keys must
- be held down before you type ".".
-
- Scrolling:
-
- Press the left mouse down with the cursor in
- the scroll area to the right of the text.
- Move the cursor up and down. The white bar in
- the scroll area shows the selected region.
- Try selecting and editing in other parts of
- the file. Copy text from one part of the
- file to another.
-
- Type text until you make a really long line.
- Now hold down both the left Alt and Ctrl keys
- and press the right mouse button down in the
- window and move it around before releasing
- it. The text pans with it -- right, left,
- up, and down.
-
- Saving Files:
-
- You probably don't want to do it, but under
- the "File" pull-down menu is a command called
- "Save". This will save your changes to the
- file. "Save As" will ask you for a new file
- name to use.
-
- Visiting new files:
-
- The "Open" command in the "File" pull-down
- menu will ask you for the name of a new file
- to edit. Try it.
-
- Quitting:
-
- The "Exit" command is in the "File" pull-down
- menu.
-
- Experiment:
-
- Look in the other pull-down menus, and
- experiment. You can probably figure out most
- of the commands and learn their speed-key
- equivalents. Try the help command in the
- "Help" pull-down menu.
-
- ADVANCED TOPICS
-
- What follows is a table of contents of advanced
- or unusual topics. Each is followed by a number
- or numbers. To learn about that topic, try out
- the exercise at the end of this document with the
- corresponding number(s). If the exercise title
- has numbers after it, those are recommended
- prerequisite exercises.
-
- Under the Options menu is an entry that gives you
- more possibilities in your other pull-down menus.
-
- Search/Replace
- Forward search (1)
- Reverse search (2)
- Quick search for a word (37)
- Incremental search (3)
- Case insensitive search (4)
- Replace all (5)
- Query replace (6)
- Pattern (regular expression) search (7)
- Pattern (regular expression) replace (8)
-
- Text
- End of line word wrap (9)
- Typing weird characters (10)
- Indentation (11)
- Reformat paragraphs (12, 23, 29)
- Changing UPPER/lower-case (13)
- File to file move/copy (14)
- Repeat command (58)
-
- Tabs
- Setting tab sizes (15)
- Backward tab (16)
- Back up hacking tabs (17)
- Indentation (11)
-
- Cut buffer
- Appending to cut buffer (18)
- Viewing the cut buffer (19)
- X windows cut buffer (56)
-
- Advanced topics
- Macros (20, 21, 29, 43, 44, 57)
- Saving macro definitions (55)
- Repeat counts (22)
- Special editing speed-keys (25)
-
- Selection
- Word/line/paragraph select (26)
- Extend selection (27)
- Jump to ends of selection (28)
-
- Viewing
- Using the keyboard to move (30)
- Marking places in a file (31)
- Jump to line (32)
- Finding the line number (33)
-
- Writing C code
- Electric C mode (34)
- Indentation (11)
- Matching parentheses, braces (35)
- Using ctags (36)
-
- Filters
- UNIX commands on jot text (38)
- Sorting lines of text (39)
- Counting lines of text (40)
- Mailing text (41)
- Printing text (42)
-
- Files
- Inserting a file (45)
- The Showcase browse gizmo (46)
- Directory navigation (47)
- Editing multiple files (48)
-
- Jot Setup
- The .jotrc file (0)
- Changing fonts (49)
- Changing colors (50)
- Changing window size (51)
- Changing margins (24)
- Backups and checkpoints (52)
- Jot as the default editor (53)
- Using 2 windows (54)
-
-
- EXERCISES
-
- (0) The .jotrc file:
-
- Jot defaults are saved in the file called
- ".jotrc" in your home directory. Jot reads
- it once when it comes up. If you change the
- file, you have to restart jot before the
- changes will take effect.
-
- (1) Standard forward search:
-
- <C-F> asks for a search string. Type it
- followed by <Enter>. If there is selected
- text, <C-f> searches for the next copy of
- that text; otherwise, it repeats the previous
- search.
-
- (2) Reverse search: (1)
-
- <C-B> asks for a search string. Type it
- followed by <Enter>. It is the same as
- forward search, but searches backwards. If
- there is selected text, <C-b> searches
- backwards for the previous copy of that text;
- otherwise, it repeats the previous search.
-
- (3) Incremental search: (0, 1, 2)
-
- Put the line "incrsearch" in your .jotrc
- file. Restart jot on a file. Now <C-F> does
- nothing (but look at the window header). Now
- type the characters of the string you're
- searching for. If you make a mistake, type
- backspace. Type <Esc> to stop searching.
- Try "Undo" during incremental search. Try
- <C-f> during an incremental search. Now try
- the same thing with <C-B> and <C-b>. If you
- don't like the mode, get rid of the
- "incrsearch" line in your
- .jotrc file.
-
- (4) Case-insensitive search: (1)
-
- If you want your search for "abc" to find
- things like "AbC" and "Abc", use the "Search
- by Case" command in the "Options" pull-down
- menu. Then use standard search or reverse
- search commands. You can toggle back to be
- case-sensitive again.
-
- (5) Replace to end of file:
-
- <C-r> brings up a dialog box. Type the
- search string and replacement string into the
- slots, and click on "Confirm". Use the mouse
- or <Enter> key to move between the slots.
- The replacement is done from the cursor
- position to the end of the file.
-
- (6) Query replace: (1)
-
- Type the replacement text into the file and
- select it. "Cut" it to delete it from the
- file and put it in the cut buffer. Now do a
- standard search command to find the next
- occurrence of the text to be (possibly)
- replaced. If you don't want to replace it,
- type <C-f> (repeat the search to the next
- one). If you do, type <A-g>, which means
- "Paste, and repeat the forward search". Work
- your way through the file with <C-f> and
- <A-g>.
-
- (7) Regular expression search: (1, 7)
-
- Suppose you want to find the string "long"
- that appears at the beginning of a line of
- text. Type <C-A-F>. Now give the string
- "^long" (without the double-quotes) as your
- string. Jot will place you on a line of with
- "long" as the first word in the line. See
- the manual pages for the UNIX command "ed"
- for more information on regular expressions.
- <C-A-f> repeats the last regular expression
- search. Here are some more examples of
- regular expressions:
-
- "^......$" and "^.{6}$" match lines with
- exactly 6 characters in them.
-
- "a.*e.*i.*o.*u" matches lines in which all 5
- vowels appear in order. (Try loading
- /usr/lib/dict/words and look for other
- interesting words using regular expressions.)
-
- "and.*and" matches strings containing the
- word "and" at least twice.
-
- "\([0-9]*\)" matches lines containing a
- number enclosed in parentheses.
-
- "^[a-zA-Z][a-zA-Z0-9]*:" searches for lines
- beginning with a C-style label.
-
- "a[c-z]*b[abd-z]*c[a-ce-z]*d" matches words
- (in lowercase letters only) that contain the
- letters "a", "b", "c", and "d" in order with
- other letters possibly intervening.
-
- (8) Regular expression replace: (5)
-
- This is just like the replace command, except
- that it is invoked with <C-A-r>. The search
- string is a regular expression, possibly with
- parts of the expression enclosed in
- parentheses and followed by numbers. These
- can be referenced in the replacement string.
- (See the UNIX "ed" documentation).
-
- For example, suppose you would like to
- replace all occurrences of numbers in
- parentheses by the same numbers in square
- brackets. Use "\(([0-9]*)$1\)" as the
- search string and "[$1]" as the replacement
- string.
-
- As another example, suppose you have a bunch
- of entries in a file that look like [abc,defg]
- and you would like to swap the strings that
- are separated by the comma, so the string
- above would be converted to [defg,abc]. Use
- "\[(.*)$1,(.*)$2\]" as the search string,
- and "[$2,$1]" as the replacement string.
-
- (9) Word wrap: (0)
-
- Toggle the word wrap with the command in the
- "Options" pull-down menu. Now try typing a long
- line (but type characters at the end, not in
- the middle). When you reach column 72, the
- line will break. You can change the margin
- (see exercise 24). You can make word
- wrapping the default by adding the line
- "wordwrap" to your .jotrc file.
-
- (10) Typing weird characters:
-
- If you need a special character in the file,
- say a formfeed, you have to know the ASCII
- value of it. Formfeed is 12. Hold down the
- <Alt> key, type "1", "2", release the <Alt>
- key, and type <Esc>. You will see a three
- letter sequence "X0C" in your file, sometimes
- with a box around the "X". This represents
- the hexidecimal code for the character,
- namely "0C". Try selecting, copying, and
- moving the new character. It moves as a
- chunk. To add the ASCII null character, type
- <A-2><A-5><A-6><Esc>. Jot masks the result
- to 8 bits.
-
- (11) Indentation:
-
- Select a set of lines whose indentation you
- want to change. Type <C-i>. They indent by
- 4 columns. <C-I> "outdents" them by 4
- columns. Try <A-2><A-1><C-i>. This indents
- them by 21 columns. Try the same thing for
- outdentation.
-
- (12) Reformatting paragraphs:
-
- Select a paragraph or set of paragraphs that
- has a very ragged right margin. Now type
- <C-R>. All paragraphs are reformatted to the
- current right margin. See exercise (23) to
- find out how to reformat with a different
- margin. See (24) to find out how to change
- the margin.
-
- (13) Changing to uppercase or lowercase:
-
- Select some text. Type <A-U>. Then <A-L>.
- Then <A-C>. <A-C> capitalizes the first
- letter of the selection.
-
- (14) Moving/copying text from file to file:
-
- The cut buffer is unchanged if you visit a
- new file. Just "Cut" or "Copy" the text in
- one file, visit another file, and "Paste"
- it. If you have 2 jot windows running on two
- different files, you can cut from one and
- paste into the other. See (54) for some nice
- ways to make 2 jot windows.
-
- (15) Setting tab sizes: (0)
-
- The default tab size is 8 columns. To change
- it, say, to 4 columns, add the line "tabsize
- 4" to your .jotrc file. Then restart jot.
- The <Tab> key will advance you by four
- columns at a time. Notice that it does so by
- adding the correct number of spaces and tabs
- to do the trick.
-
- (16) Backward tab:
-
- Place the cursor in front of a bunch of white
- space (which may be a mixture of tabs and
- spaces). Now type <S-Tab> a few times. Try
- it in front of non-white space.
-
- (17) Back up hacking tabs:
-
- Type a few tabs. Now type the <Backspace>
- key. Now type the <Delete> key instead -- it
- is just like <Backspace>, except if it hits a
- tab character, in which case it converts the
- tab to spaces before backspacing.
-
- (18) Appending to the cut buffer:
-
- Copy some text into the cut buffer. Now
- select some different text and type <C-C>.
- Now "Paste". <C-C> appended the second chunk
- to whatever was in the cut buffer. You can
- append as many chunks as you want. This is
- great for gathering a bunch of text from
- different places and putting it all in one
- place.
-
- (19) Viewing the contents of the cut buffer:
-
- Type <A-S-.> (hold the <Alt> and <Shift> keys
- down). A dialog box with the first few lines
- of the cut buffer is displayed.
-
- (20) Macro example:
-
- Suppose you would like to add a semicolon to
- the end of each line. Type <C-F1> (Use the
- F1 key at the top of the keyboard). Then
- type <C-e>;<downarrow>, and then <C-F1>
- again. <C-e> moves to the end of the line;
- you then type a semicolon, and the arrow key
- moves to the next line. Now type the F1 key
- again. And again. The commands between the
- two <C-F1>s are remembered and replayed each
- time you type F1.
-
- (21) Macro example (Nesting macros): (20)
-
- Type <C-F2>, then F1 F1 F1, and <C-F2>
- again. You've defined macro F2 to be three
- calls to F1. Type F2 to see.
-
- (22) Repeat counts; the command multiplier:
-
- Type <A-5> and then "a". The character "a"
- is inserted 5 times. Type "<A-1><A-2>k".
- This adds 12 k's to the file. Try
- <A-7><Backspace>. A command multiplier may
- be specified before any command. Usually, it
- just causes the command to happen that many
- times, but sometimes it has other effects.
- See exercises (10, 11, 23, 31).
-
- (23) Reformatting with an unusual margin: (12, 22)
-
- Put your cursor in a ragged paragraph. Type
- "<A-3><A-5><C-R>". This reformats the
- paragraph to 35 column margins.
-
- (24) Permanently changing margins: (0, 9)
-
- Add the line "margin 50" to your .jotrc
- file. Then restart jot. Turn word-wrap on,
- and try typing, or reformat a paragraph.
- Your right margin is now 50 columns. The
- right margin applies to word-wrap and
- reformatting. See (9, 12).
-
- (25) Editing speed keys: (22)
-
- <C-d> kills the character to the right of the
- cursor. <A-d> deletes to the end of the
- word. <A-Backspace> deletes to the beginning
- of the word. <C-k> kills to the end of the
- line. If the line is empty, it kills the
- newline character, joining the line to the
- next. <C-u> kills to the beginning of the
- line, unless the cursor is at the beginning,
- in which case it kills the previous newline,
- joining the line to the previous line.
- Repeat counts (see (22)) applied to <C-k> and
- <C-u> turn into whole line counts. Try
- <A-5><C-k>. It kills 5 lines, whether they
- are empty or not. <A-o> opens a line after
- the cursor. <A-O> opens a line before the
- cursor. <C-a> moves to the beginning of a
- line, and <C-e> moves to the end of the
- line. <Home> also moves to the beginning of
- the line. <End> move to the end of the line.
- <C-Home> moves to the top of the document and
- <C-End> moves to the button of the document.
-
- (26) Selecting words, lines, paragraphs:
-
- Double click with the left mouse in the text.
- It selects a word. Sweep select after double
- clicking. It sweep-selects words. Try
- clicking and sweep selecting with the leftmouse
- and middlemouse while the <Ctrl> key is
- pressed. These commands select and
- sweep-select lines and paragraphs. (A
- paragraph is delimited by 2 newline characters
- in a row).
-
- (27) Extend selection: (26)
-
- Once some text is selected, you can extend
- the selection using the usual selection
- mechanisms if you hold down the <Shift> key
- as you do. This applies to mouse sweep
- selection of characters, words, lines, and
- paragraphs. If the <Shift> key is down, the
- arrow keys also extend the selection. Try
- <S-leftarrow>, etc. If the <Alt> keys are
- held down with the arrow keys, the selection
- is even bigger -- to the beginning and end of
- line, or up and down to the top and bottom of
- the file.
-
- (28) Viewing the top and bottom of the
- selection:
-
- If you have a selection that is too big too
- see in your window, try <A-Home> and
- <A-End>.
-
- (29) A macro for reformatting to a different
- margin: (20, 23)
-
- Type "<C-F5><A-4><A-5><C-R><C-F5>". This
- makes the macro F5 reformat the selected
- paragraphs to a right margin of 45.
-
- (30) Moving around using the keyboard:
-
- Try using the arrow keys in the cluster just
- to the lower right of the main keyboard (not
- in the numeric key pad). They move (if
- possible) up, down, left, and right by a
- character. Hold down the <Ctrl> key and try
- them. They now move up and down by
- paragraphs, and left and right by words. Now
- try them with the <Alt> key. They move left
- and right to the ends of the line, and up and
- down to the top and bottom of the file.
- <Ctrl> means move a bit more, and <Alt> means
- move a lot more. Try the <PageUp>,
- <PageDown>, <Home>, <End>, <C-Home> and
- <C-End> keys in the cluster above the arrow
- keys.
-
- (31) Setting and jumping to marks:
-
- Place the cursor somewhere that you'll
- recognize in the file, and type <C-m>. Now
- move somewhere else in the file, and type
- <C-j>. <C-m> sets a mark, and <C-j> jumps to
- it. Notice the "0" in the scroll bar. Now
- go somewhere else in the file and type <C-m>
- again. This sets mark number 1. Try typing
- <C-j> repeatedly. Try <A-4><C-m>. This sets
- mark number 4. <A-4><C-j> jumps to mark 4.
- Note that the marks' approximate positions
- are indicated in the scroll bar by blue
- numbers. Click in the scroll bar with the
- right mouse near a blue mark. Click near
- another. Set your cursor to yet another
- place in the file, and hold the <Shift> key
- down while you click with the right mouse in
- the scroll bar. Mark 0 is reset to that
- place. Try deleting or adding text to the
- file above the marks, and notice that you
- still jump to the same place -- the marks
- move as text is added/deleted.
-
- (32) Jumping to a line:
-
- Type <C-l>. Type a line number into the
- dialog box and press <Enter>. You will jump
- to that line. Now type <A-4><A-3><C-l>. You
- will jump to line 43, and will not have to
- deal with the dialog box.
-
- (33) Show current line number:
-
- Type <A-.>. Try sweep-selecting a bunch of
- text and type <A-.>.
-
- (34) Electric-C mode: (0)
-
- Turn on electric-C mode using the toggle in
- the "Misc" menu (this turns it on in any
- file), or put the line "electriccmode" in
- your .jotrc file, which automatically turns
- it on in files with extensions ".c", ".h",
- ".C, ".c++", and ".C++".
-
- In electric-C mode, the keys "(", "{", "[",
- ",", """, "'", and the <Enter> key behave
- differently. Parentheses, brackets, and
- quotes are automatically matched, and
- additional text is sometimes added. A space
- is added after a comma. The <Enter> key
- usually works from the middle of the line --
- you don't have to go to the end of the line
- before typing it. Try typing some C code,
- including while, if, and for statements. Try
- typing structure definitions. Try typing
- function definitions. Try typing arrays.
-
- If you don't want the unusual behavior of the
- electric characters, hold down the <Ctrl> key
- while you type them.
-
- You will probably find the backward tab
- command (<S-Tab> -- See (16)) useful in
- electric-C mode. In electric-C, the tab size
- is changed to 4 characters, and word-wrap is
- disabled.
-
- <A-%> adds a comment to the end of the
- current line. It is put in column 48 if the
- line ends before that, or at the end of the
- line followed by a tab if not. The comment
- column can be changed to 60 with a line like
- "commentcolumn 60" in your .jotrc file.
-
- (35) Matching parentheses and braces:
-
- In some C code, place your cursor in the
- middle of a bunch of parentheses, brackets,
- or braces. Type <A-[> or <A-]> (they do the
- same thing). Type <A-[> again. And again.
- Each time, the smallest balanced enclosed
- region is selected. To find which brace
- matches a particular closing brace, just put
- the cursor just inside the brace in question,
- and type <A-[>.
-
- If a huge chunk is selected, you might try
- <A-Home> and <A-End> to see the beginning and
- end of the selection. See (28).
-
- (36) Using ctags:
-
- In a directory with a bunch of C (or C++)
- files, run the UNIX command "ctags *.c".
- Then start jot on a .c file. Middle click on
- the function name in a function call, and
- type <C-t>. You should be moved to the
- correct file and line with that function's
- definition, assuming ctags found it among the
- files in that directory. See the UNIX ctags
- documentation for more information on how to
- use ctags to make an appropriate tags file.
-
- (37) Quick word search:
-
- If you see a word in your file and you would like
- to find the next occurrence of it, double click
- it with the left mouse button to select it, and
- type <C-f>.
-
- (38) General UNIX filters:
-
- The filter command <C-G> lets you type in a
- UNIX command. The selected text is cat-ed to
- the command you type, and the results are
- placed in the cut buffer which can be used or
- ignored. The contents of the first few lines
- of the cut buffer are shown momentarily. See
- (39, 40, 41, 42) for some examples. If you
- have the filter text in the cut buffer, you
- can invoke it as <C-A-p>. See (43, 44).
-
- (39) Sorting a set of lines: (38)
-
- Select some lines of text, including the
- final newline. Type <C-G>. Type "sort" into
- the dialog box. Then type <C-v> (Paste).
- The lines of text are now sorted.
-
- (40) Counting the lines of text in your file: (38)
-
- Select all the lines in your file with
- <C-A>. Type <C-G>, and use the filter "wc"
- (word count). The count in lines, words, and
- characters appears momentarily. <A-S-.> lets
- you look at the cut buffer for as long as you
- want.
-
- (41) Mailing lines to text: (38)
-
- Suppose you want to mail some lines of text
- to the person whose user name is "davis".
- Select the lines (including the final
- newline), type <C-G>, and use the filter
- "/bin/mail davis". The selected lines will
- be mailed to user davis.
-
- (42) Printing all or part of your file: (38)
-
- Select the lines of text you want to print
- including the final newline, or use <C-A> to
- select the whole file, if you want to print
- the whole thing. Type <C-G>, and use the
- filter "lp" to print the file. See (44).
-
- (43) Macro example (Sorting): (20, 22, 27, 38)
-
- Type
- "<C-F3>sort<A-4><S-leftarrow><C-x><C-A><C-G><A-v><C-F3>"
- (without the double-quote characters). This
- macro sorts all the lines in your file.
- (Make sure your file ends with a newline).
- The macro works by adding the characters
- "sort" to the file (this puts the cursor
- after the "t". <A-4> is a command
- multiplier, and <S-leftarrow>
- (Shift-leftarrow) extends the selection one
- character to the left, but the <A-4> makes it
- happen 4 times. <C-x> puts "sort" into the
- cut buffer (and removes it from the file).
- <C-A> selects the entire file, <C-G>
- applies the contents of the cut buffer as a
- UNIX filter, putting the result (the sorted
- file) into the cut buffer, and finally, <C-v>
- pastes the result, clobbering the previous
- contents of the file.
-
- (44) Making a print macro: (20, 22, 27, 38, 43)
-
- Type
- "<C-F3>lp<A-2><S-leftarrow><C-x><C-A><C-A-p><C-F3>".
- The F3 key now prints your entire file.
-
- (45) Inserting the contents of a file:
-
- "Insert File" from the "File" pull-down menu
- inserts the contents of a file at the
- cursor. If text is selected, it is deleted
- and replaced by the contents of the inserted
- file.
-
- (46) The SGI File Selection Dialog: (0)
-
- By default, you will get an SGI File
- Selection Dialog with file completion and
- drag and drop. If you don't want this, put
- the line "nobrowsegizmo" in your .jotrc
- file.
-
- (47) Searching through directories (nobrowsegizmo): (46)
-
- When you are asked for any file name (try
- Open, for example), and you are not using the
- Showcase browse gizmo, you can cycle through
- possible file names with the arrow keys. The
- <uparrow> and <downarrow> keys go through
- different possible names with the prefix
- you've already typed. The left and right
- arrows move up and down in the file system.
-
- (48) Multiple files:
-
- If you invoke jot with more than one file,
- you will visit the first one, and the other
- names appear in the Reopen roll-over menu in
- the "File" pull-down menu. Each time you
- visit a new file, it is added to the reopen
- list. If you just click on the "Reopen"
- command without rolling over, you will go
- back to the last file you visited. Note that
- you go back to the same place, and all marks
- are preserved.
-
- (49) Changing fonts: (0)
-
- Invoke jot with "-F 9" or "-F 15" to get a
- font that is 9 or 15 pixels wide. The defaut
- width is 8 pixels. You can add a line to
- your .jotrc file like "fontwidth 9" to make
- this size the default. At present, 9 and 15
- are the only possibilities.
-
- (50) Changing colors: (0)
-
- If you don't like the colors jot uses, put a
- line like "colors # # # #", Where each # is
- an index into the color map. Make sure
- they're all different. In order, they are
- the background color, the text color, the
- cursor color, and the selection color.
-
- (51) Changing window size (0)
-
- Invoke jot as "jot -P 100,600,200,800" to
- make a window that goes from 100 to 600 in
- the x direction and 200 through 800 in the y
- direction. To make this permanent, put the
- line "position 100 600 200 800" in the .jotrc
- file.
-
- (52) Backups and checkpoints (0)
-
- If you add the line "backups" to your .jotrc
- file, jot will copy each file as you edit it
- and add the extension ".bak". If you have a
- line like "autosavecount 300" in your .jotrc
- file, every 300 keystrokes, jot will write
- out a copy of the file with the extension
- ".sav".
-
- (53) Jot as the default editor
-
- If you want to use jot as your default visual
- editor, make a file (called, say, visjot),
- that contains the following text:
-
- #!/bin/sh jot -f $1
-
- Then make it executable and put it in your
- path. Set your environment variable VISUAL
- to the pathname for visjot.
-
- To make it work in Workspace, you've go to
- set the environment variable WINEDITOR to
- jot.
-
- (54) Two window jot:
-
- Make an executable file called jot2
- containing the following:
-
- #! /bin/csh -f jot -p500,1272,520,992
- $argv[1] jot -p500,1272,8,480 $argv[2]
-
- Put it in your path. Then "jot2 file1 file2"
- will fire up two jots on the two files. You
- can cut and paste between them.
-
- (55) Saving macro definitions
-
- Select Options->Save Macros from the pulldown
- menus to save all the current macro
- definitions to the file ~/.jotmacs. Each
- time you restart jot, .jotmacs is read.
-
- (56) X windows cut buffer
-
- To cut and paste between X applications and
- jot, use the XCut, XCopy, and XPaste commands
- (<C-A-x>, <C-A-c>, and <C-A-v>,
- respectively). This cutbuffer is independent
- of the regular jot cutbuffer.
-
- (57) Using the textpointers in a macro (20, 22,
- 27, 31, 38, 43)
-
- The commands <A-k>, <A-K>, and <C-A-k> copy
- the textpointers into marks 8 and 9, copy
- marks 8 and 9 into the textpointers, or swap
- the marks 8 and 9 with the textpointers,
- respectively. A macro to print the selected
- lines might look like this:
- "<C-F3><A-k><C-a>lp<A-2><S-leftarrow><A-x><A-K><C-A-p><C-F3>".
- It saves the marks, puts the string "lp" in
- the cut buffer, re-selects the text, and then
- applies the lp filter. This macro could be
- improved somewhat by adding a carriage return
- at the end of the selection to make sure lp
- works. (Go to mark 9, add a return, print,
- delete the return, ...)
-
- (58) Repeat command
-
- The <Insert> button repeats the last command
- issued, or retypes the last sequence of
- text. For example, if you want to replace a
- few words in your text by "abcde", select the
- first word, type "abcde", select the second
- word, type <Insert>, select the third, type
- <Insert>, and so on.
-