1 Day 4 Introduction to VI. 2 Vi – Visual Editor Used to edit text files on a UNIX system –Now also available for Windows/Mac etc. Very powerful for editing.

Slides:



Advertisements
Similar presentations
Word Moving the Insertion Point. Using the Arrows  Moves one character to the right  Moves one character to the left  Moves one line up  Moves one.
Advertisements

Introduction to the gedit editor. gedit: the Gnome editor Gnome: Gnome is a freely available (i.e., no cost) desktop environment for the UNIX system The.
Editing with vi Or more fun than you thought you’d have without a mouse Prof. Chris GauthierDickey.
Cosc 4750 Getting Started in UNIX Don’t be afraid of the prompt, in linux it can be your best friend. In some cases, the only way to do certain things.
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.
Computer Science 117 Intro to C++ 08/26/13. Today Discuss Syllabus Brief History of C++ How to Execute a C++ program. Reading assignment.
Vi Editor TA for ITIS3100: Xu Fei
UnixUnix Basic. Convention Italic text indicates text displayed by the computer system. For example, login: indicates a login prompt displayed by the.
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.
Conversational Computers
The World of MS Word. Producing a Word Document 1.Display the word processor document by either creating a new one or opening an existing document. 2.Type.
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 Day 3 Directories Files Moving & Copying. 2 Case Sensitive First thing to learn about UNIX is that everything is case sensitive. Thus the files: –enda.
Linux environment ● Graphical interface – X-window + window manager ● Text interface – terminal + shell.
CS161 Topic #21 CS161 Introduction to Computer Science Topic #2.
Chapter Three The UNIX Editors. 2 Lesson A The vi Editor.
The UNIX development environment CS 400/600 – Data Structures.
Course materials may not be reproduced in whole or in part without the prior written permission of IBM. 5.1 © Copyright IBM Corporation 2008 Unit 7 Editing.
Introduction to Vim Robbie CSCI2100 Data Structures Tutorial 3.
Word 1-1: Start Word, Enter and Edit Text, and Save Review Make a review sheet by numbering as shown below. The test is timed. You can practice again if.
Editing, vi and Configuration Files Introduction to Linux June 16, 2009 Papeete, French Polynesia Hervey Allen.
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.
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.
Introduction to Unix – CS 21 Lecture 7. Lecture Overview Regular expressions revisited emacs versus vi Basic emacs and vi usage.
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.
Getting Started with Linux Linux System Administration Editors.
1May 16, 2005 Week 2 Lab Agenda Command Line FTP Commands Review More UNIX commands to learn File name expansion - * Introduction of vi.
Introduction to Unix (CA263) File Editing By Tariq Ibn Aziz.
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.
Editing, vi and Configuration Files Unix/IP Preparation Course May 29, 2011 Dar es Salaam, Tanzania
Editing, vi and Configuration Files Introduction to Unix May 25, 2008 Rabat, Morocco Hervey Allen.
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.
More on Using onyx 8/28/13. Program 1 Due a week from today. See website for details.
Computer Vocabulary Computer
Editing, vi and Configuration Files Unix/Linux Preparation Course June 27, 2010 Pago Pago, American Samoa
1 After completing this lesson, you will be able to: Open a file. Navigate through a document. Scroll through a document. Insert text in a document. Select.
Getting Started with Linux Linux System Administration Editors.
“Save As” 1.To the I drive 2.With your LastName FirstrName at the beginning of the file name. (ex. - Hurlow Dan Links.ppt) Go to the next slide.
ITX2000 Remote hosts and web servers Prof. Xiaohong (Sharon) Gao Room: T125 Ext: Week 14 – UNIX vi text editor.
CS:414 introduction to Unix and Linux
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
Editing, vi and Configuration Files
Linux System Administration Editors
The Linux Command Line Chapter 12
vim Basics Understanding And Using the vim Text Editor
Chapter 2 Basic vi Editor.
Moving the Insertion Point
The Emacs Editor Read: Forouzan, Appendix C
The Linux Command Line Chapter 12
Presentation transcript:

1 Day 4 Introduction to VI

2 Vi – Visual Editor Used to edit text files on a UNIX system –Now also available for Windows/Mac etc. Very powerful for editing text files –Allows you to do everything you can do with MS-Word and more, without ever taking your hands off the keyboard. –Takes a little while to get used to it. Does not use your mouse, so don’t expect that to do anything.

3 Editing an new file From the command line, type: –vi –e.g. vi test1 If there is no file in your current directory called test1, this will create the file. If the file already exists, vi will open the file and allow you to edit it.

4 3 Modes of Vi Command Mode –This is where you tell VI to do things. e.g. –Remove this line of text –Add the number 0 to the end of this line –Move up a line, Move down a line Insert Mode –This is where you actually type. : mode (ex mode) –This is where you get out of Vi, or save the file.

5 In the beginning When you first go into vi, you are in command mode. –Anything you type right now is assumed to be a command. Thus it will probably beep at you, yell at you, or do something odd. To get to the point where you can type, you must go into insert mode. –Do this by hitting the letter: i

6 Back to command mode If you need to get back to command mode, you will hit the [escape] button. Remember any commands you try to type while in Insert mode, will end up in your document.

7 Command Mode basics Arrow keys move you around (as do k j l j x – deletes a character d – deletes something bigger –e.g. dd – deletes a line dw – deletes a word i – Go back into insert mode a – append text to where we currently are.

8 Insert mode basics You should be able to type anything you want. Hit [Enter] to move onto the next line Remember that the arrow keys will NOT move you around while you are in insert mode. [They will put some funny character in your document] The [backspace] key should work just fine as usual

9 : mode (ex mode) Saving the file is done by getting into command mode –Hit [Escape] Type: –:w This will save the file and allow you to keep editing it. If you are done, and want it to exit, type: –:wq Which stands for Write and Quit To NOT save the file, and discard your changes: –Type :q!

10 Exercise Create a new file in your home directory called: –goldenglobes Type the following into the file: Then save it, and get out of vi The big budget film "Gladiator" won best picture drama at Sunday's Golden Globes. Julia Roberts won best actress in a drama for her role in "Erin Brockovich," and Tom Hanks took the statue for best actor in a drama for "Cast Away." George Clooney won best actor in a comedy film for "O Brother, Where Art Thou?" and Renee Zellweger of "Nurse Betty" won best comedy film actress.

11 Millions of other things you can do Copy your goldenglobes file to goldenglobes.bak Now vi goldenglobes again In Command mode type each of these and see if you can figure out what they do: –100ix[escape] –w –e –$ –^ –u –G–a–A–J–G–a–A–J