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 2001-2003.

Slides:



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

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.
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.
Vi Editor TA for ITIS3100: Xu Fei
Chapter 5 Editing Text Files
CS 497C – Introduction to UNIX Lecture 10: The vi/vim Editor Chin-Chih Chang
CS 202 Computer Science II Lab Fall 2009 September 3.
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
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.
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:
Chapter 3 Mastering Editors
Cmsc 312 Operating Systems. UNIX? DOS – PC? VAX/VMS - mainframe Unix – PC, workstation, mainframe 1970 bell Lab For computer scientist? Why popular? Free.
EDITORS Lab 1 EECS 448 Dr. Fengjun Li and Meenakshi Mishra.
Chapter 3: The UNIX Editors ASCII and vi Editors.
Chapter Three The UNIX Editors. 2 Lesson A The vi Editor.
The UNIX development environment CS 400/600 – Data Structures.
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:
리눅스 : Lecture 5 UNIX 유틸리티 : text editor, compilation (make), …
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.
Software I: Utilities and Internals Lecture 2 – The vi Text Editor * Modified from Dr. Robert Siegfried original presentation.
Introduction to Vim Robbie CSCI2100 Data Structures Tutorial 3.
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.
VIM  This is the text editor you will use on the workstation.  You can also edit the text files under windows environment and upload it to the workstation.
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.
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.
Chapter 9 Using Text Editors. vi Editor visual Editor, ASCII text editor, no formatting capabilities almost as powerful as MS Word, has 26 clipboards.
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.
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.
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:
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.
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
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.
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.
Basic VI Tran, Van Hoai Faculty of Computer Science and Engineering HCMC Uni. of Technology
CS:414 introduction to Unix and Linux
Vim basics Vi IMproved.
Guide To UNIX Using Linux Third Edition
Vi Editor.
Unix Fundamentals - Part iii vi Editor
Vim.
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)
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
Presentation transcript:

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

(C) Doug Bowman, Virginia Tech, Text editing So far, we’ve manipulated files in the file system and viewed their contents Now we need to know how to modify the contents of files Most UNIX editors work on plain ASCII text files, not special formats Common text editors: vi, emacs, pico Window systems have own window-based editors

(C) Doug Bowman, Virginia Tech, Why vi? Available on practically all UNIX systems Can be used with a remote login (no windows) Balance of simplicity and power That’s what your professor had to learn, so, darn it, you’re going to learn it too!

(C) Doug Bowman, Virginia Tech, vi basics Invoke with: vi [filename(s)] The vi editor takes over your screen Various modes: command mode – typed characters send commands to system insert mode append mode typing changes the text change mode

(C) Doug Bowman, Virginia Tech, Command mode vi starts in this mode From other modes, enter command mode by typing Esc Commands for: Cursor movement Editing File operations Search Entering other modes

(C) Doug Bowman, Virginia Tech, Cursor movement Move the cursor with j (down), k (up), l (right), h (left), or with arrow keys Larger movements: 4j – move four lines down CTRL-F, CTRL-B – page down, page up w – move to beginning of next word ]], [[ - next/previous section 0, $ - beginning/end of current line :n – move to line n

(C) Doug Bowman, Virginia Tech, Editing commands u – undo last typing x – delete current character* dd – delete current line* dw – delete current word* rx – replace current char. with x* yy – copy current line* p – paste copied/deleted items J – join two lines * can be preceded by a number to do operation multiple times

(C) Doug Bowman, Virginia Tech, File operations ZZ, :wq – save and quit :w – save :w filename – save as filename :q – quit :q! – quit without saving :e - load another file :n – load next file

(C) Doug Bowman, Virginia Tech, Search /string – search forward for string ?string – search backward for string n – repeat previous search N – repeat search opposite direction % - find match of current (, [, {

(C) Doug Bowman, Virginia Tech, Entering other modes i – insert text before current char. I – insert text at beginning of line a – append text after current char. A – append text at end of line O, o – open line above/below current cw – change (overwrite) current word C – change text after cursor

(C) Doug Bowman, Virginia Tech, Additional info UNIX in a nutshell, ch. 8 lists all vi commands Trivia: vi uses all lowercase characters except ‘v’ (and many uppercase and punctuation characters) for commands Be careful! Use ‘u’, ‘U’, and ‘:q!’ if you mess up UIAN, ch. 7 covers emacs

(C) Doug Bowman, Virginia Tech, More shell commands: communication talk – interactive chat with another user (not on lab machines) Mail – text-based program ftp – text-based FTP program telnet, ssh – connect to other machines directly lynx – text-based web browser

(C) Doug Bowman, Virginia Tech, More shell commands: processes ps – list current processes top – dynamic display of system’s utilization by processes kill – terminate a process time – keep timing information for a process