unix - class2 - vi editor

8
UNIX vi Editor Presentation By Nihar R

Upload: nihar-ranjan-paital

Post on 16-Apr-2017

836 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: UNIX - Class2 - vi Editor

UNIX

vi Editor

Presentation By

Nihar R Paital

Page 2: UNIX - Class2 - vi Editor

Nihar R Paital

vi Control Mode Commands

h Move left one character l Move right one character w Move right one word b Move left one word W Move to beginning of next non-blank word B Move to beginning of preceding non-blank word e Move to end of current word E Move to end of current non-blank word 0 Move to beginning of line ^ Move to first non-blank character in line $ Move to end of line

Page 3: UNIX - Class2 - vi Editor

Nihar R Paital

Vi Control Mode Commands for Searching the History File

k or - :Move backward one line j or + :Move forward one line G :Move to line given by repeat count ? string :Search backward for string / string :Search forward for string n :Repeat search in same direction as

previous N :Repeat search in opposite direction of

previous

Page 4: UNIX - Class2 - vi Editor

Nihar R Paital

Entering and Changing Text

i Text inserted before current character (insert)

a Text inserted after current character (append)

I Text inserted at beginning of line A Text inserted at end of line R Text overwrites existing text o Text inserted at the next new line.

Page 5: UNIX - Class2 - vi Editor

Nihar R Paital

vi-mode Deletion Commands

dh Delete one character backwards dl Delete one character forwards db Delete one word backwards dw Delete one word forwards dB Delete one non-blank word backwards dW Delete one non-blank word forwards d$ Delete to end of line d0 Delete to beginning of line

Page 6: UNIX - Class2 - vi Editor

Nihar R Paital

Abbreviations for vi-mode Delete Commands

D Equivalent to d$ (delete to end of line) dd Equivalent to 0d$ (delete entire line) C Equivalent to c$ (delete to end of line, enter

input mode) cc Equivalent to 0c$ (delete entire line, enter

input mode) X Equivalent to dh (delete character backwards) x Equivalent to dl (delete character forwards)

Page 7: UNIX - Class2 - vi Editor

Nihar R Paital

Vi-mode Character-finding Commands

fx Move right to next occurrence of x Fx Move left to previous occurrence of x tx Move right to next occurrence of x , then back

one space Tx Move left to previous occurrence of x , then

forward one space ; Redo last character-finding command , Redo last character-finding command in

opposite direction

Page 8: UNIX - Class2 - vi Editor

Nihar R Paital

Thank You!