BASIC COMMANDS
OPENING A FILE / CREATING A NEW ONE
To get started, you are going to want to create your
own file to work with. This is done by issuing the open file
command. Type C-x-C-v. In the message box the path
of the file will appear. What you will probably see looks
like this : '~/'. This indicates that emacs is looking in
the directory from which it was called for the file.
Hopefully, you started emacs up from your home directory,
or wherever you like to keep your files. So, it'll be just
fine to type in the name of the document you want to open.
If it doesn't exist in the current directory, a new file
of that name will be created. So, type in 'example.txt'
or anything that ends with the '.txt' extension, and hit
Enter. And presto! You have a new, blank emacs document
to work with. Take note of the changes that have occured
on the white info bar at the bottom of the screen. The filename
you chose is now there and the operation mode is now (Text
Fill). This is the standard plain text editing mode. You're
ready to type away.
SAVING A FILE
Now that you have played around and created this new,
or edited an existing, document you may find it useful to
save the changes you have made. This is easily done by typing
the command C-x-C-w to save those changes. This allows
you to save the document and continue working.
EXITING EMACS
When you have had enough of emacs, the command C-x-C-c
will lead you out. If you try to exit emacs without saving
your document it will ask you if you really want to discard
the changes you have made. You can answer with a 'y' for yes,
'n' for no, or '!' to force quitting with no questions asked.
This precaution can be a pain, but it only takes once to learn
how useful it is for the computer to ask before your changes
are deleted.
MOVING AROUND IN EMACS
For moving around from space to space or from line to
line, it is probably easiest to simply use the arrow keys.
However, if the arrow keys are not mapped on your terminal,
or if you like to do things the "special" way, here are the
movement commands.
C-f forward one character
C-b backward one character
C-n move to next line
C-p move to previous line
Now, there are some other movement commands that are useful
no matter what kind of emacs you are using. A few of the
most useful are listed here for your convenience.
C-a moves to the beginning
of a line
C-e moves to the end of a line
C-v moves forward one screen
M-v moves backward one screen
C--> moves right to the end of the next word
C-<- moves left to the beginning of previous word
There are a number of editing commands that are also helpful
in basic text-editing mode.
C-k deletes everything to
the right of the cursor on current line
C-d deletes characters from the left (unlike standard
DEL)
Table Of Contents
Last edited on
April 22, 1999
Text written by Bryan Dotzour
|