SlideShare a Scribd company logo
VI Editor In Linux 
 Page 1
 Page 2 
Agenda 
WHAT IS VI EDITOR? 
HISTORY OF VI. 
CHARACTERISTIC OF VI. 
STARTING VI 
MODE IN VI EDITOR. 
COMMON VI COMMAND 
HOW TO EXIT FROM VI
 Page 3 
What is Vi Editor? 
 The visual editor on the Linux. 
 The vi editor comes with every version of Linux or Unix. 
 Using vi is similar to using other editors in that you can see your file on the 
screen .. 
 The vi editor is the most popular editor in linux. The current version is 
really "vim", but to invoke it simply type "vi". 
 Before vi the primary editor used on Unix was the line editor 
- User was able to see/edit only one line of the text at a time 
 The vi editor is not a text formatter (like MS Word, Word Perfect, etc.) 
- you cannot set margins 
- center headings 
- Etc…
 Page 4 
History of Vi Editor 
 Although other stories exist, the true one tells that vi was originally written 
by Bill Joy in 1976. 
 Who is Bill Joy you ask? 
- He co-founded Sun Microsystems in 1982 and served as chief scientist until 2003.
 Page 5 
Characteristics of vi 
 The vi editor is: 
- A very powerful 
- It is hard to learn, specially for windows users 
- Move from point to point in the file, and make changes. 
- Available on all UNIX systems
 Page 6 
Starting vi 
 Type vi <filename> at the shell prompt 
 After pressing enter the command prompt disappears and you see tilde(~) 
characters on all the lines 
 These tilde characters indicate that the line is blank
 Page 7 
Vi modes 
 There are three modes in vi 
- Command mode 
- Accessed by typing Esc 
- In this mode all the keys pressed by the user are interpret to the editor 
command. 
- Input mode 
- Accessed by typing “i” 
- This mode permits insertion of new text, editing of existing text or 
replacement of existing text. 
Ex mode( Last Line Mode) 
-The bottom line of the vi screen is called ex mode. 
- When you start vi by default it is in command mode 
-You exit the input mode by pressing the Esc key to get back 
to the command mode.
 Page 8 
VI EDITING MODES 
Command 
Mode 
Input 
Mode 
Last-Line 
Mode 
Esc 
Insert (i, I) 
Append (a, A), 
Open (o, O) 
Change (c), 
Replace (r, R) 
: Return
 Page 9 
Common Vi Commands 
 Moving Cursor Position 
 You can move around only when you are in the command mode 
 Arrow keys usually works(but may not) 
 The standard keys for moving cursor are: 
- h - for left 
- l - for right 
- j - for down 
- k - for up 
 w - to move one word forward 
 b - to move one word backward 
 $ - takes you to the end of line 
 <enter> takes the cursor the beginning of next line
 Page 10 
Conti.. 
 - - (minus) moves the cursor to the first character in the current line 
 H - takes the cursor to the beginning of the current screen Home position) 
 L - moves to the Lower last line 
 M - moves to the middle line on the current screen
 Page 11 
Conti.. 
 Control-d scrolls the screen down (half screen) 
 Control-u scrolls the screen up (half screen) 
 Control-f scrolls the screen forward (full screen) 
 Control-b scrolls the screen backward (full screen).
 Page 12 
Editing text 
 x - deletes the current character 
 d - is the delete command but pressing only d will not delete anything you 
need to press a second key 
- dw - deletes to end of word 
- dd - deletes the current line 
- d0 - deletes to beginning of line 
 There are many more keys to be used with delete command 
 The vi commands can be used followed by a number such as 
n<command key(s)> 
- For example dd deletes a line 5dd will delete five lines.
 Page 13 
Copy, cut and paste in vi 
 yy - (yank) copy current line to buffer 
 nyy - Where n is number of lines 
 p - Paste the yanked lines from buffer to the line below 
 P - Paste the yanked lines from buffer to the line above
 Page 14 
Undo and repeat command 
 u - undo the changes made by editing commands 
 . - (dot or period) repeats the last edit command
 Page 15 
How to exit from vi 
(command mode) 
 ZZ is for save and Exit (Note this command is uppercase) 
 :q <enter> is to exit, if you have not made any changes to the file
 Page 16 
Thank You

More Related Content

What's hot

Shell scripting
Shell scriptingShell scripting
Shell scripting
Manav Prasad
 
Linux Administration
Linux AdministrationLinux Administration
Linux Administration
Harish1983
 
