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.

Slides:



Advertisements
Similar presentations
A Guide to Unix Using Linux Fourth Edition
Advertisements

FIRST COURSE Word Tutorial 2 Editing and Formatting a Document.
Program Development Tools IDE vs point tools Two tool flavors exist for developing embedded software: -IDEs: (Integrated Development Environments) i.e.,
CIS 240 Introduction to UNIX Instructor: Sue Sampson.
VIM: The basics Tang Wai-Chung, Matthew (MaFai) 29/12/2006.
CS 497C – Introduction to UNIX Lecture 17: - The GNU emacs Editor Chin-Chih Chang
CS 497C – Introduction to UNIX Lecture 18: - The GNU emacs 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
COMPREHENSIVE ICT Document Preparation System Mr.S.Sajiharan Computer Unit Faculty of Arts and Culture South Eastern University of Srilanka.
The Unix Environment and Compiling. Getting Set Up Your programs will be compiled and tested on the Departmental server ‘linprog’ The linprog servers.
Ch 71 Using ATTRIB, SUBST, XCOPY, DOSKEY, and the Text Editor.
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.
FIRST COURSE Word Tutorial 2 Editing and Formatting a Document.
1 Unix Text Editors Creating files on the Unix system.
Chapter 3 Mastering Editors
© 2008 The McGraw-Hill Companies, Inc. All rights reserved. WORD 2007 M I C R O S O F T ® THE PROFESSIONAL APPROACH S E R I E S Lesson 7 Move and Copy.
EMACS To quote the Emacs Manual: Emacs is the extensible, customizable, self- documenting real-time display editor. Emacs is an editor for plain-text,
Lesson 7: Creating and Editing Business Letters. 2 Learning Objectives After studying this lesson, you will be able to:  Type a professional business.
Chapter Three The UNIX Editors. 2 Lesson A The vi Editor.
1 The EDIT Program The Edit program is a full screen text editor that allows you to: Create text files Create text files Edit an existing text files Edit.
Introduction to Vim Robbie CSCI2100 Data Structures Tutorial 3.
Microsoft Office Illustrated Introductory, Second Edition Documents Editing.
Intro. To Unix commands For those who’ve never used Unix before Quick tutorial to let you move around your Unix Accounts No discussion of inner workings.
1 © 2014 John Urrutia. All rights reserved. Chapter 7 The “ Emacs “ Editor.
4 Editing files and Emacs Editing files The Emacs editor.
Lesson 2: Manipulating Text Courseware #: 3240
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.
Unix Session IV.
Text Editing February 2 nd, 2004 Class Meeting 3.
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.
MS-WORD MS-Word is a word processing software. it helps you to create letters, memo, reports etc. HOW TO OPEN WORD click start menu button write Ms-word.
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.
Learning About Technology Chapter 2. GUIs Common features Common features Command buttons Command buttons Radio buttons Radio buttons Check boxes Check.
Microsoft Word Level 1 Michael Carco. Word Level 1 Agenda  Word Basics  Navigating in a Document  Inserting and Modifying Text  Creating and Modifying.
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
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.
PTA Linux Series Copyright Professional Training Academy, CSIS, University of Limerick, 2006 © Workshop III - Part A Shell Commands Professional Training.
What do you know? Do You know how to…………… 1.Open the document saved? 2.Use save as to network? 3.Use proper spacing after punctuations? 4.Change font?
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.
Intro. To Unix commands For those who’ve never used Unix before Quick tutorial to let you move around your Unix Accounts No discussion of inner workings.
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 ​ ​
A lesson approach © 2011 The McGraw-Hill Companies, Inc. All rights reserved. a lesson approach Microsoft® Word 2010 © 2011 The McGraw-Hill Companies,
Guide to Parallel Operating Systems with Microsoft Windows XP and Linux Chapter 6 Text Editors.
ITX2000 Remote hosts and web servers Prof. Xiaohong (Sharon) Gao Room: T125 Ext: Week 14 – UNIX vi text editor.
Chapter 3: Mastering Editors Chapter 3 Mastering Editors (Emacs)
ADVANCED FEATURES OF MS EXCEL
Vim basics Vi IMproved.
Guide To UNIX Using Linux Third Edition
Vi Editor.
Vim.
Vi Introduction Tony Kombol.
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)
Emacs CSC 135.
C151 Multi-User Operating Systems
Productivity Tools These are softwares that can be used to generate content for your website. One of them is your MS Word 2010.
Shortcuts to Everyday Applications
Chapter 2 Basic vi Editor.
Linux Operations and Administration
The Emacs Editor Read: Forouzan, Appendix C
CSCI The UNIX System Editing files
Day 5 Emacs Editor David A. Gaitros Department of Computer Science
Presentation transcript:

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 in this class you will use a text editor to write the file. In this file you will write a series of commands which upon execution will be performed. In our case: we will use the text editor to write IDL programs. Naturally the file you create will have a series of IDL commands (these ARE different from UNIX commands)

