SlideShare a Scribd company logo
1 of 14
Download to read offline
Chapter 7Chapter 7
Vi EditorVi Editor
Ref. Pge. 252
Text EditorText Editor
●
Common text editors in Linux:Common text editors in Linux:
– vivi // vimvim : most available: most available
– emacsemacs : comprehensive: comprehensive
– nanonano : simple: simple
– geditgedit : GUI: GUI
Why VI?Why VI?
●
The reasons:The reasons:
– standardstandard
– AvailabilityAvailability
●
TheThe vimvim ::
– enhanced versionenhanced version
– Linux defaultLinux default
A Simple way for usingA Simple way for using vimvim
vim text.filevim text.file
1st: Press1st: Press ii keykey
2nd: Insert words2nd: Insert words
3rd: Press3rd: Press EscEsc thenthen
●
:wq :wq for savingfor saving
●
:q! :q! for without savingfor without saving
Vi ModesVi Modes
●
Command Mode:Command Mode:
– issue commandsissue commands
●
Insert Mode:Insert Mode:
– insert textinsert text
●
Ex (:) Mode:Ex (:) Mode:
– extended commandsextended commands
Switching ModesSwitching Modes
Command Mode
Insert Mode
Ex Mode
vim
i
Esc
: Enter
exit
Cursor MovingCursor Moving
●
By character:By character:
– h, j, k, lh, j, k, l
●
By word:By word:
– w, e, bw, e, b
●
By line:By line:
– 0, ^0, ^
– $$
– G, G, nnG, ggG, gg
Editing CommandsEditing Commands
●
Delete:Delete:
– d, dd, d, dd, nndd, Ddd, D
●
Copy:Copy:
– y, yy, y, yy, nnyy, Yyy, Y
●
Change:Change:
– c, cc, c, cc, nncc, Ccc, C
Other CommandsOther Commands
●
Paste:Paste:
– p, Pp, P
●
Undo:Undo:
– uu
●
Redo:Redo:
– ^r^r
Other CommandsOther Commands
●
Remove:Remove:
– X, xX, x
●
Replace:Replace:
– R, rR, r
●
Repeat:Repeat:
– ..
Searching CommandsSearching Commands
●
Forward:Forward:
– /key/key
●
Backward:Backward:
– ?key?key
●
Search next:Search next:
– n, Nn, N
Inserting CommandsInserting Commands
●
On the left:On the left:
– i, Ii, I
●
On the right:On the right:
– a, Aa, A
●
Above:Above:
– OO
●
Bellow:Bellow:
– oo
Extended Commands (:)Extended Commands (:)
!cmd !cmd : run a command: run a command
r !cmdr !cmd : read from command: read from command
r filer file : read from file: read from file
w filew file : write to file: write to file
q!q! : quit without saving: quit without saving
wqwq : write then quit: write then quit
xx : (same as above): (same as above)
Options settingOptions setting
set all set all : display current settings: display current settings
set ts=set ts=nn : set tab stop to: set tab stop to nn char.char.
set nu/nonuset nu/nonu : line number: line number
set hls/nohls set hls/nohls : highlight searching: highlight searching
set ai/noaiset ai/noai : auto indent: auto indent
syntax on/offsyntax on/off : syntax color: syntax color

More Related Content

Viewers also liked

Importance of linux system fundamental in technical documentation reading
Importance of linux system fundamental in technical documentation readingImportance of linux system fundamental in technical documentation reading
Importance of linux system fundamental in technical documentation readingKenny (netman)
 
Text editor In RHEL
Text editor In RHELText editor In RHEL
Text editor In RHELVarnnit Jain
 
Open source applications softwares
Open source applications softwaresOpen source applications softwares
Open source applications softwaresTushar B Kute
 
Module 1 introduction to Linux
Module 1 introduction to LinuxModule 1 introduction to Linux
Module 1 introduction to LinuxTushar B Kute
 
Module 02 Using Linux Command Shell
Module 02 Using Linux Command ShellModule 02 Using Linux Command Shell
Module 02 Using Linux Command ShellTushar B Kute
 
Linux fundamental - Chap 10 fs
Linux fundamental - Chap 10 fsLinux fundamental - Chap 10 fs
Linux fundamental - Chap 10 fsKenny (netman)
 
