Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to vi. Intro to vi vi is a ubiquitous text editor. It is available for Linux, Unix, Mac OS X and Windows (from and.

Similar presentations


Presentation on theme: "Introduction to vi. Intro to vi vi is a ubiquitous text editor. It is available for Linux, Unix, Mac OS X and Windows (from and."— Presentation transcript:

1 Introduction to vi

2 Intro to vi vi is a ubiquitous text editor. It is available for Linux, Unix, Mac OS X and Windows (from http://www.winvi.de/en/ and others). To run vi, simple type  vi  vi test.cpp

3 Intro to vi vi has 3 modes: 1. edit mode 2. insert mode 3. command mode

4 vi mode: edit Escreturn to edit mode /search-string /search again arrow keys Retnext line ^beginning of line $end of line xdelete char dwdelete word dddelete line n dddelete n lines uundo Ctrl-bbackwards a screenful of text Ctrl-fforwards a screenful of text Ctrl-rredo

5 vi mode: insert astart adding after cursor Astart adding at end of line iinsert in front of current cursor position Istart adding in front of line oopen a new line underneath current line Oopen a new line above current line Escexit insert mode

6 vi mode: command Command mode is entered with : from edit/insert mode. :qquit (if changes haven’t been made) :q!quit without saving changes :wsave changes; don’t quit :xsave changes and quit

7 copy-paste steps: 1. Place cursor (anywhere) on line you wish to copy. 2. shift-yyank (makes a copy of the line) or n shift-y to yank n lines 3. Move to location where you wish to paste line. 4. shift-pput

8 cut-paste steps: 1. Place cursor (anywhere) on line you wish to cut. 2. dddelete line or n dd to delete n lines 3. Move to location where you wish to paste line. 4. shift-pput

9 Remember… Escreturn to move/modify mode :xsave changes; quit :qquit :q!quit without saving changes dddelete line dwdelete word iinsert uundo


Download ppt "Introduction to vi. Intro to vi vi is a ubiquitous text editor. It is available for Linux, Unix, Mac OS X and Windows (from and."

Similar presentations


Ads by Google