Emacs vs VIM There are primarily two text editors programmers use: Emacs and VIM Both have incredible functionality with VIM focusing more on fewer keystrokes and Emacs focusing on customization. We will teach you Emacs, although it makes no difference in the future if you become proficient in one or the other. Beware! You are choosing a side in the holiest of holy geek wars.

Open Emacs To open emacs in a terminal simply type emacs. To directly open a file with emacs from the terminal type emacs file_name If you do this on the ugastro server a new window will open up with the GUI emacs. If you have a Mac you can open Emacs in terminal the same way, but you will not get the same GUI (it will be built in the terminal).

Emacs basics Most emacs commands use a Ctrl-x plus some characters to perform a command: Examples: To open a file: Ctrl-x Ctrl-f (then type the file path) To save a file: Ctrl-x Ctrl-s To close a file: Ctrl-x Ctrl-c

Editing To edit a file simply type in the main window. Search forward: Ctrl-s (type the search string) type Ctrl-s repeatedly to step through searches Search reverse: Ctrl-r Beginning of line: Ctrl-a End of line: Ctrl-e Beginning of file: Esc-< End of file: Esc->

Ooops! I made a poopsy! To undo an action: Ctrl-_ (or Ctrl-x u) To cancel a command you are typing: Ctrl-g Example: (I want to save a file but I accidentally typed: Ctrl-x Ctrl-c which will close it if I hit enter!) Ctrl-g Type multiply times if not stopping. this will work anywhere within emacs

Intermediate Goal: Once you are comfortable you should very seldom use your mouse/track pad or have to type the arrow key repeatedly. Go to a line: M-x goto-line Query replace: Esc-% (type search string…enter…type replace string….enter, skip a change with ‘n’ and execute one with spacebar)

Markers You can set a marker where you would like some text operations executed. Do this by typing: Ctrl-space (you will see ‘mark set’ on the bottom) Now wherever you move you’re the cursor next, will define the mark up region (the region you want to edit).

Using markers (don’t inhale) Remove or ‘kill’ a line: Ctrl-k Remove a region of text: Set marker Move cursor to bottom of remove region Ctrl-w IMPORTANT: After you remove a line or region that text is temporarily stored and can be pasted by typing Ctrl-y (for yank)

Buffers You can have multiple buffers within one window of emacs. That is OS will only show that one terminal window of emacs is open, but in that window can be MANY files. Say you open a file (file1) and then want to open up another file (file2) whilst leaving file1 open. Simply type Ctrl-x Ctrl-f and the path for file2 and you’ve now opened up file2 in a new buffer. To switch back to file1, type Ctrl-x b file1. If you forget which files are open in buffers: Ctrl-x Ctrl-b displays available buffers

Viewing multiple buffers simultaneously This is perhaps one of the most useful tricks you will use in emacs. You will often want to compare two or more of your programs. Instead of opening up multiple emacs windows you split one emacs window into many. In each of these windows you can display a buffer. To split the window horizontally: Ctrl-x 2 To split the window vertically: Ctrl-x 3 To close the window (YOU ARE IN): Ctrl-x 0 To close all the windows EXCEPT the one you are in: Ctrl-x 1 To switch between windows: Ctrl-x o

Advanced: Macros Eventually you become so 1337, so Super Saiyan that even the shortcuts aren’t fast enough for you. Luckily you may define your own shortcuts with macros. Begin defining a macro: Ctrl-x ( Define one iteration of the operation End macro definition: Ctrl-x ) Execute the macro: Ctrl-x e

Iterative operations To execute a command iteratively: Ctrl-u # command (where # is the number of executions) Example: To indent a region 4 spaces: Define region. Ctrl-u 4 Ctrl-x

Last remarks You will only master these by practice. If you take the time to learn the commands the programming bottleneck is simply the execution of your code (and not your typing speed). Of course, it is easy to get distracted with emacs shortcuts. Remember they are there to simplify a task—that is, if it is too much work to use a shortcut DON’T USE IT!