
	START HERE

Hello, welcome to wily.  Once you've finished this
tutorial you will know nearly all of wily's features, and
hopefully be addicted.  Wily is quite different from
any editor you're already familiar with, but it isn't
difficult to learn the wily way.

SCROLLING UP AND DOWN

	The Scroll-bar

The scrollbar is the vertical bar to the left.  Clicking in
it with different mouse buttons scrolls the text window.
The left and right mouse buttons scroll up and down
respectively, by an amount proportional to how far down the
scroll-bar you click.  The middle mouse button scrolls to a
particular position within the text.  The "thumb" on the
scrollbar shows the position and size of the displayed
portion of the file.  If you hold a mouse button down in
the scroll bar, the window will keep scrolling.

	Movement keys

The PageUp and PageDown keys move the text window up or
down by 1/2 a window.  The Home and End keys move
the window to the top or bottom of the document.
The arrow keys move the "selection" by one character
or line.

Try these out now.

RIGHTMOST MOUSE BUTTON

This is also known as the "goto" button.  Selecting some
text (or clicking in some text) with the rightmost button
makes wily "goto" that text.  What this means depends on
what the text is.

Try clicking with the rightmost mouse button in some of
these examples:  (NB wily will warp the cursor to the place
you "goto"--nine times out of ten this is what you want)

hello.c
hello.c:3
hello.c:/^main
hello.c:/p.*f
FNORD
Gnu
FNORD
$HOME

As you can see, you can "goto" a file, a directory, a
specific line of a file, a regular expression (see Sam(1))
within a file, an environment variable that represents any
of these, or the next occurrence of a piece of text.  You
can use the "goto" mouse button on _any_ piece of text
anywhere in wily.

MIDDLE MOUSE BUTTON

This is also known as the "exec" button.  Selecting some
text (or clicking in some text) with the middle mouse
button makes wily _execute_ that text.  If the command
which is executed produces any output, it will be sent to
another wily window (which will be created if necessary).

Try clicking with the middle mouse button in some of these
examples:

who
pwd
id
date
./script

	Builtin Functions

Wily provides some builtin functions which it searches for
first when asked to "exec" some text.  By convention, these
all start with capital letters.  You will see most of them
on the screen right now.  For example, to exit wily, (don't
do this now!), you would click with the "exec" (middle)
mouse button somewhere in the word "Quit".

To delete a window, click with the "exec" (middle) mouse
button (but not right now) on the word "Del" somewhere in
that window.

LEFT MOUSE BUTTON

This is also known as the "select" button.  This button is
used to select text, to be acted on later.  Selected text is
highlighted (in reverse video).  Text typed with
the keyboard replaces the current selection.
Double-clicking with the left mouse button selects a word,
a line, or the text delimited by quote marks, braces or
brackets, depending on where the double-click occurs.

The "exec" (middle) and "goto" (right) mouse buttons will
use an existing selection if they are clicked inside it.

Try this now:  double-click just inside the quotation marks
in the paragraph below to _select_ the complex command,
then click with the "exec" (middle) mouse button in the
selection (reversed text) to execute the command.  Here is
the command:

"grep -n main *"

Now modify the command above by double-clicking on "main"
to select it, typing "select", double-clicking just inside
the quote marks to select the whole command again, then
clicking inside the selection with the "exec" (middle)
button.

BUILTIN FUNCTIONS

These are pieces of text that wily recognises and treats
specially.  By convention, they all start with capital
letters.  They are often placed somewhere on the screen by
wily, but their positions aren't magical:  you can type
(for example) 'Quit' _anywhere_ on the screen, and click in
it with the "exec" (middle) button to quit wily.

The builtin functions are:

Undo and Redo
	Wily keeps an infinite undo history.  Make a lot of
	changes to this file (type stuff and delete stuff),
	and then click with the middle (exec) button on
	Undo repeatedly until the black square disappears
	from the little box in the top left of this
	window.  The black square indicates that what you
	see on the screen is _not_ the same as what is on
	disk.

Put and Get
	Use these to write a file to disk, or fetch the old
	version from disk, respectively.  If the file
	cannot be written, a diagnostic message will tell
	you about it.  Putall writes all dirty files to disk.

Newcol and Delcol
	Used to create and delete columns.

Cut Paste Snarf
	All of these act on the most recent selection.

Del
	Delete a window.  If the window represents a file
	with some changes that haven't been written to
	disk, a backup copy will be made, and a diagnostic
	message printed.

Quit
	Exits wily.  Also backs up any modified files before
	quitting.

New
	Create a new file.

Kill
	Kill a process which was started by wily.  Must be
	called with the name of the process (as seen at the top
	left of the wily tag) as an argument.

USING UNIX TOOLS

As well as treating builtin functions specially, the "exec"
mouse button also treats specially text which starts with
any of the symbols | < or >

If the command you select with the "exec" (middle) mouse
button starts with one of these, the command is run using
the most recent selection as its input or output or both.
For example, select the entire list below with the left
button:

banana
apple
pear
carrot

then click with the middle (exec) button in the command
below:

|sort

You can use Undo to undo the change and do it again if you
like.

Similarly, select the paragraph below:

'Twas brillig and the slithy toves
did gyre and gimble in the wabe.
All mimsy were the borogroves

and "exec" this command:

>spell

Finally, select this text:

"right now"

and "exec" this command:

<date

MOUSE BUTTON COMBINATIONS

This is cool (in my opinion).

A few common functions can be done using combinations of
mouse buttons.

		Cut/Paste

Try this:  select some text using the left (select) mouse
button, but keep holding the button down, and while still
holding the left button down, click with the middle
button.  The text will be "Cut".  Similarly, select a different
position with the left button and click the right button to
"Paste."  If you want to copy (rather than move some text)
select it, and while still holding down the left button,
click with the middle button to "Cut", and then (still
holding the left button) click with the right button to
"Paste" it back to the original position.  You can then
move to the place where you want to copy the text,
and "Paste" the new copy.

Once you're used to it, this is a very comfortable and
quick way to move text around.

		Execute with argument

The other mouse-combination short-cut is a way of giving
an argument to a command.  If while holding down the middle
button in some command to be executed, the left button is
pressed, then the most recent previous selection will be used
as an argument to that command.

Try it with the commands below--select some text somewhere
on the screen, then click in the command with the middle
button, and _while holding it down_ click with the left mouse
button.  Try it with these commands:

echo
findword

(You can have a look at the findword script by clicking
with the rightmost mouse button).


MOVING WINDOWS AROUND

Windows and columns can be dragged around using the "resize
box" (the small square at the top left of each window),
using any mouse button.

Also, clicking in the resize box changes the size of the
associated window.  Clicking with the left button makes it
grow a bit, clicking with the middle button makes it take
up all available room, shrinking the other windows so that
just their tags are showing, and clicking with the right
mouse button in a window's resize box makes it take up its
entire column.

FURTHER INFORMATION

Congratulations!  You've finished the wily tutorial.

Please edit the text below inside the []s, doubleclick
inside the square brackets to select it all, and click with
the middle button on >./send_to_gary

[  I finished the wily tutorial.
I thought it was too fast/too slow/just right.
I will definitely/maybe/never use wily again.
I think the interface is interesting/horrid/cool.
And furthermore ...]

For more information:

netscape http://www.cs.su.oz.au/~gary/hobby/wily/auug.html

To finish up, click in the word Quit with the middle mouse
button.