Linux fundamental - Chap 08 proc
Linux fundamental - Chap 08 procLinux fundamental - Chap 08 proc
Linux fundamental - Chap 08 procKenny (netman)
 
The linux command line for total beginners
The linux command line  for total beginnersThe linux command line  for total beginners
The linux command line for total beginnersCorrie Watt
 
Linux fundamental - Chap 01 io
Linux fundamental - Chap 01 ioLinux fundamental - Chap 01 io
Linux fundamental - Chap 01 ioKenny (netman)
 
Linux fundamental - Chap 06 regx
Linux fundamental - Chap 06 regxLinux fundamental - Chap 06 regx
Linux fundamental - Chap 06 regxKenny (netman)
 
Linux fundamental - Chap 03 file
Linux fundamental - Chap 03 fileLinux fundamental - Chap 03 file
Linux fundamental - Chap 03 fileKenny (netman)
 
Linux fundamental - Chap 13 account management
Linux fundamental - Chap 13 account managementLinux fundamental - Chap 13 account management
Linux fundamental - Chap 13 account managementKenny (netman)
 
Linux fundamental - Chap 05 filter
Linux fundamental - Chap 05 filterLinux fundamental - Chap 05 filter
Linux fundamental - Chap 05 filterKenny (netman)
 
Linux fundamental - Chap 09 pkg
Linux fundamental - Chap 09 pkgLinux fundamental - Chap 09 pkg
Linux fundamental - Chap 09 pkgKenny (netman)
 
Linux fundamental - Chap 02 perm
Linux fundamental - Chap 02 permLinux fundamental - Chap 02 perm
Linux fundamental - Chap 02 permKenny (netman)
 
Different types of Editors in Linux
Different types of Editors in LinuxDifferent types of Editors in Linux
Different types of Editors in LinuxBhavik Trivedi
 

Viewers also liked (20)

Importance of linux system fundamental in technical documentation reading
Importance of linux system fundamental in technical documentation readingImportance of linux system fundamental in technical documentation reading
Importance of linux system fundamental in technical documentation reading
 
Linux Edtitors
Linux EdtitorsLinux Edtitors
Linux Edtitors
 
Text editor In RHEL
Text editor In RHELText editor In RHEL
Text editor In RHEL
 
Best Text Editors 2016
Best Text Editors 2016Best Text Editors 2016
Best Text Editors 2016
 
Open source applications softwares
Open source applications softwaresOpen source applications softwares
Open source applications softwares
 
Module 1 introduction to Linux
Module 1 introduction to LinuxModule 1 introduction to Linux
Module 1 introduction to Linux
 
Module 02 Using Linux Command Shell
Module 02 Using Linux Command ShellModule 02 Using Linux Command Shell
Module 02 Using Linux Command Shell
 
Linux CLI
Linux CLILinux CLI
Linux CLI
 
Windows7 Vs Linux
Windows7 Vs LinuxWindows7 Vs Linux
Windows7 Vs Linux
 
Linux fundamental - Chap 10 fs
Linux fundamental - Chap 10 fsLinux fundamental - Chap 10 fs
Linux fundamental - Chap 10 fs
 
Linux fundamental - Chap 08 proc
Linux fundamental - Chap 08 procLinux fundamental - Chap 08 proc
Linux fundamental - Chap 08 proc
 
The linux command line for total beginners
The linux command line  for total beginnersThe linux command line  for total beginners
The linux command line for total beginners
 
Linux fundamental - Chap 01 io
Linux fundamental - Chap 01 ioLinux fundamental - Chap 01 io
Linux fundamental - Chap 01 io
 
Linux fundamental - Chap 06 regx
Linux fundamental - Chap 06 regxLinux fundamental - Chap 06 regx
Linux fundamental - Chap 06 regx
 
Linux fundamental - Chap 03 file
Linux fundamental - Chap 03 fileLinux fundamental - Chap 03 file
Linux fundamental - Chap 03 file
 
Linux fundamental - Chap 13 account management
Linux fundamental - Chap 13 account managementLinux fundamental - Chap 13 account management
Linux fundamental - Chap 13 account management
 
Linux fundamental - Chap 05 filter
Linux fundamental - Chap 05 filterLinux fundamental - Chap 05 filter
Linux fundamental - Chap 05 filter
 
