05.01.2013 Views

Mac OS X Leopard - ARCAism

Mac OS X Leopard - ARCAism

Mac OS X Leopard - ARCAism

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

318<br />

CHAPTER 18 INTRODUCING DARWIN AND THE SHELL<br />

Once the file is open, it’s immediately ready to edit. To move around in the file, you can use<br />

either the arrow keys or some C-n keystrokes (C-f, C-b, C-p, and C-n). The Delete key works as<br />

you would expect, and you can enter text at the cursor just by typing.<br />

To save the file, you can either use C-x C-s to save the file as its existing name, or C-x C-w<br />

filename to save the file as filename. C-x C-c will quit Emacs (it will prompt you to save any<br />

changed files first.) If you need to edit an additional file, you can use C-x C-f to open or create<br />

another file without quitting Emacs. Table 18-6 provides a handy list of a few common keystrokes<br />

and their effects.<br />

Table 18-6. Common Emacs Keystrokes and Their Effects<br />

Keystroke Effect<br />

Moving Around<br />

C-f or right arrow Move one character to the right<br />

C-b or left arrow Move one character to the left<br />

C-p or up arrow Move one line up<br />

C-n or down arrow Move one line down<br />

M-f Move one word to the right<br />

M-b Move one word to the left<br />

C-a Move to the beginning of the current line<br />

C-e Move to the end of the current line<br />

C-v Page down<br />

M-v Page up<br />

M-> Go to the end of the document<br />

M-< Go to the beginning of the document<br />

C-u n C-n Move ahead n lines<br />

M-g g n Go to line n<br />

Searching and Replacing Text<br />

C-s pattern Ret (Return) Search forward for pattern<br />

C-r pattern Ret Search backward for pattern<br />

C-s Ret Ret Search for next occurrence of previous pattern<br />

M-% orig Ret repl Ret Replace orig string with repl string (Emacs will prompt you for confirmation;<br />

press y to continue)<br />

Copying and Pasting Text<br />

C-Spc (spacebar) Set mark at cursor, which allows you to move cursor anywhere in the<br />

document, thus “selecting” text between mark and cursor (called a region<br />

in Emacs lingo)<br />

C-w Cut region<br />

M-w Copy region<br />

C-y Paste last cut or copied region

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!