Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to vi (a Unix, Linux, and Windows text editor)

Similar presentations


Presentation on theme: "Introduction to vi (a Unix, Linux, and Windows text editor)"— Presentation transcript:

1 Introduction to vi (a Unix, Linux, and Windows text editor)

2 Intro to vi vi is a ubiquitous text editor. It is available for Linux, Unix, and Windows (from http://www.winvi.de/en/ and others). To run vi, simple type –vi –vi test.cpp –(or by double-clicking or by right-clicking)

3 vi acronyms… viSUAL viSUAL EDITOR vISUAL iNTERFACE vERY iDIOTIC

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

5 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

6 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

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

8 Emacs command 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

9 Emacs command 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

10 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 (a Unix, Linux, and Windows text editor)"

Similar presentations


Ads by Google