Linux fundamental - Chap 09 pkg
Linux fundamental - Chap 09 pkgLinux fundamental - Chap 09 pkg
Linux fundamental - Chap 09 pkg
 
Linux fundamental - Chap 02 perm
Linux fundamental - Chap 02 permLinux fundamental - Chap 02 perm
Linux fundamental - Chap 02 perm
 
Different types of Editors in Linux
Different types of Editors in LinuxDifferent types of Editors in Linux
Different types of Editors in Linux
 

Similar to Linux fundamental - Chap 07 vi

andrew's guide to vim
andrew's guide to vimandrew's guide to vim
andrew's guide to vimAndrew Yi
 
Augusta Linux User Group - Vim Introduction
Augusta Linux User Group - Vim IntroductionAugusta Linux User Group - Vim Introduction
Augusta Linux User Group - Vim IntroductionKeith Pickett
 
Unit 5 vim an advanced text editor
Unit 5 vim an advanced text editorUnit 5 vim an advanced text editor
Unit 5 vim an advanced text editorroot_fibo
 
Linux network manager configure
Linux network manager configureLinux network manager configure
Linux network manager configureInfoExcavator
 
Linux network manager configuration
Linux network manager configurationLinux network manager configuration
Linux network manager configurationMd Meherab Hossen
 
lectuer 21-22.pptx
lectuer 21-22.pptxlectuer 21-22.pptx
lectuer 21-22.pptxpoonam256394
 
Onivim: Modal Editing from the Future
Onivim: Modal Editing from the FutureOnivim: Modal Editing from the Future
Onivim: Modal Editing from the FutureBryan Phelps
 
Neosnippet.vim + Deoppet.nvim in Vim conf 2017
Neosnippet.vim + Deoppet.nvim in Vim conf 2017Neosnippet.vim + Deoppet.nvim in Vim conf 2017
Neosnippet.vim + Deoppet.nvim in Vim conf 2017Shougo
 
windows-media-encoder.docx
windows-media-encoder.docxwindows-media-encoder.docx
windows-media-encoder.docxssuser1eca7d
 
Lesson 2 Importing media
Lesson 2 Importing mediaLesson 2 Importing media
Lesson 2 Importing mediacpashke
 

Similar to Linux fundamental - Chap 07 vi (20)

andrew's guide to vim
andrew's guide to vimandrew's guide to vim
andrew's guide to vim
 
swl--3 (1).docx
swl--3 (1).docxswl--3 (1).docx
swl--3 (1).docx
 
Augusta Linux User Group - Vim Introduction
Augusta Linux User Group - Vim IntroductionAugusta Linux User Group - Vim Introduction
Augusta Linux User Group - Vim Introduction
 
Unit 5 vim an advanced text editor
Unit 5 vim an advanced text editorUnit 5 vim an advanced text editor
Unit 5 vim an advanced text editor
 
Linux network manager configure
Linux network manager configureLinux network manager configure
Linux network manager configure
 
Linux network manager configuration
Linux network manager configurationLinux network manager configuration
Linux network manager configuration
 
Vim survival guide
Vim survival guideVim survival guide
Vim survival guide
 
How to use vim
How to use vimHow to use vim
How to use vim
 
lectuer 21-22.pptx
lectuer 21-22.pptxlectuer 21-22.pptx
lectuer 21-22.pptx
 
Basic linux day 4
Basic linux day 4Basic linux day 4
Basic linux day 4
 
zhng your vim
zhng your vimzhng your vim
zhng your vim
 
Vi editor
Vi editorVi editor
Vi editor
 
Onivim: Modal Editing from the Future
Onivim: Modal Editing from the FutureOnivim: Modal Editing from the Future
Onivim: Modal Editing from the Future
 
Neosnippet.vim + Deoppet.nvim in Vim conf 2017
Neosnippet.vim + Deoppet.nvim in Vim conf 2017Neosnippet.vim + Deoppet.nvim in Vim conf 2017
Neosnippet.vim + Deoppet.nvim in Vim conf 2017
 
Coding In Vim
Coding In VimCoding In Vim
Coding In Vim
 
windows-media-encoder.docx
windows-media-encoder.docxwindows-media-encoder.docx
windows-media-encoder.docx
 