Linux commands
Linux commandsLinux commands
Linux commands
penetration Tester
 
Storage Management in Linux OS.ppt
Storage Management in Linux OS.pptStorage Management in Linux OS.ppt
Storage Management in Linux OS.ppt
Rakesh Kadu
 
Unix OS & Commands
Unix OS & CommandsUnix OS & Commands
Unix OS & Commands
Mohit Belwal
 
Linux Basic commands and VI Editor
Linux Basic commands and VI EditorLinux Basic commands and VI Editor
Linux Basic commands and VI Editor
shanmuga rajan
 
Vim Editor And Basic Scripting (Ch-7)
Vim Editor And Basic Scripting (Ch-7)Vim Editor And Basic Scripting (Ch-7)
Vim Editor And Basic Scripting (Ch-7)
MohsinHusenManasiya
 
Introduction to Vim
Introduction to VimIntroduction to Vim
Introduction to Vim
Brandon Liu
 
User Administration in Linux
User Administration in LinuxUser Administration in Linux
User Administration in Linux
SAMUEL OJO
 
Shell programming
Shell programmingShell programming
Shell programming
Moayad Moawiah
 
Basics of shell programming
Basics of shell programmingBasics of shell programming
Basics of shell programming
Chandan Kumar Rana
 
Lesson 2 Understanding Linux File System
Lesson 2 Understanding Linux File SystemLesson 2 Understanding Linux File System
Lesson 2 Understanding Linux File System
Sadia Bashir
 
Basic unix commands
Basic unix commandsBasic unix commands
Basic unix commands
swtjerin4u
 
System calls
System callsSystem calls
System calls
Bernard Senam
 
Files in java
Files in javaFiles in java
Linux basic commands
Linux basic commandsLinux basic commands
Linux basic commands
MohanKumar Palanichamy
 
Introduction to Unix
Introduction to UnixIntroduction to Unix
Introduction to Unix
Nishant Munjal
 
Disk Management (DM)
Disk Management (DM)Disk Management (DM)
Disk Management (DM)
Arshad Qureshi
 

What's hot (20)

Shell scripting
Shell scriptingShell scripting
Shell scripting
 
Linux Administration
Linux AdministrationLinux Administration
Linux Administration
 
Shell scripting
Shell scriptingShell scripting
Shell scripting
 
Linux commands
Linux commandsLinux commands
Linux commands
 
Storage Management in Linux OS.ppt
Storage Management in Linux OS.pptStorage Management in Linux OS.ppt
Storage Management in Linux OS.ppt
 
Unix OS & Commands
Unix OS & CommandsUnix OS & Commands
Unix OS & Commands
 
Linux Basic commands and VI Editor
Linux Basic commands and VI EditorLinux Basic commands and VI Editor
Linux Basic commands and VI Editor
 
Vim Editor And Basic Scripting (Ch-7)
Vim Editor And Basic Scripting (Ch-7)Vim Editor And Basic Scripting (Ch-7)
Vim Editor And Basic Scripting (Ch-7)
 
Basic 50 linus command
Basic 50 linus commandBasic 50 linus command
Basic 50 linus command
 
Introduction to Vim
Introduction to VimIntroduction to Vim
Introduction to Vim
 
User Administration in Linux
User Administration in LinuxUser Administration in Linux
User Administration in Linux
 
Shell programming
Shell programmingShell programming
Shell programming
 
Basics of shell programming
Basics of shell programmingBasics of shell programming
Basics of shell programming
 
Lesson 2 Understanding Linux File System
Lesson 2 Understanding Linux File SystemLesson 2 Understanding Linux File System
Lesson 2 Understanding Linux File System
 
Basic unix commands
Basic unix commandsBasic unix commands
Basic unix commands
 
System calls
System callsSystem calls
System calls
 
Files in java
Files in javaFiles in java
Files in java
 
Linux basic commands
Linux basic commandsLinux basic commands
Linux basic commands
 
Introduction to Unix
Introduction to UnixIntroduction to Unix
Introduction to Unix
 
Disk Management (DM)
Disk Management (DM)Disk Management (DM)
Disk Management (DM)
 

Viewers also liked

The "vi" Text Editor
The "vi" Text EditorThe "vi" Text Editor
The "vi" Text Editor
Alessandro Manfredi
 
Different types of Editors in Linux
Different types of Editors in LinuxDifferent types of Editors in Linux
Different types of Editors in Linux
Bhavik Trivedi
 
