CS 497C – Introduction to UNIX Lecture 17: - The GNU emacs Editor Chin-Chih Chang

Slides:



Advertisements
Similar presentations
In the last Session… ls -l command seven fields nine permissions of a file ls -ld file ownership file permissions (three-tiered file protection system)
Advertisements

CS 497C – Introduction to UNIX Lecture 8: The vi/vim Editor Chin-Chih Chang
A Guide to Unix Using Linux Fourth Edition
CIS 240 Introduction to UNIX Instructor: Sue Sampson.
Vi Editor TA for ITIS3100: Xu Fei
Chapter 5 Editing Text Files
CS 497C – Introduction to UNIX Lecture 18: - The GNU emacs Editor Chin-Chih Chang
CS 497C – Introduction to UNIX Lecture 10: The vi/vim Editor Chin-Chih Chang
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.
CS 497C – Introduction to UNIX Lecture 19: - The GNU emacs Editor Chin-Chih Chang
Copyrights© 2008 BVU Amplify DITM Basics of OS,UNIX/LINUX and Shell programming Page:1 Lesson 3: Vi- editor By Simi By Simi.
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.
Using Linux Text Editors. Use Non-Graphical Linux Text Editors Graphical Text Editor.
1 Unix Editors (ee, ed, ex, vi, vim) and Compilers (g77, gcc) Speaker: Li-Wen Chen Date:
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.
Win’XP keyboard short cuts CTRL CTRL (Copy the selected item) CTRL+SHIFT CTRL+SHIFT (Create a shortcut to the selected item) CTRL+RIGHT ARROW CTRL+RIGHT.
Chapter Three The UNIX Editors. 2 Lesson A The vi Editor.
T HE VI EDITOR. vi has 2 modes: command mode (initial or "default" mode) insert mode [Esc] is used to switch to command mode. In general, vi commands:
Software I: Utilities and Internals Lecture 2 – The vi Text Editor * Modified from Dr. Robert Siegfried original presentation.
1 © 2014 John Urrutia. All rights reserved. Chapter 7 The “ Emacs “ Editor.
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.
Text editors Why should I use an editor ? It is very important to able to use at least one text mode editor a text mode editor is so useful on remote machines.
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.
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.
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.
Microsoft Word Level 1 Michael Carco. Word Level 1 Agenda  Word Basics  Navigating in a Document  Inserting and Modifying Text  Creating and Modifying.
THE vi EDITOR. Introduction There are three editors available in almost all versions of Unix: ed, ex and vi. The ed program is the original editor that.
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 Lecture 3 More on editors: emacs and vi COP 3344 Introduction to UNIX.
THE C PROGRAMMING ENVIRONMENT. Four parts of C environment  Main menu  Editor status line and edit window  Compiler message window  “Hot Keys” quick.
Emacs, Compilation, and Makefile C151 Multi-User Operating Systems.
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.
October 24,  Creating and Opening Files  Save and Exit  Navigation  Shortcuts  Copying, Cutting and Pasting  Searching and Replacing  More.
>>0 >>1 >> 2 >> 3 >> 4 >> Keyboard Shortcuts Windows XP ​ ​
© 2015 Ex Libris | Confidential & Proprietary Yoel Kortick Senior Librarian Cataloging introductory flow.
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.
CS:414 introduction to Unix and Linux
Presentation By:- Komal Sadhwani
Guide To UNIX Using Linux Third Edition
Vi Editor.
Unix Fundamentals - Part iii 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.
IT244 - Introduction to Linux / Unix Instructor: Bo Sheng
Text Editors Vim (Chapter 6) Emacs (Chapter 7)
You do want to create and edit programs?
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
Presentation transcript:

CS 497C – Introduction to UNIX Lecture 17: - The GNU emacs Editor Chin-Chih Chang

The GNU emacs Editor emacs was create by Richard Stallman (the founder of GNU, now the Free Software Foundation). The program was originally written as a set of macros for the TECO editor. emacs is not available in all UNIX systems but is standard on Linux. GNU emacs is more than an editor; it handles a number of non-editing functions.

The GNU emacs Editor vi often does things with fewer keystrokes, but emacs easily surpass vi when it comes to searching and replacing and using macros. After invoking emacs, you have a full screen. 22 of the 25 lines are available for editing.

The GNU emacs Editor The top one in reverse video shows a menu, the lower one in reverse video shows the mode line, and the bottom line is the minibuffer showing an emacs-generated message. In the mode line you can see the filename and the cursor position (L1). Like most word processors unlike vi, emacs is a mode-less editor.

emacs Preliminaries In the emacs documentation, key sequences described as: –C-e – This is [Ctrl-e]. –C-x C-b – This is [Ctrl-x][Ctrl-b]. –C-x b – This is [Ctrl-x]b. –M-e – This is [Meta-e]. On the PC, you can use the [Alt] key or [Esc]-release to substitute [Meta] key.

emacs Preliminaries When you press a valid key sequence, emacs executes a command associated with the key. For instance, when you press [Ctrl-n], emacs executes the next-line command. To canceling a sequence, use [Ctrl-g]. emacs reads the file. emacs at startup. emacs –q ignores the.emacs file at startup. Use [Ctrl-x][Ctrl-c] to quit emacs.

Inserting and Replacing Text The default input mode is the insert mode. To switch to the overwrite mode, press the [Insert] key or enter the overwrite-mode command which can be done by the key sequence [Alt-x]ov[tab]. To enter a control character, first enter [Ctrl-q] and then the control character. To save a file, use [Ctrl-x] [Ctrl-s]. To save a file as a different filename, use [Ctrl-x][Ctrl-w].

Saving Text To open a different file, use [Ctrl-x][Ctrl-f]. emacs has an autosave feature which automatically saves a copy of the buffer in #filename#. To recover from the crash, use the recover- file command: [Alt-x]recover-file

The Digital Argument To perform a command as many times, use the digital argument. The number is prefixed by the [Meta] ([Alt] on PC) key. For example, to delete 5 characters, use [Meta-5][Ctrl-d]. The other way is to use the universal argument – [Ctrl-u] such as [Ctrl-u]5[Ctrl-d].

Navigation emacs uses the control keys to move in the four directions. These keys are quite intuitive – b (back), f (forward), p (previous line) and n (next line). [Ctrl-b] – move left, [Ctrl-f] – move right, [Ctrl- p] – move up, [Ctrl-n] – move down. To scroll full page forward, use [Ctrl-v]. To scroll full page backward, use [Alt-v]. To redraw the screen and position cursor at center of screen, use [Ctrl-l].

Navigation To move to the beginning of a line, use [Ctrl-a]. To move the end of a line, use [Ctrl-e]. To move the beginning of the word, use [Alt-f]. To move the end of the word, use [Alt-b]. To move the specified line number, use [Alt-x] goto-line [Enter] and then type the line number.

Working with Regions To move to the beginning of the file, use [Alt- ]. To mark a region, first move the cursor to the beginning of the section and use [Ctrl- Spacebar] or and then move the cursor to the end of the section. You can use [Ctrl-x][Ctrl-x] to toggle between two ends.