SlideShare a Scribd company logo
Command
vi file
vi +n file
vi +$ file
vi +/pattern file
vi -r file

Starting vi
Description
start at line 1 of file
start at line n of file
start at last line of file
start at pattern in file (do not insert a space between the
``+'' and ``/'' characters.
recover file after a system crash

Inserting text
Keys pressed
Text inserted
a
after the cursor
A
after last character on the line
i
before the cursor
I
before first character on the line
o
open line below current line
O
open line above current line

Deleting text
Keys pressed
Text deleted
X
character under cursor
12x
12 characters
X
character to left of cursor
dw
word
3dw
three words
D0
to beginning of line
D$
to end of line
dd
current line
5dd
five lines
D{
to beginning of paragraph
D}
to end of paragraph
:1,. d
to beginning of file
:.,$ d
to end of file
:1,$ d
whole file
Moving the cursor
Keys pressed
Effect
h
left one character
l or <Space> right one character
k
up one line
j or <Enter> down one line
b
left one word
w
right one word
(
start of sentence
)
end of sentence
{
start of paragraph
}
end of paragraph
1G
top of file
nG
line n
G
end of file
<Ctrl>W
first character of insertion
<Ctrl>U
up ½ screen
<Ctrl>D
down ½ screen
<Ctrl>B
up one screen
<Ctrl>F
down one screen

Saving files and quitting vi
Command
Description
:e file
edit file (save current file with :w first)
:w
save (write out) the file being edited
:w file
save as file
:w! file
save as an existing file
:q
quit vi
:wq
save the file and quit vi
save the file if it has changed and quit
:x
vi
:q!
quit vi without saving changes
Changing and replacing text
Keys
Text changed or replaced
cw
Word
3cw three words
cc
current line
5cc five lines
r
current character only
R
current character and those to its right
s
current character
S
current line
switch between lowercase and
~
uppercase

Searching for text
Search
Finds
/and
next occurrence of ``and'', for example, ``and'', ``stand'', ``grand''
?and
previous occurrence of ``and''
/^The next line that starts with ``The'', for example, ``The'', ``Then'', ``There''
/^The> next line that starts with the word ``The''
/end$
next line that ends with ``end''
/[bB]ox next occurrence of ``box'' or ``Box''
n
repeat the most recent search, in the same direction
N
repeat the most recent search, in the opposite direction

Expression
.
*
.*
>

*
^
$
[set]
[XYZ]
[[:upper:]][[:lower:]]*
[^set]
[^XYZ[:digit:]]

Matching patterns of text
Matches
any single character
zero or more of the previous expression
zero or more arbitrary characters
end of a word
quote a special character
the character "*"
beginning of a line
end of a line
one character from a set of characters
one of the characters ``X'', ``Y'', or ``Z''
one uppercase character followed by any number of lowercase characters
one character not from a set of characters
any character except ``X'', ``Y'', ``Z'', or a numeric digit
Searching for and replacing text
Command
Description
:s/pear/peach/g
replace all occurrences of ``pear'' with ``peach'' on current line
:/orange/s//lemon/g change all occurrences of ``orange'' into ``lemon'' on next line containing ``orange''
replace all words starting with ``file'' by ``directory'' on every line from current line
:.,$/<file/directory/g
onward, for example, ``filename'' becomes ``directoryname''
:g/one/s//1/g
:%s/old/new

replace every occurrence of ``one'' with 1, for example, ``oneself'' becomes ``1self'',
``someone'' becomes ``some1''
replace the first occurrence of “old” with “new” on every line

Using markers and buffers
Command
Description
mf
set marker named ``f''
`f
go to marker ``f''
´f
go to start of line containing marker ``f''
"s12yy
copy 12 lines into buffer ``s''
"ty}
copy text from cursor to end of paragraph into buffer ``t''
"ly1G
copy text from cursor to top of file into buffer ``l''
"kd`f
cut text from cursor up to marker ``f'' into buffer ``k''
"kp
paste buffer ``k'' into text

Options to the :set command
Option
all
noautoindent
autoprint
noautowrite
nobeautify
directory=/var/preserve
noerrorbells
hardtabs=8
noignorecase
nolisp
nolist

Effect
list settings of all options
prevent the preparation of structured program text.
display the current line after each ex copy, move, or substitute command.
do not automatically write the contents of the modified buffer to the current file
when you give a next, rewind, tag, or ``!'' command, or a <Ctrl>^ (switch files) or
<Ctrl>] (goto tag) command.
do not discard all control characters except <Tab>, newline and formfeed from
the input.
set the default directory for the vi editing buffer. noedcompatible the absence of g
and c suffixes on substitute commands is not remembered.
do not precede error messages with a bell.
set the boundaries on which terminal hardware tabs are set or on which tabs the
system expands.
do not map all uppercase characters to thier lowercase equivalent.
do not autoindent to indent appropriately for LISP code.
do not display the tabs and end of line characters
magic