Vi Editor
Vi EditorVi Editor
Linux command ppt
Linux command pptLinux command ppt
Linux command ppt
kalyanineve
 
Introduction to vi editor
Introduction to vi editorIntroduction to vi editor
Introduction to vi editorU.P Police
 
Linux Introduction (Commands)
Linux Introduction (Commands)Linux Introduction (Commands)
Linux Introduction (Commands)
anandvaidya
 
File permission in linux
File permission in linuxFile permission in linux
File permission in linux
Prakash Poudel
 
Basic Unix
Basic UnixBasic Unix
Basic Unix
Rajesh Kumar
 
An Introduction to Linux
An Introduction to LinuxAn Introduction to Linux
An Introduction to Linux
anandvaidya
 
Linux.ppt
Linux.ppt Linux.ppt
Linux.ppt
onu9
 
Permission chmod
Permission chmodPermission chmod
Permission chmodmfstep
 
Linux : Booting and runlevels
Linux : Booting and runlevelsLinux : Booting and runlevels
Linux : Booting and runlevels
John Ombagi
 
sistemas operativos
sistemas operativos sistemas operativos
sistemas operativos
HernanRP2014
 
Linux ud4 - editor vi
Linux   ud4 - editor viLinux   ud4 - editor vi
Linux ud4 - editor viJavier Muñoz
 
Archivos y Directorios
Archivos y DirectoriosArchivos y Directorios
Archivos y Directorios
Mayra Almache
 

Viewers also liked (20)

The "vi" Text Editor
The "vi" Text EditorThe "vi" Text Editor
The "vi" Text Editor
 
Different types of Editors in Linux
Different types of Editors in LinuxDifferent types of Editors in Linux
Different types of Editors in Linux
 
Vi Editor
Vi EditorVi Editor
Vi Editor
 
Linux command ppt
Linux command pptLinux command ppt
Linux command ppt
 
Introduction to vi editor
Introduction to vi editorIntroduction to vi editor
Introduction to vi editor
 
Linux Introduction (Commands)
Linux Introduction (Commands)Linux Introduction (Commands)
Linux Introduction (Commands)
 
File permission in linux
File permission in linuxFile permission in linux
File permission in linux
 
Basic Unix
Basic UnixBasic Unix
Basic Unix
 
Linux commands
Linux commandsLinux commands
Linux commands
 
An Introduction to Linux
An Introduction to LinuxAn Introduction to Linux
An Introduction to Linux
 
Linux File System
Linux File SystemLinux File System
Linux File System
 
Linux.ppt
Linux.ppt Linux.ppt
Linux.ppt
 
Hacking for Dummies 2
Hacking for Dummies 2Hacking for Dummies 2
Hacking for Dummies 2
 
Permission chmod
Permission chmodPermission chmod
Permission chmod
 
Linux : Booting and runlevels
Linux : Booting and runlevelsLinux : Booting and runlevels
Linux : Booting and runlevels
 
sistemas operativos
sistemas operativos sistemas operativos
sistemas operativos
 
Linux ud4 - editor vi
Linux   ud4 - editor viLinux   ud4 - editor vi
Linux ud4 - editor vi
 
Chmod
ChmodChmod
Chmod
 
Archivos y Directorios
Archivos y DirectoriosArchivos y Directorios
Archivos y Directorios
 
Ftp.75 to 76
Ftp.75 to 76Ftp.75 to 76
Ftp.75 to 76
 

Similar to Vi editor in linux

swl--3 (1).docx
swl--3 (1).docxswl--3 (1).docx
swl--3 (1).docx
HimanshuKimothi
 
lectuer 21-22.pptx
lectuer 21-22.pptxlectuer 21-22.pptx
lectuer 21-22.pptx
poonam256394
 
1_Editors_in_Unix
1_Editors_in_Unix1_Editors_in_Unix
1_Editors_in_UnixGautam Raja
 
Text editor In RHEL
Text editor In RHELText editor In RHEL
Text editor In RHEL
Varnnit Jain
 
07 vi text_editor
07 vi text_editor07 vi text_editor
07 vi text_editor
Shay Cohen
 
Productive text editing with Vim
Productive text editing with VimProductive text editing with Vim
Productive text editing with Vim
bryanbibat
 