Vim Showcase
Vim ShowcaseVim Showcase
Vim Showcase
 
Lesson 2 Importing media
Lesson 2 Importing mediaLesson 2 Importing media
Lesson 2 Importing media
 
What is Vim?
What is Vim?What is Vim?
What is Vim?
 
Vim and Python
Vim and PythonVim and Python
Vim and Python
 

More from Kenny (netman)

rpi_audio configuration steps
rpi_audio configuration stepsrpi_audio configuration steps
rpi_audio configuration stepsKenny (netman)
 
Linux fundamental - Chap 16 System Rescue
Linux fundamental - Chap 16 System RescueLinux fundamental - Chap 16 System Rescue
Linux fundamental - Chap 16 System RescueKenny (netman)
 
Linux fundamental - Chap 15 Job Scheduling
Linux fundamental - Chap 15 Job SchedulingLinux fundamental - Chap 15 Job Scheduling
Linux fundamental - Chap 15 Job SchedulingKenny (netman)
 
Linux fundamental - Chap 14 shell script
Linux fundamental - Chap 14 shell scriptLinux fundamental - Chap 14 shell script
Linux fundamental - Chap 14 shell scriptKenny (netman)
 
Linux fundamental - Chap 12 Hardware Management
Linux fundamental - Chap 12 Hardware ManagementLinux fundamental - Chap 12 Hardware Management
Linux fundamental - Chap 12 Hardware ManagementKenny (netman)
 
Linux fundamental - Chap 11 boot
Linux fundamental - Chap 11 bootLinux fundamental - Chap 11 boot
Linux fundamental - Chap 11 bootKenny (netman)
 
Linux fundamental - Chap 04 archive
Linux fundamental - Chap 04 archiveLinux fundamental - Chap 04 archive
Linux fundamental - Chap 04 archiveKenny (netman)
 
Linux fundamental - Chap 00 shell
Linux fundamental - Chap 00 shellLinux fundamental - Chap 00 shell
Linux fundamental - Chap 00 shellKenny (netman)
 
Linux network monitoring hands-on pratice
Linux network monitoring hands-on praticeLinux network monitoring hands-on pratice
Linux network monitoring hands-on praticeKenny (netman)
 
Linux Network Monitoring
Linux Network MonitoringLinux Network Monitoring
Linux Network MonitoringKenny (netman)
 

More from Kenny (netman) (20)

rpi_audio configuration steps
rpi_audio configuration stepsrpi_audio configuration steps
rpi_audio configuration steps
 
Rpi audio
Rpi audioRpi audio
Rpi audio
 
Ha opensuse
Ha opensuseHa opensuse
Ha opensuse
 
Chap 19 web
Chap 19 webChap 19 web
Chap 19 web
 
Chap 18 net
Chap 18 netChap 18 net
Chap 18 net
 
Chap 17 advfs
Chap 17 advfsChap 17 advfs
Chap 17 advfs
 
About the Course
About the CourseAbout the Course
About the Course
 
Linux fundamental - Chap 16 System Rescue
Linux fundamental - Chap 16 System RescueLinux fundamental - Chap 16 System Rescue
Linux fundamental - Chap 16 System Rescue
 
Linux fundamental - Chap 15 Job Scheduling
Linux fundamental - Chap 15 Job SchedulingLinux fundamental - Chap 15 Job Scheduling
Linux fundamental - Chap 15 Job Scheduling
 
Linux fundamental - Chap 14 shell script
Linux fundamental - Chap 14 shell scriptLinux fundamental - Chap 14 shell script
Linux fundamental - Chap 14 shell script
 
Linux fundamental - Chap 12 Hardware Management
Linux fundamental - Chap 12 Hardware ManagementLinux fundamental - Chap 12 Hardware Management
Linux fundamental - Chap 12 Hardware Management
 
Linux fundamental - Chap 11 boot
Linux fundamental - Chap 11 bootLinux fundamental - Chap 11 boot
Linux fundamental - Chap 11 boot
 
Linux fundamental - Chap 04 archive
Linux fundamental - Chap 04 archiveLinux fundamental - Chap 04 archive
Linux fundamental - Chap 04 archive
 