mesg
nomodelines
nonumber
nooptimize
paragraphs=IPLPPPQPP LIpplpipnpb
prompt
redraw
remap
report=5
scroll=11
sections=NHSHH HUuhsh+c
shell=/usr/bin/ksh)
shiftwidth=8
noshowmatch
noshowmode
noslowopen
tabstop=8
taglength=0
tags=tags /usr/lib/tags)
term=value of shell TERM variable)
timeout
warn
window=23
wrapscan
wrapmargin=0
nowriteany

with nomagic set, the number of regular expression metacharacters is greatly
reduced, with only caret ``^'' and dollar sign ``$'' having special effects. In
addition, the metacharacters tilde ``~'' and ampersand ``&'' in replacement
patterns are treated as normal characters.
prevents other users writing to your screen with the UNIX write command and
scrambling your screen as you edit.
disable the first five and last five lines of a file being read in to be interpreted as
vi or ex commands.
do not display output lines with their line numbers.
allow the terminal perform automatic carriage returns when displaying more than
one line of output.
set the paragraph delimiters for the { and } operations.
force ex input to be prompted for with a colon ``:''.
simulate (using great amounts of output) an intelligent terminal on a dumb
terminal.
mapped characters are repeatedly tried until they are unchanged. For example, if o
is mapped to O and O is mapped to I, o will map to I if remap is set, and to O if
noremap is set.
set the threshold for feedback from commands.
the number of logical lines scrolled when <Ctrl>-D is received from a terminal
input.
set the section macros for the [[ and ]] operations.
set the pathname of the shell forked for the shell escape ``!'' command, and by the
shell command.
set the width of a software tab stop, used in reverse tabbing with <Ctrl>-D when
using autoindent to append text, and by the shift commands.
when a ``)'' or ``}'' is typed, moves the cursor to the matching ``('' or ``{'' for one
second if this matching character is on the screen.
prevents the message ``INPUT MODE'' from being displayed on the lower right
corner of the screen when insert mode is activated.
enables the display of updates during inserts.
expand tabs in the input file to be on n boundaries for the purposes of display.
accept the first n characters in a tag name to be significant, but all others to be
ignored.
set a path of files to be used as tag files for the tag command.
set the terminal type of the output device.
set the milliseconds to wait for subsequent input characters.
displays ``[No write since last change]'' before a shell escape command (!) if file
has not been saved.
set the number of lines in a text window.
searches using the regular expressions in addressing wrap around past the end of
the file.
defines the margin for automatic insertion of newlines during text input.
perform all checks normally made before write commands.
Pasting Text using Put
Often, when you delete or cut text, you may wish to reinsert it in another location of the
document. The Put command will paste in the last portion of text that was deleted since
deleted text is stored in a buffer. To use this command, place the cursor where you wish the
deleted text to appear. Then use p to reinsert the text. If you are inserting a line or
paragraph use the lower case p to insert on the line below the cursor or upper case P to
place in on the line above the cursor.

Copying Text with Yank
If you wish to make a duplicate copy of existing text, you may use the yank and put
commands to accomplish this function. Yank copies the selected text into a buffer and holds
it until another yank or deletion occurs. Yank is usually used in combination with a word or
line object such as the ones shown below:
yw copies a word into a buffer (7yw copies 7 words)
yy copies a line into a buffer (3yy will copy 3 lines)

Once the desired text is yanked, place the cursor in the spot in which you wish to insert the
text and then use the put command (p for line below or P for line above) to insert the
contents of the buffer.

Joining Lines
Since vi does not use automatic word wrap, it is not unusual in editing lines to end up with
lines that are too short and that might be improved if joined together. To do this, place your
cursor on the first line to be joined and type J. As with other commands, you can precede J
with a number to join multiple lines (4J joins 4 lines).

More Related Content

What's hot

6 c control statements branching &amp; jumping
6 c control statements branching &amp; jumping6 c control statements branching &amp; jumping
6 c control statements branching &amp; jumping
MomenMostafa
 
7 functions
7  functions7  functions
7 functions
MomenMostafa
 
Type header file in c++ and its function
Type header file in c++ and its functionType header file in c++ and its function
Type header file in c++ and its functionFrankie Jones
 
Sap script system_symbol
Sap script system_symbolSap script system_symbol
Sap script system_symbolmoderngladiator
 
Turbo basic commands
Turbo basic commandsTurbo basic commands
Turbo basic commandsjulviapretty
 
Awk hints
Awk hintsAwk hints
system software
system software system software
system software randhirlpu
 
Regular expressions in oracle
Regular expressions in oracleRegular expressions in oracle
Regular expressions in oracle
Logan Palanisamy
 
Lecture 8- Data Input and Output
Lecture 8- Data Input and OutputLecture 8- Data Input and Output
Lecture 8- Data Input and Output
Md. Imran Hossain Showrov
 
Shortcuts JAVA
Shortcuts JAVAShortcuts JAVA
Shortcuts JAVA
Tito O
 
Vi CheatSheet
Vi CheatSheetVi CheatSheet
Vi CheatSheet
framinazzi
 
C Programming Unit-2
C Programming Unit-2C Programming Unit-2
C Programming Unit-2
Vikram Nandini
 
Lecture 6- Intorduction to C Programming
Lecture 6- Intorduction to C ProgrammingLecture 6- Intorduction to C Programming
Lecture 6- Intorduction to C Programming
Md. Imran Hossain Showrov
 
C programming Workshop
C programming WorkshopC programming Workshop
C programming Workshop
neosphere
 
2 data and c
2 data and c2 data and c
2 data and c
MomenMostafa
 

What's hot (17)

6 c control statements branching &amp; jumping
6 c control statements branching &amp; jumping6 c control statements branching &amp; jumping
6 c control statements branching &amp; jumping
 
7 functions
7  functions7  functions
7 functions
 
Type header file in c++ and its function
Type header file in c++ and its functionType header file in c++ and its function
Type header file in c++ and its function
 
Sap script system_symbol
Sap script system_symbolSap script system_symbol
Sap script system_symbol
 
Turbo basic commands
Turbo basic commandsTurbo basic commands
Turbo basic commands
 
Strings
StringsStrings
Strings
 
Awk hints
Awk hintsAwk hints
Awk hints
 
system software
system software system software
system software
 
Strings in c++
Strings in c++Strings in c++
Strings in c++
 
Regular expressions in oracle
Regular expressions in oracleRegular expressions in oracle
Regular expressions in oracle
 
Lecture 8- Data Input and Output
Lecture 8- Data Input and OutputLecture 8- Data Input and Output
Lecture 8- Data Input and Output
 
Shortcuts JAVA
Shortcuts JAVAShortcuts JAVA
Shortcuts JAVA
 
Vi CheatSheet
Vi CheatSheetVi CheatSheet
Vi CheatSheet
 
C Programming Unit-2
C Programming Unit-2C Programming Unit-2
C Programming Unit-2
 
Lecture 6- Intorduction to C Programming
Lecture 6- Intorduction to C ProgrammingLecture 6- Intorduction to C Programming
Lecture 6- Intorduction to C Programming
 
C programming Workshop
C programming WorkshopC programming Workshop
C programming Workshop
 
2 data and c
2 data and c2 data and c
2 data and c
 

Viewers also liked

Unix fundamentals
Unix fundamentalsUnix fundamentals
Unix fundamentalsDima Gomaa
 
Emacs入门
Emacs入门Emacs入门
Emacs入门yinhm .
 
Emacs - COSCUP 2012
Emacs - COSCUP 2012Emacs - COSCUP 2012
Emacs - COSCUP 2012Kan-Ru Chen
 
UNIX - Class2 - vi Editor
UNIX - Class2 - vi EditorUNIX - Class2 - vi Editor
UNIX - Class2 - vi Editor
Nihar Ranjan Paital
 
1359 Vi Editor
1359 Vi Editor1359 Vi Editor
1359 Vi Editor
techbed
 
How Emacs changed my life
How Emacs changed my lifeHow Emacs changed my life
How Emacs changed my lifeyukihiro_matz
 

Viewers also liked (6)

Unix fundamentals
Unix fundamentalsUnix fundamentals
Unix fundamentals
 
Emacs入门
Emacs入门Emacs入门
Emacs入门
 
Emacs - COSCUP 2012
Emacs - COSCUP 2012Emacs - COSCUP 2012
Emacs - COSCUP 2012
 
UNIX - Class2 - vi Editor
UNIX - Class2 - vi EditorUNIX - Class2 - vi Editor
UNIX - Class2 - vi Editor
 
1359 Vi Editor
1359 Vi Editor1359 Vi Editor
1359 Vi Editor
 
How Emacs changed my life
How Emacs changed my lifeHow Emacs changed my life
How Emacs changed my life
 

Similar to Beginning with vi text editor

vim-cheatsheet.pdf
vim-cheatsheet.pdfvim-cheatsheet.pdf
vim-cheatsheet.pdf
AnkitPangasa1
 
Vi cheat sheet
Vi cheat sheetVi cheat sheet
Vi cheat sheet
Farrukh Salman
 
Vi cheat sheet
Vi cheat sheetVi cheat sheet
Vi cheat sheet
Kopi Maheswaran
 
Vi editor commands
Vi editor commandsVi editor commands
Vi editor commands
Femi Adeyemi
 
python_strings.pdf
python_strings.pdfpython_strings.pdf
python_strings.pdf
rajendraprasadbabub1
 
write the code for Part 1 ContextFree Grammars Create con.pdf
write the code for Part 1  ContextFree Grammars Create con.pdfwrite the code for Part 1  ContextFree Grammars Create con.pdf
write the code for Part 1 ContextFree Grammars Create con.pdf
aaryanentp
 
Hex file and regex cheat sheet
Hex file and regex cheat sheetHex file and regex cheat sheet
Hex file and regex cheat sheetMartin Cabrera
 
Cheatsheet: Hex file headers and regex
Cheatsheet: Hex file headers and regexCheatsheet: Hex file headers and regex
Cheatsheet: Hex file headers and regex
Kasper de Waard
 
Python programming unit 2 -Slides-3.ppt
Python programming  unit 2 -Slides-3.pptPython programming  unit 2 -Slides-3.ppt
Python programming unit 2 -Slides-3.ppt
geethar79
 
awkbash quick ref for Red hat Linux admin
awkbash quick ref for Red hat Linux adminawkbash quick ref for Red hat Linux admin
awkbash quick ref for Red hat Linux admin
ZoumanaDiomande1
 
Vim commands
Vim commandsVim commands
Vim commands
AliviyaSen1
 
MATLAB programming tips 2 - Input and Output Commands
MATLAB programming tips 2 - Input and Output CommandsMATLAB programming tips 2 - Input and Output Commands
MATLAB programming tips 2 - Input and Output Commands
Shameer Ahmed Koya
 
T03 a basicioprintf
T03 a basicioprintfT03 a basicioprintf
T03 a basicioprintf
teach4uin
 
Doscommands
DoscommandsDoscommands
Doscommands
DoscommandsDoscommands
DoscommandsDurgule
 
vim - Tips and_tricks
vim - Tips and_tricksvim - Tips and_tricks
vim - Tips and_tricks
Logan Palanisamy
 
Introduction to matlab
Introduction to matlabIntroduction to matlab
Introduction to matlab
Mohan Raj
 
Shad_Cryptography_PracticalFile_IT_4th_Year (1).docx
Shad_Cryptography_PracticalFile_IT_4th_Year (1).docxShad_Cryptography_PracticalFile_IT_4th_Year (1).docx
Shad_Cryptography_PracticalFile_IT_4th_Year (1).docx
Sonu62614
 

Similar to Beginning with vi text editor (20)

vim
vimvim
vim
 
vim-cheatsheet.pdf
vim-cheatsheet.pdfvim-cheatsheet.pdf
vim-cheatsheet.pdf
 
Vi cheat sheet
Vi cheat sheetVi cheat sheet
Vi cheat sheet
 
Vi cheat sheet
Vi cheat sheetVi cheat sheet
Vi cheat sheet
 
Vi editor commands
Vi editor commandsVi editor commands
Vi editor commands
 
python_strings.pdf
python_strings.pdfpython_strings.pdf
python_strings.pdf
 
write the code for Part 1 ContextFree Grammars Create con.pdf
write the code for Part 1  ContextFree Grammars Create con.pdfwrite the code for Part 1  ContextFree Grammars Create con.pdf
write the code for Part 1 ContextFree Grammars Create con.pdf
 
Hex file and regex cheat sheet
Hex file and regex cheat sheetHex file and regex cheat sheet
Hex file and regex cheat sheet
 
Cheatsheet: Hex file headers and regex
Cheatsheet: Hex file headers and regexCheatsheet: Hex file headers and regex
Cheatsheet: Hex file headers and regex
 
Python programming unit 2 -Slides-3.ppt
Python programming  unit 2 -Slides-3.pptPython programming  unit 2 -Slides-3.ppt
Python programming unit 2 -Slides-3.ppt
 
awkbash quick ref for Red hat Linux admin
awkbash quick ref for Red hat Linux adminawkbash quick ref for Red hat Linux admin
awkbash quick ref for Red hat Linux admin
 
Strings
StringsStrings
Strings
 
Vim commands
Vim commandsVim commands
Vim commands
 
MATLAB programming tips 2 - Input and Output Commands
MATLAB programming tips 2 - Input and Output CommandsMATLAB programming tips 2 - Input and Output Commands
MATLAB programming tips 2 - Input and Output Commands
 
T03 a basicioprintf
T03 a basicioprintfT03 a basicioprintf
T03 a basicioprintf
 
Doscommands
DoscommandsDoscommands
Doscommands
 
Doscommands
DoscommandsDoscommands
Doscommands
 
vim - Tips and_tricks
vim - Tips and_tricksvim - Tips and_tricks
vim - Tips and_tricks
 
Introduction to matlab
Introduction to matlabIntroduction to matlab
Introduction to matlab
 
Shad_Cryptography_PracticalFile_IT_4th_Year (1).docx
Shad_Cryptography_PracticalFile_IT_4th_Year (1).docxShad_Cryptography_PracticalFile_IT_4th_Year (1).docx
Shad_Cryptography_PracticalFile_IT_4th_Year (1).docx
 

More from Jose Pla

Master Data Management - MDM - Pasos para implementar MDM
Master Data Management - MDM - Pasos para implementar MDMMaster Data Management - MDM - Pasos para implementar MDM
Master Data Management - MDM - Pasos para implementar MDM
Jose Pla
 
7 habits of highly effective people plus what is a talanted resource
7 habits of highly effective people plus what is a talanted resource7 habits of highly effective people plus what is a talanted resource
7 habits of highly effective people plus what is a talanted resourceJose Pla
 
Introducción a GNU - POSIX - LINUX
Introducción a GNU - POSIX - LINUXIntroducción a GNU - POSIX - LINUX
Introducción a GNU - POSIX - LINUX
Jose Pla
 
Defensa Proyecto Final de Graduación - MBA - Viabilidad de BI en el Gobierno ...
Defensa Proyecto Final de Graduación - MBA - Viabilidad de BI en el Gobierno ...Defensa Proyecto Final de Graduación - MBA - Viabilidad de BI en el Gobierno ...
Defensa Proyecto Final de Graduación - MBA - Viabilidad de BI en el Gobierno ...
Jose Pla
 
Estudio de viabilidad de implementación de bi en el sector público de Costa Rica
Estudio de viabilidad de implementación de bi en el sector público de Costa RicaEstudio de viabilidad de implementación de bi en el sector público de Costa Rica
Estudio de viabilidad de implementación de bi en el sector público de Costa Rica
Jose Pla
 
Developing innovation
Developing innovationDeveloping innovation
Developing innovation
Jose Pla
 

More from Jose Pla (6)

Master Data Management - MDM - Pasos para implementar MDM
Master Data Management - MDM - Pasos para implementar MDMMaster Data Management - MDM - Pasos para implementar MDM
Master Data Management - MDM - Pasos para implementar MDM
 
7 habits of highly effective people plus what is a talanted resource
7 habits of highly effective people plus what is a talanted resource7 habits of highly effective people plus what is a talanted resource
7 habits of highly effective people plus what is a talanted resource
 
Introducción a GNU - POSIX - LINUX
Introducción a GNU - POSIX - LINUXIntroducción a GNU - POSIX - LINUX
Introducción a GNU - POSIX - LINUX
 
Defensa Proyecto Final de Graduación - MBA - Viabilidad de BI en el Gobierno ...
Defensa Proyecto Final de Graduación - MBA - Viabilidad de BI en el Gobierno ...Defensa Proyecto Final de Graduación - MBA - Viabilidad de BI en el Gobierno ...
Defensa Proyecto Final de Graduación - MBA - Viabilidad de BI en el Gobierno ...
 
Estudio de viabilidad de implementación de bi en el sector público de Costa Rica
Estudio de viabilidad de implementación de bi en el sector público de Costa RicaEstudio de viabilidad de implementación de bi en el sector público de Costa Rica
Estudio de viabilidad de implementación de bi en el sector público de Costa Rica
 
Developing innovation
Developing innovationDeveloping innovation
Developing innovation
 

Recently uploaded

Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptxMARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
bennyroshan06
 
How to Break the cycle of negative Thoughts
How to Break the cycle of negative ThoughtsHow to Break the cycle of negative Thoughts
How to Break the cycle of negative Thoughts
Col Mukteshwar Prasad
 
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
 
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
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
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
 
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
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
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
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdf
Vivekanand Anglo Vedic Academy
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
How to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS ModuleHow to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS Module
Celine George
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
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
 

Recently uploaded (20)

Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptxMARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
 
How to Break the cycle of negative Thoughts
How to Break the cycle of negative ThoughtsHow to Break the cycle of negative Thoughts
How to Break the cycle of negative Thoughts
 
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
 
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
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
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
 
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
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
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 ...
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdf
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
How to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS ModuleHow to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS Module
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
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
 

Beginning with vi text editor

  • 1. Command vi file vi +n file vi +$ file vi +/pattern file vi -r file Starting vi Description start at line 1 of file start at line n of file start at last line of file start at pattern in file (do not insert a space between the ``+'' and ``/'' characters. recover file after a system crash Inserting text Keys pressed Text inserted a after the cursor A after last character on the line i before the cursor I before first character on the line o open line below current line O open line above current line Deleting text Keys pressed Text deleted X character under cursor 12x 12 characters X character to left of cursor dw word 3dw three words D0 to beginning of line D$ to end of line dd current line 5dd five lines D{ to beginning of paragraph D} to end of paragraph :1,. d to beginning of file :.,$ d to end of file :1,$ d whole file
  • 2. Moving the cursor Keys pressed Effect h left one character l or <Space> right one character k up one line j or <Enter> down one line b left one word w right one word ( start of sentence ) end of sentence { start of paragraph } end of paragraph 1G top of file nG line n G end of file <Ctrl>W first character of insertion <Ctrl>U up ½ screen <Ctrl>D down ½ screen <Ctrl>B up one screen <Ctrl>F down one screen Saving files and quitting vi Command Description :e file edit file (save current file with :w first) :w save (write out) the file being edited :w file save as file :w! file save as an existing file :q quit vi :wq save the file and quit vi save the file if it has changed and quit :x vi :q! quit vi without saving changes
  • 3. Changing and replacing text Keys Text changed or replaced cw Word 3cw three words cc current line 5cc five lines r current character only R current character and those to its right s current character S current line switch between lowercase and ~ uppercase Searching for text Search Finds /and next occurrence of ``and'', for example, ``and'', ``stand'', ``grand'' ?and previous occurrence of ``and'' /^The next line that starts with ``The'', for example, ``The'', ``Then'', ``There'' /^The> next line that starts with the word ``The'' /end$ next line that ends with ``end'' /[bB]ox next occurrence of ``box'' or ``Box'' n repeat the most recent search, in the same direction N repeat the most recent search, in the opposite direction Expression . * .* > * ^ $ [set] [XYZ] [[:upper:]][[:lower:]]* [^set] [^XYZ[:digit:]] Matching patterns of text Matches any single character zero or more of the previous expression zero or more arbitrary characters end of a word quote a special character the character "*" beginning of a line end of a line one character from a set of characters one of the characters ``X'', ``Y'', or ``Z'' one uppercase character followed by any number of lowercase characters one character not from a set of characters any character except ``X'', ``Y'', ``Z'', or a numeric digit
  • 4. Searching for and replacing text Command Description :s/pear/peach/g replace all occurrences of ``pear'' with ``peach'' on current line :/orange/s//lemon/g change all occurrences of ``orange'' into ``lemon'' on next line containing ``orange'' replace all words starting with ``file'' by ``directory'' on every line from current line :.,$/<file/directory/g onward, for example, ``filename'' becomes ``directoryname'' :g/one/s//1/g :%s/old/new replace every occurrence of ``one'' with 1, for example, ``oneself'' becomes ``1self'', ``someone'' becomes ``some1'' replace the first occurrence of “old” with “new” on every line Using markers and buffers Command Description mf set marker named ``f'' `f go to marker ``f'' ´f go to start of line containing marker ``f'' "s12yy copy 12 lines into buffer ``s'' "ty} copy text from cursor to end of paragraph into buffer ``t'' "ly1G copy text from cursor to top of file into buffer ``l'' "kd`f cut text from cursor up to marker ``f'' into buffer ``k'' "kp paste buffer ``k'' into text Options to the :set command Option all noautoindent autoprint noautowrite nobeautify directory=/var/preserve noerrorbells hardtabs=8 noignorecase nolisp nolist Effect list settings of all options prevent the preparation of structured program text. display the current line after each ex copy, move, or substitute command. do not automatically write the contents of the modified buffer to the current file when you give a next, rewind, tag, or ``!'' command, or a <Ctrl>^ (switch files) or <Ctrl>] (goto tag) command. do not discard all control characters except <Tab>, newline and formfeed from the input. set the default directory for the vi editing buffer. noedcompatible the absence of g and c suffixes on substitute commands is not remembered. do not precede error messages with a bell. set the boundaries on which terminal hardware tabs are set or on which tabs the system expands. do not map all uppercase characters to thier lowercase equivalent. do not autoindent to indent appropriately for LISP code. do not display the tabs and end of line characters
  • 5. magic mesg nomodelines nonumber nooptimize paragraphs=IPLPPPQPP LIpplpipnpb prompt redraw remap report=5 scroll=11 sections=NHSHH HUuhsh+c shell=/usr/bin/ksh) shiftwidth=8 noshowmatch noshowmode noslowopen tabstop=8 taglength=0 tags=tags /usr/lib/tags) term=value of shell TERM variable) timeout warn window=23 wrapscan wrapmargin=0 nowriteany with nomagic set, the number of regular expression metacharacters is greatly reduced, with only caret ``^'' and dollar sign ``$'' having special effects. In addition, the metacharacters tilde ``~'' and ampersand ``&'' in replacement patterns are treated as normal characters. prevents other users writing to your screen with the UNIX write command and scrambling your screen as you edit. disable the first five and last five lines of a file being read in to be interpreted as vi or ex commands. do not display output lines with their line numbers. allow the terminal perform automatic carriage returns when displaying more than one line of output. set the paragraph delimiters for the { and } operations. force ex input to be prompted for with a colon ``:''. simulate (using great amounts of output) an intelligent terminal on a dumb terminal. mapped characters are repeatedly tried until they are unchanged. For example, if o is mapped to O and O is mapped to I, o will map to I if remap is set, and to O if noremap is set. set the threshold for feedback from commands. the number of logical lines scrolled when <Ctrl>-D is received from a terminal input. set the section macros for the [[ and ]] operations. set the pathname of the shell forked for the shell escape ``!'' command, and by the shell command. set the width of a software tab stop, used in reverse tabbing with <Ctrl>-D when using autoindent to append text, and by the shift commands. when a ``)'' or ``}'' is typed, moves the cursor to the matching ``('' or ``{'' for one second if this matching character is on the screen. prevents the message ``INPUT MODE'' from being displayed on the lower right corner of the screen when insert mode is activated. enables the display of updates during inserts. expand tabs in the input file to be on n boundaries for the purposes of display. accept the first n characters in a tag name to be significant, but all others to be ignored. set a path of files to be used as tag files for the tag command. set the terminal type of the output device. set the milliseconds to wait for subsequent input characters. displays ``[No write since last change]'' before a shell escape command (!) if file has not been saved. set the number of lines in a text window. searches using the regular expressions in addressing wrap around past the end of the file. defines the margin for automatic insertion of newlines during text input. perform all checks normally made before write commands.
  • 6. Pasting Text using Put Often, when you delete or cut text, you may wish to reinsert it in another location of the document. The Put command will paste in the last portion of text that was deleted since deleted text is stored in a buffer. To use this command, place the cursor where you wish the deleted text to appear. Then use p to reinsert the text. If you are inserting a line or paragraph use the lower case p to insert on the line below the cursor or upper case P to place in on the line above the cursor. Copying Text with Yank If you wish to make a duplicate copy of existing text, you may use the yank and put commands to accomplish this function. Yank copies the selected text into a buffer and holds it until another yank or deletion occurs. Yank is usually used in combination with a word or line object such as the ones shown below: yw copies a word into a buffer (7yw copies 7 words) yy copies a line into a buffer (3yy will copy 3 lines) Once the desired text is yanked, place the cursor in the spot in which you wish to insert the text and then use the put command (p for line below or P for line above) to insert the contents of the buffer. Joining Lines Since vi does not use automatic word wrap, it is not unusual in editing lines to end up with lines that are too short and that might be improved if joined together. To do this, place your cursor on the first line to be joined and type J. As with other commands, you can precede J with a number to join multiple lines (4J joins 4 lines).