Editing with Emacs

  1. Starting Emacs (the colors here are for highlighting only, they don't take you anywhere!!) Below are some basics; when you're ready to try your hand at a bit more, try this Emacs Tutorial.

    Open a terminal window (shell) and type

    emacs

    after the prompt %

  2. New File
    % CTL-x CTL-f foo <rtn > <rtn > opens a new file by the name of "foo" and readies it for editing. Emacs will automatically read the .emacs file in your home directory; here is a copy of a generic .emacs file, sample .emacs .

    My .emacs file reads a latex colorizer called hilit19.el If you'd like to use it click here to download and place it in your path. Mine is in my /bin direcotry.

  3. Old File

    1. % CTL-x CTL-f <rtn > lists the files in your home directory.

    2. "click" on the file you want to open. (".." means "move one directory up the stack")

    3. CTL-f opens the file you've designated.

  4. Basic Editing Commands

    1. Use the ``arrow'' keys to move around

    2. simply type and delete as a simple editor

    3. use ``page up'' ``page down'' ``home'' ``end'' keys and the buttons on the top of the Emacs window.

    4. % CTL-x CTL-s saves your work (do this frequently as you type)

    5. % CTL-x g "kills" all current processes and can "save your life!" default.

    6. % CTL-x CTL-c quits emacs

    7. % CTL-x s searches for the string you type

    8. % CTL-x k "kills" the current file, ie. puts it back in your directory and reverts the sceen to the current default.

    9. CTL-k "cuts" a line of text and puts it on the clipboard

    10. CTL-y "yanks" or pastes it from the clipboard.

    11. CTL-spacebar"marks" a place in the text

    12. CTL-w "cuts" the region between the cursor and the last "mark" and puts it on the clipboard

    13. Esc-x replace-stringYou will be prompted first for the string to be replaced and after a <ret> for the substitute string. This command replaces ALL occurences.

    14. Esc-x query-replace This is the same as the replace command except you are prompted (far a "y" or "n") prior to each replacement.

  5. There's a whole book on this stuff! To see it and for more emacs info, click Emacs Info



Paul Humke
Tue May 28 12:56:50 CDT 1996