SlideShare a Scribd company logo
Introduction to vi Editor


    Prepared By Santosh Sharma
Why vi editor?

The advantage of learning vi and learning it well
is that one will find vi on all Unix based systems
and it does not consume an inordinate amount of
system resources. Vi works great over slow
network modem connections and on systems of
limited resources. One can completely utilize vi
without departing a single finger from the
keyboard.
Shell Prompt Text Editors
If you are not using a graphical desktop and
want to read and modify a text or configuration
file, Red Hat Linux includes the vi (pronounced
vee-eye) text editor. vi is a simple application
that opens within the shell prompt and allows
you to view, search, and modify text files. To
start vi, type vi at a shell prompt. To open a file
with vi type vi <filename> at a shell prompt.
Introduction to vi editor
Various Modes

By default, vi opens a file in Normal mode, meaning that
you can view and run built-in commands on the file but
you cannot add text to it. To add text, press [i] (for Insert
mode), which will allow you to make any modifications
you need to. To exit insert mode, press [Esc], and vi
reverts to Normal mode.
To exit vi, press [:] (which is the vi command mode) and
press [q] then [Enter]. If you have made changes to the
text file that you want to save, press [:] and type [w] then
[q] to write your changes to the file and exit the application.
If you accidentally made changes to a file and you want to
exit vi without saving the changes, type [:] and then type
[q] followed by [!], which exits without saving changes.
list of interactive commands
Keystrokes    Action
h/j/k/l       Move cursor left/down/up/right
spacebar      Move cursor right one space
-/+           Move cursor down/up in first column
ctrl-d        Scroll down one half of a page
ctrl-u        Scroll up one half of a page
ctrl-f        Scroll forward one page
ctrl-b        Scroll back one page
M (shift-h)   Move cursor to middle of page
H             Move cursor to top of page
list of interactive commands
L          Move cursor to bottom of page

W
           Move cursor a word at a time
w
           Move cursor ahead 5 words
