Next 19.B: Editing Up 19: emacs  Prev 19: emacs  Contents

Specialized

§ 19.A: Moving in emacs


In many cases you will be able to use your mouse in emacs. However, if you are unable to use your mouse (for instance, when using WebTerm), or if you prefer not to remove your hands from the keyboard (saves time), the following commands are helpful to know. These are a summary of the movement commands available in emacs.

(Remember C-"character" for Control and the character at the same time and M-"character" for Meta ([Esc]) and the character at the same time.)

        C-f 	Move forward a character
	C-b     Move backward a character
	
	M-f	Move forward a word
	M-b	Move backward a word

	C-n 	Move to the next line 
	C-p 	Move to previous line

	C-a     Move to beginning of line
	C-e 	Move to end of line

	M-a	Move back to beginning of sentence
	M-e	Move forward to end of sentence

        M-v     Page up
        C-v     Page down

	M-<	Go to beginning of file
	M->	Go to end of file

Move around a little in your sample file to get a feel for some of these commands.

Now let's say that you want to move down twenty lines, but do not feel like typing in C-n command twenty times. The C-u command allows you to repeat any command, any desired number of times. All you have to do to move twenty lines down is type in the command C-u 20 C-n, and you should see the cursor move down twenty lines. This is a very useful command to remember because it can be used with any command in emacs. (Not just movement commands.)

Now that we have movement out of the way, let's go to Editing with emacs.


Next 19.B: Editing Up 19: emacs  Prev 19: emacs  Contents

Comments and questions to Dr. Elias N. Houstis at enh@cs.purdue.edu.