Emacs - PowerPoint PPT Presentation

1 / 10
About This Presentation
Title:

Emacs

Description:

Buffer : internal data structure that holds text. ... C-x C-f : reads in a file into a buffer (tab complete) ... Every buffer has major mode and other minor modes ... – PowerPoint PPT presentation

Number of Views:159
Avg rating:3.0/5.0
Slides: 11
Provided by: csuaBe
Category:
Tags: buffer | emacs

less

Transcript and Presenter's Notes

Title: Emacs


1
Emacs
  • Michael Hoisie (mbh)
  • CSUA

2
Overview
  • Emacs is
  • designed for console use
  • extendable
  • written for programmers
  • Emacs is not
  • WYSIWYG (pretty)
  • Type 'emacs' or 'emacs filename' to launch
  • Most of screen is used for text, except for
    bottom line
  • Important note tab completion

3
Commands
  • Every key combination can be a command (some are
    simple like character entry)
  • Commands are often built with modifiers - Meta(M)
    and Control(C) - which are like shift keys
  • Keys may differ among architectures
  • Command sets usually have prefixes
  • C-x common prefix to manipulate files, buffers,
    windows
  • C-h used for help commands
  • M-x prompts for a name of a command
  • Don't bother memorizing commands

4
Data Structures
  • File file located on disk
  • Buffer
  • internal data structure that holds text.
  • May be associated with a file, may be the output
    of a program
  • emacs can store any arbitrary number of buffers
  • Window
  • a view of a buffer
  • emacs usually starts with one buffer
  • screen may be split among multiple buffers

5
Basic Commands
  • Files
  • C-x C-f reads in a file into a buffer (tab
    complete)
  • C-x C-s saves the file of the current buffer
  • Buffers
  • C-x b switches buffers
  • C-x k kill a buffer
  • Windows
  • C-x o switch window
  • C-x 0, C-x 1, C-x 2, C-x 3
  • C-g cancel

6
Killing and Yanking
  • Delete character C-d
  • Kill is Unix equivalent of cut
  • M-d kill word
  • C-k kill line
  • Yank is Unix equivalent of paste
  • C-y
  • To copypaste, you need to kill, yank, and yank

7
Marking and Regions
  • Emacs can manipulate arbitrary chunks of text (a
    region).
  • Region is between the cursor(point) and the mark.
  • You usually set the mark around some object, and
    then move the cursor to change the region
  • Setting the mark
  • C-ltspacegt sets mark at cu cursor
  • C-x h marks the whole buffer
  • C-x X-x switches mark and cursor
  • Region commands
  • C-w kill region

8
Search and Replace
  • Searching
  • C-s search forward (repeat to keep searching)
  • C-r search backwards
  • Regular expression search
  • C-M-s
  • C-M-r
  • To replace
  • M-x query-replace
  • M-x replace-string

9
Modes
  • Custom environment (commands, text formatting)
  • Every buffer has major mode and other minor modes
  • Emacs usually chooses it for you, but you can
    always set it
  • Nice modes
  • Text mode editing text
  • Outline mode taking notes
  • Scheme mode using scheme
  • C mode writing C
  • Each programming language has a mode

10
Help
  • C-h a apropos, prompts for a keyword
  • C-h m describes current mode, key bindings
  • C-h t runs the emacs tutorial
  • http//del.icio.us/tag/emacs
  • use reference card
  • search for info
Write a Comment
User Comments (0)
About PowerShow.com