Augusta Linux User Group - Vim Introduction
Augusta Linux User Group - Vim IntroductionAugusta Linux User Group - Vim Introduction
Augusta Linux User Group - Vim IntroductionKeith Pickett
 
VI Editor - R.D.Sivakumar
VI Editor - R.D.SivakumarVI Editor - R.D.Sivakumar
VI Editor - R.D.Sivakumar
Sivakumar R D .
 
Tuffarsi in vim
Tuffarsi in vimTuffarsi in vim
Tuffarsi in vimsambismo
 
Vi and redirection & piping in linux
Vi and redirection & piping in linuxVi and redirection & piping in linux
Vi and redirection & piping in linux
Neethu Jose
 
What is Vim?
What is Vim?What is Vim?
What is Vim?
Tatiana Tylosky
 
Vim Book
Vim BookVim Book
Vim Book
Maurício Sousa
 
Editing Tricks in Vim editor: The Power of dyp
Editing Tricks in Vim editor: The Power of dypEditing Tricks in Vim editor: The Power of dyp
Editing Tricks in Vim editor: The Power of dyp
Ramnath Banerjee
 
1359 Vi Editor
1359 Vi Editor1359 Vi Editor
1359 Vi Editor
techbed
 
Using VI Editor in Red Hat by Rohit Kumar
Using VI Editor in Red Hat by Rohit KumarUsing VI Editor in Red Hat by Rohit Kumar
Using VI Editor in Red Hat by Rohit KumarRohit Kumar
 
VI Editors
VI EditorsVI Editors
VI EditorsDeivanai
 

Similar to Vi editor in linux (20)

swl--3 (1).docx
swl--3 (1).docxswl--3 (1).docx
swl--3 (1).docx
 
lectuer 21-22.pptx
lectuer 21-22.pptxlectuer 21-22.pptx
lectuer 21-22.pptx
 
1_Editors_in_Unix
1_Editors_in_Unix1_Editors_in_Unix
1_Editors_in_Unix
 
Text editor In RHEL
Text editor In RHELText editor In RHEL
Text editor In RHEL
 
07 vi text_editor
07 vi text_editor07 vi text_editor
07 vi text_editor
 
Productive text editing with Vim
Productive text editing with VimProductive text editing with Vim
Productive text editing with Vim
 
Augusta Linux User Group - Vim Introduction
Augusta Linux User Group - Vim IntroductionAugusta Linux User Group - Vim Introduction
Augusta Linux User Group - Vim Introduction
 
VI Editor - R.D.Sivakumar
VI Editor - R.D.SivakumarVI Editor - R.D.Sivakumar
VI Editor - R.D.Sivakumar
 
Tuffarsi in vim
Tuffarsi in vimTuffarsi in vim
Tuffarsi in vim
 
Vi survival guide
Vi survival guideVi survival guide
Vi survival guide
 
Vi and redirection & piping in linux
Vi and redirection & piping in linuxVi and redirection & piping in linux
Vi and redirection & piping in linux
 
What is Vim?
What is Vim?What is Vim?
What is Vim?
 
Vim Book
Vim BookVim Book
Vim Book
 
Basic linux day 4
Basic linux day 4Basic linux day 4
Basic linux day 4
 
Editing Tricks in Vim editor: The Power of dyp
Editing Tricks in Vim editor: The Power of dypEditing Tricks in Vim editor: The Power of dyp
Editing Tricks in Vim editor: The Power of dyp
 
1359 Vi Editor
1359 Vi Editor1359 Vi Editor
1359 Vi Editor
 
Using VI Editor in Red Hat by Rohit Kumar
Using VI Editor in Red Hat by Rohit KumarUsing VI Editor in Red Hat by Rohit Kumar
Using VI Editor in Red Hat by Rohit Kumar
 
Using vi editor
Using vi editorUsing vi editor
Using vi editor
 
Linux notification
Linux notificationLinux notification
Linux notification
 
VI Editors
VI EditorsVI Editors
VI Editors
 

