CS 497C Introduction to UNIX Lecture 18: The GNU emacs Editor - PowerPoint PPT Presentation

1 / 9
About This Presentation
Title:

CS 497C Introduction to UNIX Lecture 18: The GNU emacs Editor

Description:

... you continue to press [Ctrl--], you'll undo the changes made before the last save. ... [Ctrl--], emacs starts redoing everything that you have undone. ... – PowerPoint PPT presentation

Number of Views:147
Avg rating:3.0/5.0
Slides: 10
Provided by: Kindy
Category:

less

Transcript and Presenter's Notes

Title: CS 497C Introduction to UNIX Lecture 18: The GNU emacs Editor


1
CS 497C Introduction to UNIXLecture 18 - The
GNU emacs Editor
  • Chin-Chih Changchang_at_cs.twsu.edu

2
Deleting, Moving and Copying Text
  • To delete a character, use Ctrl-d. To delete a
    word, use Alt-d.
  • To delete text from the current cursor position
    to the end of line, use Ctrl-k.
  • To delete the entire line, first use Ctrl-a and
    then Ctrl-kCtrl-k.
  • To delete text in a region, first mark the region
    and then use Ctrl-w.

3
Deleting, Moving and Copying Text
  • Ctrl-y is universally used to restore text from
    the deletion.
  • While Ctrl-w deletes text in a region, the
    command to copy text is Alt-w.
  • You can transpose two adjacent characters by
    using Ctrl-t.

4
Changing Case of Text
  • To convert an entire word to uppercase, move to
    the beginning of the word and then press Alt-u.
  • You use Alt-u for converting a word to
    lowercase.
  • To capitalize a single character, position the
    cursor under it and then use Alt-c.

5
Changing Case of Text and Command Completion
  • For transforming case in large blocks of text,
    use a region. The commands to convert text in a
    region are Ctrl-xCtrl-u and
    Ctrl-xCtrl-l.
  • The command completion feature can reduce some of
    the typing work.
  • The guiding principle here is this Enter as much
    of the command text as you want and then press
    the Tab key.

6
Undoing and Redoing Editing
  • To undo the change, there are three ways
    Ctrl-xu, Ctrl-_, Ctrl--.
  • If you continue to press Ctrl--, youll undo
    the changes made before the last save.
  • If you keep pressing Ctrl--, emacs starts
    redoing everything that you have undone.

7
String Search
  • The incremental and non-incremental search
    techniques are used in string search in emacs.
  • Incremental search is invoked with Ctrl-s
    followed by the search string.
  • After entering Ctrl-s emacs prompts for the
    search string in the minibuffer. Suppose youre
    looking for mail. After m is entered, the search
    starts immediately.

8
String Search
  • The cursor relocates itself at the first instance
    of m maybe on the word moon.
  • After mail is entered, press Enter.
  • There are a number of advantages of using
    incremental search
  • The search is faster.
  • emacs tells you instantly whether the string
    exists in the file.
  • If there is a typo, backspacing erases the error.

9
String Search
  • At the end of a file, use Ctrl-r instead of
    Ctrl-s.
  • To repeat a search, youll have to use the same
    command Ctrl-s or Ctrl-r.
  • In non-incremental search just press Enter and
    then type the string.
  • Like vi, emacs uses a pattern comprising some
    special characters to look for similar strings.
    This pattern is called a regular expression.
Write a Comment
User Comments (0)
About PowerShow.com