5w
B          Move cursor back a word at a time
b          Move cursor back a word at a time
5b         Move cursor back 5 words
e          Move cursor to end of word
5e         Move cursor ahead to the end of the 5th word
0 (zero)   Move cursor to beginning of line
$          Move cursor to end of line
)          Move cursor to beginning of next sentence
(          Move cursor to beginning of current sentence
G          Move cursor to end of file
list of interactive commands
Keystr
  oke    Action
  s
i        Insert at cursor
a        Append after cursor
A        Append at end of line
ESC      Terminate insert mode
u        Undo last change
U        Undo all changes to entire line
o        Open a new line

dd       Delete line
3dd      Delete 3 lines.
list of interactive commands
D     Delete contents of line after cursor

      Delete contents of line after cursor and insert new text. Press
C
      esc key to end insertion.


dw    Delete word
4dw   Delete 4 words



cw    Change word


x     Delete character at cursor
Terminate session:
Use command: ZZ
Save changes and quit.


Use command line: ":wq"
Save (write) changes and quit.


Use command line: ":w"
Save (write) changes without quitting.


Use command line: ":q!"
Ignore changes and quit. No changes from last write will be
saved.


Use command line: ":qa"
Quit all files opened.
Ad

More Related Content

What's hot (18)

Linux fundamental - Chap 07 vi
Linux fundamental - Chap 07 viLinux fundamental - Chap 07 vi
Linux fundamental - Chap 07 vi
Kenny (netman)
 
Vicom
VicomVicom
Vicom
Bhargav Reddy
 
Vi Cheat Sheet v 1 00
Vi Cheat Sheet v 1 00Vi Cheat Sheet v 1 00
Vi Cheat Sheet v 1 00
Nicole Cordes
 
Vi Cheat Sheet
Vi Cheat SheetVi Cheat Sheet
Vi Cheat Sheet
Loiane Groner
 
Mission vim possible-full
Mission vim possible-fullMission vim possible-full
Mission vim possible-full
Sam Gottfried
 
Using vi
Using viUsing vi
Using vi
Nikola Stevanovic
 
Linux notification
Linux notificationLinux notification
Linux notification
baran19901990
 
Vim basic
Vim basicVim basic
Vim basic
Thanabodee Charoenpiriyakij
 
Vim
VimVim
Vim
Anuj Jain
 
Welcome vibrant-technology-navimumbai
Welcome vibrant-technology-navimumbaiWelcome vibrant-technology-navimumbai
Welcome vibrant-technology-navimumbai
Vibrant Technologies & Computers
 
Welcome vibrant-technology-navimumbai
Welcome vibrant-technology-navimumbaiWelcome vibrant-technology-navimumbai
Welcome vibrant-technology-navimumbai
Vibrant Technologies & Computers
 
Vim Vi Improved
Vim Vi ImprovedVim Vi Improved
Vim Vi Improved
Tusharadri Sarkar
 
Linux Command Line Multitasking
Linux Command Line MultitaskingLinux Command Line Multitasking
Linux Command Line Multitasking
Amr Fawzy
 
week-7x
week-7xweek-7x
week-7x
KITE www.kitecolleges.com
 
Vim cheat-sheet-en
Vim cheat-sheet-enVim cheat-sheet-en
Vim cheat-sheet-en
Yue-Peng Guo
 
The Ring programming language version 1.5.3 book - Part 20 of 184
The Ring programming language version 1.5.3 book - Part 20 of 184The Ring programming language version 1.5.3 book - Part 20 of 184
The Ring programming language version 1.5.3 book - Part 20 of 184
Mahmoud Samir Fayed
 
Pivorak Clojure by Dmytro Bignyak
Pivorak Clojure by Dmytro BignyakPivorak Clojure by Dmytro Bignyak
Pivorak Clojure by Dmytro Bignyak
Pivorak MeetUp
 
New ecr user manual
New ecr user manualNew ecr user manual
New ecr user manual
rajushirur
 

Viewers also liked (20)

Vi editor in linux
Vi editor in linuxVi editor in linux
Vi editor in linux
Bhumivaghasiya
 
Linux command ppt
Linux command pptLinux command ppt
Linux command ppt
kalyanineve
 
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
 
The "vi" Text Editor
The "vi" Text EditorThe "vi" Text Editor
The "vi" Text Editor
Alessandro Manfredi
 
Implement text editor
Implement text editorImplement text editor
Implement text editor
Amaan Shaikh
 
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
Rohit Kumar
 
Linux files
Linux filesLinux files
Linux files
Geeta Vinnakota
 
Dma
DmaDma
Dma
guest0f0fd2c
 
Linux Network commands
Linux Network commandsLinux Network commands
Linux Network commands
Hanan Nmr
 
Vi Editor
Vi EditorVi Editor
Vi Editor
Shiwang Kalkhanda
 
Linux ppt
Linux pptLinux ppt
Linux ppt
Rohit Kumar
 
Linux Troubleshooting
Linux TroubleshootingLinux Troubleshooting
Linux Troubleshooting
Keith Wright
 
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
 
Linux commands
Linux commandsLinux commands
Linux commands
Balakumaran Arunachalam
 
tybsc it sem 5 Linux administration notes of unit 1,2,3,4,5,6 version 3
tybsc it sem 5 Linux administration notes of unit 1,2,3,4,5,6 version 3tybsc it sem 5 Linux administration notes of unit 1,2,3,4,5,6 version 3
tybsc it sem 5 Linux administration notes of unit 1,2,3,4,5,6 version 3
WE-IT TUTORIALS
 
Basic command ppt
Basic command pptBasic command ppt
Basic command ppt
Rohit Kumar
 
Linux Introduction (Commands)
Linux Introduction (Commands)Linux Introduction (Commands)
Linux Introduction (Commands)
anandvaidya
 
An Introduction to Linux
An Introduction to LinuxAn Introduction to Linux
An Introduction to Linux
anandvaidya
 
Linux Systems Performance 2016
Linux Systems Performance 2016Linux Systems Performance 2016
Linux Systems Performance 2016
Brendan Gregg
 
Linux command ppt
Linux command pptLinux command ppt
Linux command ppt
kalyanineve
 
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
 
Implement text editor
Implement text editorImplement text editor
Implement text editor
Amaan Shaikh
 
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
Rohit Kumar
 
Linux Network commands
Linux Network commandsLinux Network commands
Linux Network commands
Hanan Nmr
 
Linux Troubleshooting
Linux TroubleshootingLinux Troubleshooting
Linux Troubleshooting
Keith Wright
 
File permission in linux
File permission in linuxFile permission in linux
File permission in linux
Prakash Poudel
 
tybsc it sem 5 Linux administration notes of unit 1,2,3,4,5,6 version 3
tybsc it sem 5 Linux administration notes of unit 1,2,3,4,5,6 version 3tybsc it sem 5 Linux administration notes of unit 1,2,3,4,5,6 version 3
tybsc it sem 5 Linux administration notes of unit 1,2,3,4,5,6 version 3
WE-IT TUTORIALS
 
Basic command ppt
Basic command pptBasic command ppt
Basic command ppt
Rohit Kumar
 
Linux Introduction (Commands)
Linux Introduction (Commands)Linux Introduction (Commands)
Linux Introduction (Commands)
anandvaidya
 
An Introduction to Linux
An Introduction to LinuxAn Introduction to Linux
An Introduction to Linux
anandvaidya
 
Linux Systems Performance 2016
Linux Systems Performance 2016Linux Systems Performance 2016
Linux Systems Performance 2016
Brendan Gregg
 
Ad

Similar to Introduction to vi editor (20)

Using vi editor
Using vi editorUsing vi editor
Using vi editor
Rohit Kumar
 
1_Editors_in_Unix
1_Editors_in_Unix1_Editors_in_Unix
1_Editors_in_Unix
Gautam Raja
 
Qc document draft
Qc document draftQc document draft
Qc document draft
gourabehera
 
Vi editor commands
Vi editor commandsVi editor commands
Vi editor commands
Femi Adeyemi
 
Vi reference
Vi referenceVi reference
Vi reference
aireddy
 
Vi reference
Vi referenceVi reference
Vi reference
SurenderAireddy
 
lectuer 21-22.pptx
lectuer 21-22.pptxlectuer 21-22.pptx
lectuer 21-22.pptx
poonam256394
 
Linux text editors
Linux text editorsLinux text editors
Linux text editors
InfoExcavator
 
Linux text editors Vim nano
Linux text editors Vim nano Linux text editors Vim nano
Linux text editors Vim nano
Md Meherab Hossen
 
Linux Text Editor (Vi) Command List Summary
Linux Text Editor (Vi) Command List SummaryLinux Text Editor (Vi) Command List Summary
Linux Text Editor (Vi) Command List Summary
minzo1988minzawoo
 
vim
vimvim
vim
jebiecorsiga
 
Vi editor Linux Editors
Vi editor Linux EditorsVi editor Linux Editors
Vi editor Linux Editors
TONO KURIAKOSE
 
Using Vi Editor.pptx
Using Vi Editor.pptxUsing Vi Editor.pptx
Using Vi Editor.pptx
Harsha Patel
 
Using Vi Editor.pptx
Using Vi Editor.pptxUsing Vi Editor.pptx
Using Vi Editor.pptx
Harsha Patel
 
intro unix/linux 04
intro unix/linux 04intro unix/linux 04
intro unix/linux 04
duquoi
 
VI Editors
VI EditorsVI Editors
VI Editors
Deivanai
 
Vi Vi Editor Unit 4 Power point presentation
Vi Vi Editor Unit 4 Power point presentationVi Vi Editor Unit 4 Power point presentation
Vi Vi Editor Unit 4 Power point presentation
jatinlntcdc
 
swl--3 (1).docx
swl--3 (1).docxswl--3 (1).docx
swl--3 (1).docx
HimanshuKimothi
 
Presentacion vim
Presentacion vimPresentacion vim
Presentacion vim
Icalia Labs
 
015-Editing-Files-With-Vi.pdf
015-Editing-Files-With-Vi.pdf015-Editing-Files-With-Vi.pdf
015-Editing-Files-With-Vi.pdf
ssuser584832
 
1_Editors_in_Unix
1_Editors_in_Unix1_Editors_in_Unix
1_Editors_in_Unix
Gautam Raja
 
Qc document draft
Qc document draftQc document draft
Qc document draft
gourabehera
 
Vi editor commands
Vi editor commandsVi editor commands
Vi editor commands
Femi Adeyemi
 
Vi reference
Vi referenceVi reference
Vi reference
aireddy
 
lectuer 21-22.pptx
lectuer 21-22.pptxlectuer 21-22.pptx
lectuer 21-22.pptx
poonam256394
 
Linux text editors Vim nano
Linux text editors Vim nano Linux text editors Vim nano
Linux text editors Vim nano
Md Meherab Hossen
 
Linux Text Editor (Vi) Command List Summary
Linux Text Editor (Vi) Command List SummaryLinux Text Editor (Vi) Command List Summary
Linux Text Editor (Vi) Command List Summary
minzo1988minzawoo
 
Vi editor Linux Editors
Vi editor Linux EditorsVi editor Linux Editors
Vi editor Linux Editors
TONO KURIAKOSE
 
Using Vi Editor.pptx
Using Vi Editor.pptxUsing Vi Editor.pptx
Using Vi Editor.pptx
Harsha Patel
 
Using Vi Editor.pptx
Using Vi Editor.pptxUsing Vi Editor.pptx
Using Vi Editor.pptx
Harsha Patel
 
intro unix/linux 04
intro unix/linux 04intro unix/linux 04
intro unix/linux 04
duquoi
 
VI Editors
VI EditorsVI Editors
VI Editors
Deivanai
 
Vi Vi Editor Unit 4 Power point presentation
Vi Vi Editor Unit 4 Power point presentationVi Vi Editor Unit 4 Power point presentation
Vi Vi Editor Unit 4 Power point presentation
jatinlntcdc
 
Presentacion vim
Presentacion vimPresentacion vim
Presentacion vim
Icalia Labs
 
015-Editing-Files-With-Vi.pdf
015-Editing-Files-With-Vi.pdf015-Editing-Files-With-Vi.pdf
015-Editing-Files-With-Vi.pdf
ssuser584832
 
Ad

Recently uploaded (20)

How to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of saleHow to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of sale
Celine George
 
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam SuccessUltimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Mark Soia
 
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
Celine George
 
How to Subscribe Newsletter From Odoo 18 Website
How to Subscribe Newsletter From Odoo 18 WebsiteHow to Subscribe Newsletter From Odoo 18 Website
How to Subscribe Newsletter From Odoo 18 Website
Celine George
 
Unit 6_Introduction_Phishing_Password Cracking.pdf
Unit 6_Introduction_Phishing_Password Cracking.pdfUnit 6_Introduction_Phishing_Password Cracking.pdf
Unit 6_Introduction_Phishing_Password Cracking.pdf
KanchanPatil34
 
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACYUNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
DR.PRISCILLA MARY J
 
YSPH VMOC Special Report - Measles Outbreak Southwest US 5-3-2025.pptx
YSPH VMOC Special Report - Measles Outbreak  Southwest US 5-3-2025.pptxYSPH VMOC Special Report - Measles Outbreak  Southwest US 5-3-2025.pptx
YSPH VMOC Special Report - Measles Outbreak Southwest US 5-3-2025.pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
 
Metamorphosis: Life's Transformative Journey
Metamorphosis: Life's Transformative JourneyMetamorphosis: Life's Transformative Journey
Metamorphosis: Life's Transformative Journey
Arshad Shaikh
 
Handling Multiple Choice Responses: Fortune Effiong.pptx
Handling Multiple Choice Responses: Fortune Effiong.pptxHandling Multiple Choice Responses: Fortune Effiong.pptx
Handling Multiple Choice Responses: Fortune Effiong.pptx
AuthorAIDNationalRes
 
Biophysics Chapter 3 Methods of Studying Macromolecules.pdf
Biophysics Chapter 3 Methods of Studying Macromolecules.pdfBiophysics Chapter 3 Methods of Studying Macromolecules.pdf
Biophysics Chapter 3 Methods of Studying Macromolecules.pdf
PKLI-Institute of Nursing and Allied Health Sciences Lahore , Pakistan.
 
To study Digestive system of insect.pptx
To study Digestive system of insect.pptxTo study Digestive system of insect.pptx
To study Digestive system of insect.pptx
Arshad Shaikh
 
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
larencebapu132
 
Understanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s GuideUnderstanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s Guide
GS Virdi
 
New Microsoft PowerPoint Presentation.pptx
New Microsoft PowerPoint Presentation.pptxNew Microsoft PowerPoint Presentation.pptx
New Microsoft PowerPoint Presentation.pptx
milanasargsyan5
 
Odoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo SlidesOdoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo Slides
Celine George
 
GDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptxGDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptx
azeenhodekar
 
Geography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjectsGeography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjects
ProfDrShaikhImran
 
SPRING FESTIVITIES - UK AND USA -
SPRING FESTIVITIES - UK AND USA            -SPRING FESTIVITIES - UK AND USA            -
SPRING FESTIVITIES - UK AND USA -
Colégio Santa Teresinha
 
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Library Association of Ireland
 
LDMMIA Reiki Master Spring 2025 Mini Updates
LDMMIA Reiki Master Spring 2025 Mini UpdatesLDMMIA Reiki Master Spring 2025 Mini Updates
LDMMIA Reiki Master Spring 2025 Mini Updates
LDM Mia eStudios
 
How to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of saleHow to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of sale
Celine George
 
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam SuccessUltimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Mark Soia
 
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
Celine George
 
How to Subscribe Newsletter From Odoo 18 Website
How to Subscribe Newsletter From Odoo 18 WebsiteHow to Subscribe Newsletter From Odoo 18 Website
How to Subscribe Newsletter From Odoo 18 Website
Celine George
 
Unit 6_Introduction_Phishing_Password Cracking.pdf
Unit 6_Introduction_Phishing_Password Cracking.pdfUnit 6_Introduction_Phishing_Password Cracking.pdf
Unit 6_Introduction_Phishing_Password Cracking.pdf
KanchanPatil34
 
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACYUNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
DR.PRISCILLA MARY J
 
Metamorphosis: Life's Transformative Journey
Metamorphosis: Life's Transformative JourneyMetamorphosis: Life's Transformative Journey
Metamorphosis: Life's Transformative Journey
Arshad Shaikh
 
Handling Multiple Choice Responses: Fortune Effiong.pptx
Handling Multiple Choice Responses: Fortune Effiong.pptxHandling Multiple Choice Responses: Fortune Effiong.pptx
Handling Multiple Choice Responses: Fortune Effiong.pptx
AuthorAIDNationalRes
 
To study Digestive system of insect.pptx
To study Digestive system of insect.pptxTo study Digestive system of insect.pptx
To study Digestive system of insect.pptx
Arshad Shaikh
 
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
larencebapu132
 
Understanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s GuideUnderstanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s Guide
GS Virdi
 
New Microsoft PowerPoint Presentation.pptx
New Microsoft PowerPoint Presentation.pptxNew Microsoft PowerPoint Presentation.pptx
New Microsoft PowerPoint Presentation.pptx
milanasargsyan5
 
Odoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo SlidesOdoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo Slides
Celine George
 
GDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptxGDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptx
azeenhodekar
 
Geography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjectsGeography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjects
ProfDrShaikhImran
 
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Library Association of Ireland
 
LDMMIA Reiki Master Spring 2025 Mini Updates
LDMMIA Reiki Master Spring 2025 Mini UpdatesLDMMIA Reiki Master Spring 2025 Mini Updates
LDMMIA Reiki Master Spring 2025 Mini Updates
LDM Mia eStudios
 

Introduction to vi editor

  • 1. Introduction to vi Editor Prepared By Santosh Sharma
  • 2. Why vi editor? The advantage of learning vi and learning it well is that one will find vi on all Unix based systems and it does not consume an inordinate amount of system resources. Vi works great over slow network modem connections and on systems of limited resources. One can completely utilize vi without departing a single finger from the keyboard.
  • 3. Shell Prompt Text Editors If you are not using a graphical desktop and want to read and modify a text or configuration file, Red Hat Linux includes the vi (pronounced vee-eye) text editor. vi is a simple application that opens within the shell prompt and allows you to view, search, and modify text files. To start vi, type vi at a shell prompt. To open a file with vi type vi <filename> at a shell prompt.
  • 5. Various Modes By default, vi opens a file in Normal mode, meaning that you can view and run built-in commands on the file but you cannot add text to it. To add text, press [i] (for Insert mode), which will allow you to make any modifications you need to. To exit insert mode, press [Esc], and vi reverts to Normal mode. To exit vi, press [:] (which is the vi command mode) and press [q] then [Enter]. If you have made changes to the text file that you want to save, press [:] and type [w] then [q] to write your changes to the file and exit the application. If you accidentally made changes to a file and you want to exit vi without saving the changes, type [:] and then type [q] followed by [!], which exits without saving changes.
  • 6. list of interactive commands Keystrokes Action h/j/k/l Move cursor left/down/up/right spacebar Move cursor right one space -/+ Move cursor down/up in first column ctrl-d Scroll down one half of a page ctrl-u Scroll up one half of a page ctrl-f Scroll forward one page ctrl-b Scroll back one page M (shift-h) Move cursor to middle of page H Move cursor to top of page
  • 7. list of interactive commands L Move cursor to bottom of page W Move cursor a word at a time w Move cursor ahead 5 words 5w B Move cursor back a word at a time b Move cursor back a word at a time 5b Move cursor back 5 words e Move cursor to end of word 5e Move cursor ahead to the end of the 5th word 0 (zero) Move cursor to beginning of line $ Move cursor to end of line ) Move cursor to beginning of next sentence ( Move cursor to beginning of current sentence G Move cursor to end of file
  • 8. list of interactive commands Keystr oke Action s i Insert at cursor a Append after cursor A Append at end of line ESC Terminate insert mode u Undo last change U Undo all changes to entire line o Open a new line dd Delete line 3dd Delete 3 lines.
  • 9. list of interactive commands D Delete contents of line after cursor Delete contents of line after cursor and insert new text. Press C esc key to end insertion. dw Delete word 4dw Delete 4 words cw Change word x Delete character at cursor
  • 10. Terminate session: Use command: ZZ Save changes and quit. Use command line: ":wq" Save (write) changes and quit. Use command line: ":w" Save (write) changes without quitting. Use command line: ":q!" Ignore changes and quit. No changes from last write will be saved. Use command line: ":qa" Quit all files opened.