1 © 2014 John Urrutia. All rights reserved. Chapter 7 The “ Emacs “ Editor.

Slides:



Advertisements
Similar presentations
CS 497C – Introduction to UNIX Lecture 8: The vi/vim Editor Chin-Chih Chang
Advertisements

 Use the Left and Right arrow keys or the Page Up and Page Down keys to move between the pages. You can also click on the pages to move forward.  To.
A Guide to Unix Using Linux Fourth Edition
Editing with vi Or more fun than you thought you’d have without a mouse Prof. Chris GauthierDickey.
CIS 240 Introduction to UNIX Instructor: Sue Sampson.
CS 497C – Introduction to UNIX Lecture 17: - The GNU emacs Editor Chin-Chih Chang
Vi Editor TA for ITIS3100: Xu Fei
Chapter 5 Editing Text Files
1 Using Editors Editors let you create and edit ASCII files UNIX normally includes two editors: vi and Emacs Vi and Emacs are screen editors: they display.
CS 497C – Introduction to UNIX Lecture 9: The vi/vim Editor Chin-Chih Chang
CS465 - UNIX The vi Editor. Creating Files Most human-readable files on Unix are created with a text editor Unix has many, many different editors ed a.
CSCI 330 T HE UNIX S YSTEM Editing files. E DITOR C ONCEPTS Editing a file is to modify the content of a file Text editor: Enter and modify text in a.
1 Unix Text Editors Creating files on the Unix system.
謝耀偉編著 國立高雄大學應用數學系 Living in Emacs DeveloperWorks, IBM.
Chapter 3 Mastering Editors
EDITORS Lab 1 EECS 448 Dr. Fengjun Li and Meenakshi Mishra.
EMACS To quote the Emacs Manual: Emacs is the extensible, customizable, self- documenting real-time display editor. Emacs is an editor for plain-text,
Return to the Word 2007 web page Lesson 2: Creating and Editing Business Letters.
Chapter Three The UNIX Editors. 2 Lesson A The vi Editor.
Introduction to Vim Robbie CSCI2100 Data Structures Tutorial 3.
© 2010 South-Western / Cengage Learning Century 21 Keyboarding  Cycle 1  Office Features 1.
Microsoft Office Illustrated Introductory, Second Edition Documents Editing.
Introduction to Unix – CS 21 Lecture 8. Lecture Overview More detail on emacs and vi Regular expression matching in emacs and vi.
UNIX Intro vi  vi is the standard UNIX text editor v Contents 1.Why use vi ? 2. vi Basics 3.Moving Around 4.Inserting Text.
4 Editing files and Emacs Editing files The Emacs editor.
Chapter 5 Editing Text Files. Basic Concept A text editor works on a file buffer that is a memory copy of a disk file The disk file is not updated until.
Unix Editors. u Editors in Unix come in two general flavours: –modal editors have "modes" v generally input mode and command mode –input mode allows entry.
Tony Kombol.  Why text edit?  Many programs and features require configuration ▪ Configuration is kept in files ▪ Usually in the /etc directory  Changes.
Unix Session IV.
Text Editing February 2 nd, 2004 Class Meeting 3.
1 of 47 Chapter 4: The vi Editor – First Look Copyright ©2008 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.
Chapter Three Text Editing1 System Programming Text Editing.
VI EDITOR University of Mississippi. Vi Editor What is Vi ? ▫Vi is a screen based editor. ▫The screen of your terminal will act as a window into the file.
Chapter 9 Using Text Editors. vi Editor visual Editor, ASCII text editor, no formatting capabilities almost as powerful as MS Word, has 26 clipboards.
1 © 2012 John Urrutia. All rights reserved. Chapter 6 The vi Editor.
Introduction to Unix (CA263) File Editing By Tariq Ibn Aziz.
Lesson 4-Mastering the Visual Editor. Overview Introducing the visual editor. Working in an existing file with vi. Understanding the visual editor. Navigating.
Chapter Three The UNIX Editors.
Lesson 1 - Understanding the Word Window and Creating a New Document
Text editing and more basic commands CS 2204 Class meeting 3 *Notes by Doug Bowman and other members of the CS faculty at Virginia Tech. Copyright
Agenda Using vi Editor Starting vi Session Command / Input Modes Entering Text Editing Text Saving Edited File Aborting Editing Session.
Agenda Using vi Editor Starting vi Session Command / Input Modes
1. Chapter 1 Creating, Printing, and Editing Documents.
Vi editor Pronounced: `vee eye‘’. Agenda Describe the background of vi Editor Use vi editor to: create text files edit text files Our Goal is to create.
1 Lecture 3 More on editors: emacs and vi COP 3344 Introduction to UNIX.
Amir Afzal UNIX Unbounded, 5th Edition Copyright ©2008 Chapter 6: The vi Editor – Last Look 1 of 55 Copyright ©2008 by Pearson Education, Inc. Upper Saddle.
Introduction to Emacs (a Unix, Linux, and Windows text editor)
October 24,  Creating and Opening Files  Save and Exit  Navigation  Shortcuts  Copying, Cutting and Pasting  Searching and Replacing  More.
ITX2000 Remote hosts and web servers Prof. Xiaohong (Sharon) Gao Room: T125 Ext: Week 14 – UNIX vi text editor.
1 Word Lesson 2 Basic Editing Microsoft Office 2010 Introductory Pasewark & Pasewark.
By Justin Higgins. What is a text editor? If you’ve ever used Microsoft word you know what a text editor is (albeit a bloated one). When you write a program.
Purdue Linux Users Group Presents Linux 201: Session 1 Everything you ever wanted to do in VIM Thor Smith.
CS:414 introduction to Unix and Linux
Chapter 3: Mastering Editors Chapter 3 Mastering Editors (Emacs)
Presentation By:- Komal Sadhwani
Vim basics Vi IMproved.
Guide To UNIX Using Linux Third Edition
Vi Editor.
Vi Introduction Tony Kombol.
Linux 104 Training Module File Editing.
Lecture 3 More on editors: emacs and vi COP 3344 Introduction to UNIX.
Text Editors Vim (Chapter 6) Emacs (Chapter 7)
CREATING, PRINTING, AND EDITING DOCUMENTS
Emacs CSC 135.
Chapter 2 Basic vi Editor.
The Emacs Editor Read: Forouzan, Appendix C
CSCI The UNIX System Editing files
In the last class… The vi basics command, input and ex mode
Day 5 Emacs Editor David A. Gaitros Department of Computer Science
The Linux Command Line Chapter 12
Presentation transcript:

1 © 2014 John Urrutia. All rights reserved. Chapter 7 The “ Emacs “ Editor

2 © 2014 John Urrutia. All rights reserved. Topics About emacs Getting Started: Creating and Editing Introduction to emacs Features Command Mode –  Moving the Cursor  Changing text

3 © 2014 John Urrutia. All rights reserved. About emacs Created in 1975 by Richard Stallman Guy Steele & John McCarthy of M.I.T.  Originally an extension to TECO (Circa 1960, Text Editor & Corrector)  emacs (editor macros)

4 © 2014 John Urrutia. All rights reserved. About emacs “Emacs is the extensible, customizable, self-documenting real- time display editor.” “emacs manual”

5 © 2014 John Urrutia. All rights reserved. About emacs emacs is not vim  modeless editor unlike vim  edit files in buffers like vim  switch between buffers without writing them out & reading them back in.  display multiple buffers simultaneously  Set your own command environment

6 © 2014 John Urrutia. All rights reserved. Getting Started To launch type emacs [filename] To exit type Ctrl+ xc Help feature  Ctrl+ h [ command key ] Displays help on the command key  Ctrl+h t Starts the interactive tutorial

7 © 2014 John Urrutia. All rights reserved. Getting Started Basic Tutorial Hi-speed Basic Tutorial from GNU

8 © 2014 John Urrutia. All rights reserved. Getting Started The emacs workarea

9 © 2014 John Urrutia. All rights reserved. Getting Started

10 © 2014 John Urrutia. All rights reserved. Getting Started emacs commands  Always start with either the Ctrl key identified as C- or the Alt key sometimes called the “Meta key” identified as M-  After the C- / M- one or more keys are used to identify the command you want. We will use C- M- in this presentation

11 © 2014 John Urrutia. All rights reserved. Navigation On most systems the arrow and Page- up Page-Down keys work as expected The Ctrl equivalents  M-v – Page-up  C-v – Page-down  C-p – Previous line  C-n – Next line

12 © 2014 John Urrutia. All rights reserved. Navigation The Ctrl equivalents  C-b – Backward 1 character  C-f – Forward 1 character  C-l – Center screen at cursor All screen navigation overlaps 2 lines All line navigation overlaps by ½ screen

13 © 2014 John Urrutia. All rights reserved. Navigation Larger Cursor movements  M-b – Backward 1 word  M-f – Forward 1 word  C-a – Beginning of Line  C-e – End of Line  M-a – Beginning of Sentence  M-e – End of Sentence

14 © 2014 John Urrutia. All rights reserved. Navigation Larger Cursor movements  M-{ – Beginning of Paragraph  M-} – End of Paragraph  M-< – Beginning of File  M-> – End of File Repeating commands  C-u nnn – Repeat nnn times C-u 10 C-n – Next line 10 times

15 © 2014 John Urrutia. All rights reserved. Navigation Stop, I wanna get off! C-g Undo, what I did C-_ Undo, the Undo C-f C-_

16 © 2014 John Urrutia. All rights reserved. Entering text Start typing, by default  Characters are inserted at the cursor pushing following characters to the right  Automatic word wrap is on  Pressing the insert key toggles between insert and overwrite modes  Delete – removes character at cursor  Backspace – removes character before

17 © 2014 John Urrutia. All rights reserved. Copy, Paste & Deleting text Point – current edit position in the buffer (wherever the cursor is) Mark – last remembered buffer position  sets the mark equal to the point  C-x x toggles between the mark & point  Region – the contiguous characters between Point and Mark

18 © 2014 John Urrutia. All rights reserved. Cut, Copy, Paste text Kill (cut / copy) - places the text in the Kill Ring for later retrieval  C-w – Cuts the region to the Kill Ring  M-w – Copies the region to the Kill Ring  C-y – Yanks the last Kill into the buffer at Point  M-y – Erases previous yank inserts next Kill entry into the buffer at Point

19 © 2014 John Urrutia. All rights reserved. Cut, Copy, Paste text  M-z chr – Kills from point up to the next chr Kill vs Deleting  Only killed text can be yanked  Both killed and deleted text respond the same when you use the undo command.

20 © 2014 John Urrutia. All rights reserved. Files – Visiting & Saving When you “Visit” a file or files emacs:  Reads each file into a buffer  Allows you to edit the buffer(s)  And usually replaces the original file(s) C-x C-f – prompts for the filename

21 © 2014 John Urrutia. All rights reserved. Files – Visiting & Saving Saving files  When you save a buffer, you save the file C-x C-s – save the current buffer & file C-x s – prompts to save modified buffers C-x k – prompts & deletes, buffer not saved C-x C-W – prompts for filename and saves as new file

22 © 2014 John Urrutia. All rights reserved. Buffer list All buffers yours and emacs  Your session starts with two buffers  *scratch* – temporary scratch pad  *messages * – eamcs messages for you C-x C-b – display the emacs *Buffer List* C-x b – prompts for buffer name,selects it or creates it in a window C-x o – cycles through all windowed buffers

23 © 2014 John Urrutia. All rights reserved. Buffer list Managing buffer windows  All windowed buffers can be displayed  Manage the windows  C-x 0 – delete current window  C-x 1 – delete all windows except current  C-x 2 – split current window vertically  C-x 3 – split current window horizontally  C-x 4b – window named buffer  C-x 4f – window named filename  C-x o – cycle through all windows