Agenda Using vi Editor Starting vi Session Command / Input Modes Entering Text Editing Text Saving vi Session Aborting Editing Session.

Slides:



Advertisements
Similar presentations
Course Outline: System Requirements What is Vi Editor Conventions
Advertisements

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)
CS 497C – Introduction to UNIX Lecture 8: The vi/vim Editor Chin-Chih Chang
Step-by-Step: Set an Access Password for a Document OPEN the peerreview document from the lesson folder. 1.Click the File tab and then click the Save As.
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.
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.
Starting Vi Opening an existing file vi filename Creating a new file vi filename In your workshop directory, create a new file called mysong vi mysong.
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.
Copyrights© 2008 BVU Amplify DITM Basics of OS,UNIX/LINUX and Shell programming Page:1 Lesson 3: Vi- editor By Simi By Simi.
COMPREHENSIVE Excel Tutorial 8 Developing an Excel Application.
Chapter 3 Mastering Editors
Chapter Three The UNIX Editors. 2 Lesson A The vi Editor.
Introduction to vi (a Unix, Linux, and Windows text editor)
Software I: Utilities and Internals Lecture 2 – The vi Text Editor * Modified from Dr. Robert Siegfried original presentation.
Chapter8 The vi Editor. Introduction to vi u Modes of Operation u The Work Buffer  During the editing session, vi make all changes in the buffer  Advantage.
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.
A Guide to MySQL 3. 2 Introduction  Structured Query Language (SQL): Popular and widely used language for retrieving and manipulating database data Developed.
Copyright 2007, Paradigm Publishing Inc. ACCESS 2007 Chapter 3 BACKNEXTEND 3-1 LINKS TO OBJECTIVES Modify a Table – Add, Delete, Move Fields Modify a Table.
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.
Basic vi Commands Michael Davis Phd Student, Atmospheric Science.
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.
CREATING A DOCUMENT Using MS Word Presented by Dr. Ennis-Cole.
1 © 2012 John Urrutia. All rights reserved. Chapter 6 The vi Editor.
Getting Started with Linux Linux System Administration Editors.
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.
Week 8: Linux / ubuntu Dr. I. H. Shah. / CSCS 301 Fall 2009.
Chapter Three The UNIX Editors.
Linux Class #03. File Access Permissions Types of users in Linux: Local User (u) Group User (g) Other User (o) Each User can have 3 types of permissions:
Isecur1ty training center Presented by : Eng. Mohammad Khreesha.
PacNOG 6: Nadi, Fiji Editing, vi & Configuration Files Hervey Allen Network Startup Resource Center.
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
Editing, vi and Configuration Files Unix/IP Preparation Course May 29, 2011 Dar es Salaam, Tanzania
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.
Editing, vi and Configuration Files Unix/IP Preparation Course July 19, 2009 Eugene, Oregon, USA
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.
Editing, vi and Configuration Files Unix/Linux Preparation Course June 27, 2010 Pago Pago, American Samoa
THE C PROGRAMMING ENVIRONMENT. Four parts of C environment  Main menu  Editor status line and edit window  Compiler message window  “Hot Keys” quick.
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.
Shell Script Reference: Linux Shell Scripting Tutorial v1.05r3 A Beginner's handbook
Getting Started with Linux Linux System Administration Editors.
BIF703 FTP (File Transfer Protocol) Utility vi editor Utility.
ITX2000 Remote hosts and web servers Prof. Xiaohong (Sharon) Gao Room: T125 Ext: Week 14 – UNIX vi text editor.
Microsoft Office XP Illustrated Introductory, Enhanced Documents Editing.
Basic VI Tran, Van Hoai Faculty of Computer Science and Engineering HCMC Uni. of Technology
Excel Tutorial 8 Developing an Excel Application
Guide To UNIX Using Linux Third Edition
Vi Editor.
Unix Fundamentals - Part iii vi Editor
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
Linux System Administration Editors
C151 Multi-User Operating Systems
Chapter 2 Basic vi Editor.
Linux Operations and Administration
The Emacs Editor Read: Forouzan, Appendix C
Presentation transcript:

Agenda Using vi Editor Starting vi Session Command / Input Modes Entering Text Editing Text Saving vi Session Aborting Editing Session

vi (Visual) Editor vi is a powerful, interactive, visually-oriented text editor Features: flexibility in performing various tasks ability to view many lines of text as opposed to one line at a time possible to recover file edited by vi in the event of a “system crash”

Starting vi Session There are two ways in order to start an editing session with vi: Enter vi filename (recommended since filename has already been assigned and changes will be saved to filename by enter ZZ while in vi). Enter vi (filename is not assigned, therefore user has to type :w filename and then enter ZZ to save file.

Modes There are two operational modes while using the vi editor: Command Mode (default mode when starting) Mode to allow user to give commands such as to delete text, search for strings, search & replace, save changes, abort editing session without saving changes and exit the vi editor. Input Mode Input Mode allows user to enter or edit text. If in command mode press i to enter input mode.

Input Mode While in input mode, the input mode indicator should appear as INPUT on the bottom of the vi screen. If this indicator does not appear when you press i then type: :set showmode After typing or “inserting” text, type to return to Command Mode.

Entering Text Type in your text, but it is recommended to press ENTER before the end of the line (i.e. do not use word-wrap). Also, do not use to end a line. Tilde “~” characters below text represent end of file. Error Correction (As you type): CTRL-hDelete a letter CTRL-wDelete a word CTRL-uDelete a line

Editing Text You can move around to text in the screen with the arrow keys while in Insert Mode. For more advanced editing, you can return to Command Mode and use appropriate editing commands

Editing Commands (Within Command Mode) Commands: dDeletes current character dwDeletes to the end of the word ddDeletes the current line uUndo. “Undoes” the last operation that user performed

Saving vi Session When you create a file using vi, all work performed during vi session is stored in a Word Buffer (temporary storage) until the user saves their work. When saving, changes in the work buffer are added to a new (empty) file if creating a new file, or changes in work buffer modify existing (previously created) file

Saving vi Session To save your vi session, you must make sure you are in command mode by pressing To save your changes and exit, enter ZZ (i.e. two capital z’s)

Aborting Editing Session If you make a huge mistake in your editing session (that undo cannot solve), you can abort your session without modifying the contents your file (dump the work buffer) To abort the current editing session, press :q!