Recently uploaded

Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
How to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPHow to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERP
Celine George
 
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxStudents, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
EduSkills OECD
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 
The Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonThe Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve Thomason
Steve Thomason
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)
rosedainty
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
Fish and Chips - have they had their chips
Fish and Chips - have they had their chipsFish and Chips - have they had their chips
Fish and Chips - have they had their chips
GeoBlogs
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
Cambridge International AS  A Level Biology Coursebook - EBook (MaryFosbery J...Cambridge International AS  A Level Biology Coursebook - EBook (MaryFosbery J...
Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
AzmatAli747758
 

Recently uploaded (20)

Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
How to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPHow to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERP
 
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxStudents, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
The Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonThe Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve Thomason
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
Fish and Chips - have they had their chips
Fish and Chips - have they had their chipsFish and Chips - have they had their chips
Fish and Chips - have they had their chips
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
Cambridge International AS  A Level Biology Coursebook - EBook (MaryFosbery J...Cambridge International AS  A Level Biology Coursebook - EBook (MaryFosbery J...
Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
 

Vi editor in linux

  • 1. VI Editor In Linux  Page 1
  • 2.  Page 2 Agenda WHAT IS VI EDITOR? HISTORY OF VI. CHARACTERISTIC OF VI. STARTING VI MODE IN VI EDITOR. COMMON VI COMMAND HOW TO EXIT FROM VI
  • 3.  Page 3 What is Vi Editor?  The visual editor on the Linux.  The vi editor comes with every version of Linux or Unix.  Using vi is similar to using other editors in that you can see your file on the screen ..  The vi editor is the most popular editor in linux. The current version is really "vim", but to invoke it simply type "vi".  Before vi the primary editor used on Unix was the line editor - User was able to see/edit only one line of the text at a time  The vi editor is not a text formatter (like MS Word, Word Perfect, etc.) - you cannot set margins - center headings - Etc…
  • 4.  Page 4 History of Vi Editor  Although other stories exist, the true one tells that vi was originally written by Bill Joy in 1976.  Who is Bill Joy you ask? - He co-founded Sun Microsystems in 1982 and served as chief scientist until 2003.
  • 5.  Page 5 Characteristics of vi  The vi editor is: - A very powerful - It is hard to learn, specially for windows users - Move from point to point in the file, and make changes. - Available on all UNIX systems
  • 6.  Page 6 Starting vi  Type vi <filename> at the shell prompt  After pressing enter the command prompt disappears and you see tilde(~) characters on all the lines  These tilde characters indicate that the line is blank
  • 7.  Page 7 Vi modes  There are three modes in vi - Command mode - Accessed by typing Esc - In this mode all the keys pressed by the user are interpret to the editor command. - Input mode - Accessed by typing “i” - This mode permits insertion of new text, editing of existing text or replacement of existing text. Ex mode( Last Line Mode) -The bottom line of the vi screen is called ex mode. - When you start vi by default it is in command mode -You exit the input mode by pressing the Esc key to get back to the command mode.
  • 8.  Page 8 VI EDITING MODES Command Mode Input Mode Last-Line Mode Esc Insert (i, I) Append (a, A), Open (o, O) Change (c), Replace (r, R) : Return
  • 9.  Page 9 Common Vi Commands  Moving Cursor Position  You can move around only when you are in the command mode  Arrow keys usually works(but may not)  The standard keys for moving cursor are: - h - for left - l - for right - j - for down - k - for up  w - to move one word forward  b - to move one word backward  $ - takes you to the end of line  <enter> takes the cursor the beginning of next line
  • 10.  Page 10 Conti..  - - (minus) moves the cursor to the first character in the current line  H - takes the cursor to the beginning of the current screen Home position)  L - moves to the Lower last line  M - moves to the middle line on the current screen
  • 11.  Page 11 Conti..  Control-d scrolls the screen down (half screen)  Control-u scrolls the screen up (half screen)  Control-f scrolls the screen forward (full screen)  Control-b scrolls the screen backward (full screen).
  • 12.  Page 12 Editing text  x - deletes the current character  d - is the delete command but pressing only d will not delete anything you need to press a second key - dw - deletes to end of word - dd - deletes the current line - d0 - deletes to beginning of line  There are many more keys to be used with delete command  The vi commands can be used followed by a number such as n<command key(s)> - For example dd deletes a line 5dd will delete five lines.
  • 13.  Page 13 Copy, cut and paste in vi  yy - (yank) copy current line to buffer  nyy - Where n is number of lines  p - Paste the yanked lines from buffer to the line below  P - Paste the yanked lines from buffer to the line above
  • 14.  Page 14 Undo and repeat command  u - undo the changes made by editing commands  . - (dot or period) repeats the last edit command
  • 15.  Page 15 How to exit from vi (command mode)  ZZ is for save and Exit (Note this command is uppercase)  :q <enter> is to exit, if you have not made any changes to the file
  • 16.  Page 16 Thank You