Linux fundamental - Chap 00 shell
Linux fundamental - Chap 00 shellLinux fundamental - Chap 00 shell
Linux fundamental - Chap 00 shell
 
Linux system security
Linux system securityLinux system security
Linux system security
 
Linux network monitoring hands-on pratice
Linux network monitoring hands-on praticeLinux network monitoring hands-on pratice
Linux network monitoring hands-on pratice
 
Linux Network Monitoring
Linux Network MonitoringLinux Network Monitoring
Linux Network Monitoring
 
加密應用(GPG)
加密應用(GPG)加密應用(GPG)
加密應用(GPG)
 
金鑰管理 (PKI)
金鑰管理 (PKI)金鑰管理 (PKI)
金鑰管理 (PKI)
 
Linux firewall
Linux firewallLinux firewall
Linux firewall
 

Recently uploaded

Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.arsicmarija21
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
MICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxMICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxabhijeetpadhi001
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxDr.Ibrahim Hassaan
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxUnboundStockton
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 

Recently uploaded (20)

Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
MICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxMICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptx
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptx
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docx
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 

Linux fundamental - Chap 07 vi

  • 1. Chapter 7Chapter 7 Vi EditorVi Editor Ref. Pge. 252
  • 2. Text EditorText Editor ● Common text editors in Linux:Common text editors in Linux: – vivi // vimvim : most available: most available – emacsemacs : comprehensive: comprehensive – nanonano : simple: simple – geditgedit : GUI: GUI
  • 3. Why VI?Why VI? ● The reasons:The reasons: – standardstandard – AvailabilityAvailability ● TheThe vimvim :: – enhanced versionenhanced version – Linux defaultLinux default
  • 4. A Simple way for usingA Simple way for using vimvim vim text.filevim text.file 1st: Press1st: Press ii keykey 2nd: Insert words2nd: Insert words 3rd: Press3rd: Press EscEsc thenthen ● :wq :wq for savingfor saving ● :q! :q! for without savingfor without saving
  • 5. Vi ModesVi Modes ● Command Mode:Command Mode: – issue commandsissue commands ● Insert Mode:Insert Mode: – insert textinsert text ● Ex (:) Mode:Ex (:) Mode: – extended commandsextended commands
  • 6. Switching ModesSwitching Modes Command Mode Insert Mode Ex Mode vim i Esc : Enter exit
  • 7. Cursor MovingCursor Moving ● By character:By character: – h, j, k, lh, j, k, l ● By word:By word: – w, e, bw, e, b ● By line:By line: – 0, ^0, ^ – $$ – G, G, nnG, ggG, gg
  • 8. Editing CommandsEditing Commands ● Delete:Delete: – d, dd, d, dd, nndd, Ddd, D ● Copy:Copy: – y, yy, y, yy, nnyy, Yyy, Y ● Change:Change: – c, cc, c, cc, nncc, Ccc, C
  • 9. Other CommandsOther Commands ● Paste:Paste: – p, Pp, P ● Undo:Undo: – uu ● Redo:Redo: – ^r^r
  • 10. Other CommandsOther Commands ● Remove:Remove: – X, xX, x ● Replace:Replace: – R, rR, r ● Repeat:Repeat: – ..
  • 11. Searching CommandsSearching Commands ● Forward:Forward: – /key/key ● Backward:Backward: – ?key?key ● Search next:Search next: – n, Nn, N
  • 12. Inserting CommandsInserting Commands ● On the left:On the left: – i, Ii, I ● On the right:On the right: – a, Aa, A ● Above:Above: – OO ● Bellow:Bellow: – oo
  • 13. Extended Commands (:)Extended Commands (:) !cmd !cmd : run a command: run a command r !cmdr !cmd : read from command: read from command r filer file : read from file: read from file w filew file : write to file: write to file q!q! : quit without saving: quit without saving wqwq : write then quit: write then quit xx : (same as above): (same as above)
  • 14. Options settingOptions setting set all set all : display current settings: display current settings set ts=set ts=nn : set tab stop to: set tab stop to nn char.char. set nu/nonuset nu/nonu : line number: line number set hls/nohls set hls/nohls : highlight searching: highlight searching set ai/noaiset ai/noai : auto indent: auto indent syntax on/offsyntax on/off : syntax color: syntax color