emacs

  • Prior to starting this demonstration, you should set up your unix directory according to the instructions in Unix utilities

  • emacs is a powerful text editor with extensive functionality.

1) Control mode is activated by pressing and holding the <ctrl> key while pressing the second key. This process is written as:

C-key

This example shows the result after C-s (search):

2) Meta-mode is activated by pressing and releasing the <ESC> key followed by some other key that activates a sub-menu of commands. This process is written as:

ESC option

This example is what appears after entering ESC x (activate execute-extended-command menu)


  • check to see that you are in the IAP_2010 directory unix by entering the command:

pwd
  • the result should be (where USERNAME is your own unix username)

/home/USERNAME/IAP_2010/unix

  • If it is not, you can change to that directory by executing:

cd /home/USERNAME/IAP_2010/unix
  • create a copy of the file replace.txt with:

cp replace.txt replace2.txt
  • Begin editing replace2.txt with:

emacs replace2.txt
  • Note, on new accounts a splash screen welcomes you to emacs use C-l to exit the screen and proceed to editing.

  • Insert text by regular typing.

  • Delete letters with C-d

  • Delete lines with C-k

  • Find and replace text with ESC x , then type replace-string on M-x line. enter search string, then return, then replacement text.

  • Move to the end of the document with ESC >

  • Move back to the start of the document with ESC <

  • Play tetris with ESC x, tetris

  • Save and exit with C-x followed by C-c then answer prompts if changes were made.

  • To turn off the splash welcome screen, edit a file called .emacs to have the contents:

(setq inhibit-splash-screen t)

Last updated

Was this helpful?