TEACH USINGMACX A.Sloman 27 Sept 1994 [incomplete -- to be extended] [This is a first draft set of notes. It is probably still unclear in various places and perhaps also incorrect. Please let me have your suggestions for improvement, and please report errors. If you are not sure whether it is an error or not, tell me anyway, as it may be, and in that case the sooner I fix it the better for others.] ======================================================================= -- Introduction ------------------------------------------------------- This file gives a short introduction to the techniques relevant to - running Mac X, - opening an Xterm window logged in to the Unix network, - giving various Unix commands, - running the editor VED. (Other editors are also available, including Emacs, and vi.) Once you have learnt to use VED (or Emacs) you can use it as a basis for creating files, reading other files on the system, reading and sending mail and generally accessing information on the Unix network. In order for the following to work for you your Mac needs to have been set up properly, and you also need your Unix account to have been set up properly to support this kind of use. You will need to know your Unix username and your password on the Unix system. If necessary, please ask for help. -- How to get started ------------------------------------------------- What follows is a set of instructions for getting started. As with any complex system there are ways in which things may go wrong, and if that happens please do not blame yourself. Please ask for help. It takes practice to build up confidence and fluency. 1. Start your Mac if necessary. If you have already been running the Mac for some time, and using several applications it may be advisable to shut it down and restart, to ensure that enough memory is available. 2. Open the hard disk if necessary (by double clicking). 3. Select the MacX application, by double clicking on the MacX icon: this should display a new window containing several icons. 4. Select the icon labelled "USE THIS" This will start up MacX, which will take a minute or so. While it is starting up a window will appear showing how much memory is being used. When MacX has been started, the panel will go away, and a new word "Remote" should appear on the top menu bar. (If it fails the machine may have run out of memory: shut it down and restart, or ask for help). 5. Select "Remote" with the mouse from the top menu bar. (Hold the mouse button down). This will pull down a menu with some commands near the bottom. Slide the mouse pointer down, while holding the button down, and select the "xterm" or "fc.xterm" option. [Note there may be a "mail" option in the menu but if you select that you will merely be able to read and send mail. It will not allow you to edit files and run other applications: it does not "log you in" to unix fully. It is very easy to use for reading and sending mail, but does nothing else, so it is very restrictive.] 5a. After you have selected "xterm" you will be asked to type in your Unix username. Do that and press RETURN. When prompted again type in your password and then press RETURN. (Or you may be asked ONLY for your password, depending on the setup.) 5b. You will then be asked whether to permit a remote application to start on your machine. Select the option that permits it. 6. If all goes properly you should then have a new window on the screen, logged in to Fat Controller (or whichever machine has been set up as your default.) This window, (which is an "xterm" window), can be set up to have a size that suits you, a font that suits you, and if you prefer it can use inverse video, i.e. white on black (which I find much less tiring than reading black on white). In order to change the defaults you can ask for help in editing the setup file for the MacX commands, which is accessible from the "remote" menu option. -- Using Unix --------------------------------------------------------- By typing commands into the xterm window you can run many different Unix applications, including xmail (if you wish that) other mail tools, Netnews browsers, World Wide Web browsers, and more besides. You can also log into other machines on our network, or even into machines elsewhere on the campus or in other countries! -- Directories and files On the Unix system we have very large disks containing a lot of files of various kinds. These are divided into "directories". Each user has a directory and when you log in you are usually "attached" to your "home" directory. However you can change to different directories, using the unix "cd" command. You can also create new directories, using the "mkdir" command. You can list the contents of the current directory using the "ls" command, and find out which directory it is, by using the "pwd" command (Print Working Directory). If you wish to find out what your current directory is you can give the "print working directory" command to unix: pwd Your login set up may have been arranged so that instead of starting up in your home directory you switch automatically to a sub-directory which is protected so that other people cannot read it. Then if you wish to have some files that other people can read, you put them in your home directory, but files in your sub-directory will be readable only by you. (Some people prefer to protect all their directories, but that makes it hard for others to help you, and hard for you to create files for others to look at.) -- -- Some other Unix commands If you wish to find out whether you have any mail messages, and who they are from, type: from If you wish to find out when last Aaron Sloman logged in and read mail, you can type finger sloman or finger axs or finger (The "finger" command also prints out the user's ".plan" file giving information that may or may not be helpful, e.g. phone number, office number, preferred presents, etc. You can create your own .plan file after you have learnt to use the editor.) There are many other Unix commands you can try, including date - show the current date and time (not always accurate!) ls - list the files in your current directory ls -l - give a "long" listing, showing protections and sizes of files. If you wish to find out who else is logged in to the machine, type who -- Starting to use VED ------------------------------------------------ There are two very powerful editors used in the school, Emacs and VED. Which you use is a matter of taste. I prefer VED because I know it well. Many other people prefer Emacs. I can't explain how to use Emacs because I don't know it well enough. So I shall explain how to use VED, and if you try using it I shall be able to provide help if you get into difficulties. VED will only work for you if you have been set up as a VED user. For this it is best to check with Keith or Aaron. If you have been set up as a VED user you can then type ved or if you wish to edit a file called "foo" type ved foo (For now it is best to avoid spaces or other characters apart from letters, numerals and "." and "-" in file names. Other characters can be used, but may cause trouble.) When you run VED you can use it either to read or modify or create files of your own, or to look at other files on the system. These include school information files, and also files to do with how to use VED and associated programs. The latter called TEACH files and HELP files. The TEACH files are there to get you started, and the HELP files will later provide useful reminders when you are an expert. -- -- How VED is controlled. When you run VED there are two main ways of controlling it. One is to use its "menu" system, which provides reminders of the facilities available, and the other is simply to give commands. VED (like Emacs) has a very large number of facilities and it takes some time, and practice, before you can learn all the commands. The menus help you to learn them by providing reminders of available facilities. If you start by using the menus, you can later learn to cope without them. Besides menus and commands, VED also has a large number of "shortcuts" that enable you to give commands by pressing "function" keys (special keys on the keyboard) and also by typing special key sequences, using the ESC key and the CTRL key. -- -- This document This document introduces you to a small subset of the facilities in VED which will suffice for many purposes. Gradually as you need to learn more you can do so, as VED has a lot of "online" documentation, though finding your way round it will take a bit of getting used to. (If at some point you want to learn how to do programming, VED can help you with that too -- it is used for all the introductory AI courses! This means that AI students should be able to help you with VED problems. We could set up an email list for VED users so that you can ask for help by email, when necessary. Would such a list be a good idea?) -- -- Try this Assuming you have got your xterm window going, start up VED by typing the following to Unix (end each command with the RETURN key): ved testfile This will start VED up with an empty file called "testfile". When it starts up VED will take up only half of your xterm window. It is set up so that it allows you to see two files at a time, each using half the window, though you will find later that you can change this. At the top of each file VED displays a "status" line which has a "line number" on it (showing how far you are into the file) and various other information. This line is also sometimes called the "command" line because you can use it to give commands to VED, as follows. -- -- Ask VED for a "teach file" When VED has started, try giving your first command, as follows. 1. Press the "ENTER" key on the right. This will make the "VED" cursor jump to the "status line" (= command line) at the top of the current VED window. 2. Type just the word "teach" (without quotes) then press the RETURN key. 3. That will start VED up with a tutorial file that will give you instructions on moving the VED cursor around, reading different bits of the file, and looking at other files. In order to be able to follow the instructions, you will need a keymap, so that you know which key to press when the teach file says "press SCREENDOWN". Here is a partial keymap for a Mac running MacX. There are two lots of function keys on a Mac keyboard, the arrow keys at the bottom of the keyboard to the right of centre, and the rectangular keypad at the right of the keyboard. Initially the Up and Down arrows will suffice for reading teach files, but gradually you will need to learn other things: how to move the cursor around using the 2, 4, 6 8, keys on the keypad, how to delete things, how to insert new lines, how to "mark" things, how to copy things, and later how to read and send mail. Meanwhile try reading the TEACH file using the keys indicated below. -- -- -- Arrow keys (at bottom of keyboard) Up arrow: SCREENUP Left arrow: SCREENLEFT Right arrow: SCREENRIGHT Down arrow: SCREENDOWN -- -- -- Numeric Keypad on the right |--------------------|--------------------|------------------|------------| |Clear (press twice) |= |/ |* | | REFRESH | MARK FIRST | MARK LAST | MOVE RANGE| |--------------------|--------------------|------------------|------------| |7 CLEAR HEAD |8 CHAR UP |9 CLEAR TAIL |+ STATUS | | | | | SWITCH | |--------------------|--------------------|------------------|------------| |4 CHAR LEFT |5 PUSH POSITION |6 CHAR RIGHT |- REDO | |--------------------|--------------------|------------------|------------| |1 CHAR DOWNLEFT |2 CHAR DOWN |3 DEL LINE | | |--------------------|--------------------|------------------| ENTER | |0 WORD LEFT |. WORD RIGHT |XXXXXXXXXXXXXXXXXX| | |--------------------|--------------------|------------------|------------| A more complete keymap is provided at the end of this file. -- When you have finished with TEACH TEACH, try TEACH VED ------------- You can quit the introductory TEACH file, by giving the "ENTER q" command. (I.e. press the ENTER key then type q, then press the RETURN key.) Then look at the TEACH VED file, as follows Press: ENTER type: teach ved Press: RETURN -- Learning to "mark a range" ----------------------------------------- When you are fluent at moving around a file, and can delete and insert things, try the TEACH MARK instructional file, by giving the command ENTER teach mark RETURN -- Practise on the TEACH RHYME file ----------------------------------- When you have finished with TEACH MARK, you can start getting more practice by looking at the TEACH RHYME file. ENTER teach rhyme RETURN -- Leaving VED -------------------------------------------------------- Before logging out from the Unix system you should always leave VED. You can do that by giving the "ENTER bye" command, as follows: Press: ENTER Type: bye Press: RETURN If you have no more files in the VED buffer, you will simply have a colon prompt at the bottom of the xterm window, thus : In that case, you can leave VED (and the Poplog system which contains VED) by simply typing "bye" and pressing RETURN. -- Logging out -------------------------------------------------------- You can log out by exiting from your xterm window. Simply type exit to Unix. The window should then go away and you can continue using the Mac as normal. Please note: you can't give the exit command to VED to log you out. You must first leave VED (using "bye") and then log out (using "exit"). Please try always to remember to log out when you have finished as processes left logged in can sometimes cause trouble for other users. -- Logging in again to read mail -------------------------------------- When you log in again later (e.g. after starting up MacX, as above, and then stargin an xterm window) you can run VED and then read your email by using VED's getmail command: ENTER getmail You can also send messages using VED's commands ENTER sendmr (send marked range) ENTER send (send whole file) ENTER reply (start preparing a reply) There are also various facilities for tidying up your email messages, printing messages, printing whole files printing parts of files, etc. -- Trying out the menu system ----------------------------------------- If you would like to use the "menu" system so that you don't have to remember so many different commands and function keys, you can start up VED as indicated previously, the then type ENTER menu A menu called "toplevel" should then appear. You can experiment by clicking on the "START" button which will take you through a tutorial file designed for VED's menu users. There is also a "Mail..." option on the main menu, which introduces you to a further menu for reading and sending mail. That menu lets you get to the Readmail... and Sendmail... menus. And those two menus each let you get from one to the other, as needed. There are many other menus, e.g. for marking and moving bits of a file, reading news bulleting boards, and other things. If you feel you need a special menu containing things you use often it is easy to provide one for you. Just ask Aaron. ======================================================================= CONTENTS -- Introduction -- How to get started -- Using Unix -- Directories and files -- -- Some other Unix commands -- Starting to use VED -- -- How VED is controlled. -- -- This document -- -- Try this -- -- Ask VED for a "teach file" -- -- -- Arrow keys (at bottom of keyboard) -- -- -- Numeric Keypad on the right -- When you have finished with TEACH TEACH, try TEACH VED -- Learning to "mark a range" -- Practise on the TEACH RHYME file -- Leaving VED -- Logging out -- Logging in again to read mail -- Trying out the menu system -- Complete MacX VED Key map -- -- Arrow keys (with and without ESC first) -- -- Numeric Keypad (not preceded by ESC) -- -- Numeric Keypad preceded by ESC -- -- Numeric Keypad preceded by CLEAR -- Complete MacX VED Key map ------------------------------------------ You can read the following online, by using the VED command ENTER help vedmacxkeys -- -- Arrow keys (with and without ESC first) Up arrow: SCREEN UP Left arrow: SCREEN LEFT Right arrow: SCREEN RIGHT Down arrow: SCREEN DOWN ESC Up arrow: TOP FILE ESC Left arrow: TEXT LEFT ESC Right arrow: TEXT RIGHT ESC Down arrow: END FILE -- -- Numeric Keypad (not preceded by ESC) |--------------------|--------------------|------------------|------------| |Clear (press twice) |= |/ |* | | REFRESH | MARK FIRST | MARK LAST | MOVE RANGE| |--------------------|--------------------|------------------|------------| |7 CLEAR HEAD |8 CHAR UP |9 CLEAR TAIL |+ STATUS | | | | | SWITCH | |--------------------|--------------------|------------------|------------| |4 CHAR LEFT |5 PUSH POSITION |6 CHAR RIGHT |- REDO | |--------------------|--------------------|------------------|------------| |1 CHAR DOWNLEFT |2 CHAR DOWN |3 DEL LINE | | |--------------------|--------------------|------------------| ENTER | |0 WORD LEFT |. WORD RIGHT |XXXXXXXXXXXXXXXXXX| | |--------------------|--------------------|------------------|------------| -- -- Numeric Keypad preceded by ESC |--------------------|--------------------|------------------|------------| |Clear |= |/ |* | | | LINE ABOVE | LINE BELOW | COPY RANGE | |--------------------|--------------------|------------------|------------| |7 YANK PART LINE |8 CUT |9 SPLICE |+ | | | | | | |--------------------|--------------------|------------------|------------| |4 JUSTIFY PARA |5 POP POSITION |6 EXCH POSITION |- | |--------------------|--------------------|------------------|------------| |1 ALIGN & JUSTIFY |2 LOADLINE |3 YANK LINE | | |--------------------|--------------------|------------------| ENTER | |0 DEL WORD LEFT |. DEL WORD RIGHT |XXXXXXXXXXXXXXXXXX| | |--------------------|--------------------|------------------|------------| -- -- Numeric Keypad preceded by CLEAR |--------------------|--------------------|------------------|------------| |Clear |= |/ |* | | REFRESH | LINE ABOVE | LINE BELOW | SET STATIC | |--------------------|--------------------|------------------|------------| |7 |8 |9 |+ | | DEL CHAR LEFT | DEL CHAR HERE | DEL CHAR RIGHT | | |--------------------|--------------------|------------------|------------| |4 CLEAR HEAD |5 LINEDELETE |6 CLEAR TAIL |- | |--------------------|--------------------|------------------|------------| |1 PUSH POSITION |2 POP POSITION |3 EXCH POSITION | | |--------------------|--------------------|------------------| ENTER | |0 DEL WORD LEFT |. DEL WORD RIGHT |XXXXXXXXXXXXXXXXXX| | |--------------------|--------------------|------------------|------------| See also: TEACH * VED TEACH * MOREVED TEACH * MARK HELP * VEDNEWKEYS HELP * VED REF * VEDCOMMS --- $pooplocal/local/teach/usingmacx --- The University of Birmingham 1994. --------------------------------