1. Try out pico as a text editor, and try out pine by sending e-mails to each other.
2. Start XEmacs by typing 'xemacs &'.
Remark: the & symbol means that you want to run the program "in the background": you wish to get back the prompt immediately, before the launched program has quitted. If you don't add this symbol, you can't use that terminal (console) simultaneously with XEmacs. (Of course you can run another console...) Try out the difference.
Go through the XEmacs manual: when entering XEmacs, type ^H T (CTRL-H, then T). Do it very carefully, practicing a lot.
There is no assignment about this now, but there will be some questions
about using Emacs or XEmacs in the final test: questions like
what is the key combination for easy commands,
that you use very often. So you should acquire
a basic skill of using Emacs or XEmacs, by working in these editors
as much as you can, instead of pico.
Create a directory 'assignment_1' within your home directory. Create the following ones within it: a directory called 'continents', as well as files called 'asia', 'europe', 'america', 'africa' and 'australia'.
Then give the appropriate command lines using wildcards to execute exactly the following tasks (in this order), without changing your working directory:
Tip: as long as you are not sure that the expression containing a wildcard matches exactly the files you wanted, don't use the commands for copying, moving (and especially not removing!). Experiment first with the command for listing.
Send the solutions for these assignments to Tamás (firstname.lastname@example.org) by using either pine or Emacs / XEmacs or some other mailing program under Unix. I don't accept mails sent from your regular university account or from some yahoo, etc. account.
4. 10 minutes of vi
Start vi by typing: ' vi <filename> '. Then don't panic!
There are tree modes in vi:
- command mode: typing a character means a command, and does not appear on the screen.
- input mode: now you can type in whatever text you wish into your text, to the place where the cursor is.
- status-line mode (last-line mode): issuing long commands that will appear on the bottom line of your screen.
Changing between these modes:
- when you enter vi, you are in the command mode;
- pressing the 'Esc' button ('escape') brings you back always to the command mode;
- from command mode 'a' or 'i' brings you to input mode;
- from command mode ':' brings you to the last-line mode.
In the input mode you can just type in your text, but you will sometimes be surprised that you are not able to delete it. Maybe you are even not able to use the keys for moving your cursor! Then go back to the command mode (by using Esc) and bring the cursor onto the character you wish to delete. Just press 'x' to delete. Then 'a' or 'i' will bring you back to input mode.
Are you lost and even not able to move your oursor? Use the h (left), j (down), k (up) and l (right) keys in the command line.
In fact 'x' deletes the given character by putting it into a buffer ("cut") and 'p' will paste it to the actual position of the cursor. If you wish to put more than one character into the buffer (e.g. copying or moving an entire word), then just type the number of characters before 'x'. For instance '5x' will delete five characters, and put them into the buffer. Finally, 'dd' will delete you a line, and put it into the buffer. If you get lost, just don't panic...
By pressing ':', you get to the last-line mode. Pressing
'vi' will start a new file ("new document"), 'vi
<file_name>' opens the mentioned file. Typing 'w'
save (write) our file, while typing 'w <file_name>' saves as (under) the given name.
Leaving this sadistic editor is possible by typing 'q'
(quit), 'q!' (quit, even if not saved) or by 'wq' (save and quit).
Assignment: show the teacher that you manage to handle vi, at least for 45 seconds...!
Now you can go back to pico and XEmacs! Relax and enjoy having left vi...