Demovi
Demovi
A Tab Character follows and at the end of every line is the end of the line or new
line character
Adding text:
------------
cut/copy paste:
---------------
esc p can be used to paste the deleted or copied line(s) next to the current line
esc P can be used to paste the deleted or copied line(s) above the current line
Finding Text:
-------------
Press the esc key followed by / and when you see / in the last line, specify the
text that needs to be found
line5 --> The search will proceed in the forward direction and you will go to
the line with next match for "line5"
n --> Pressing n will continue the search in the forward direction and
you will go to the line with the next match for "line5"
N --> Pressing N will continue the search in the backward direction and
you will go to the line with the previous match for "line5"
Press the esc key followed by : character and when you see a : character in the
last line, execute the following commands.
%s/line5/LINE5 --> This will replace the first occurrence of "line5" with "LINE5"
in the different lines. The second and subsequent occurrences of this pattern in
the different lines will not be replaced.
%s/line5/LINE5/g --> With the global switch, this will replace each and every
occurrence of "line5" with "LINE5"
Session Customization:
----------------------
Press esc key followed by : and when you see a : character in the last line, the
following commands can be executed for the purpose specified against them.
set list --> To see the Non-Printable Characters like the Tab and the new line
characters
set nolist --> To go back to the default setting where we will not see the Non-
printable characters like Tab and the newline characters
Press the esc key followed by : and when you see a : character in the last line,
the following commands can
be executed.
w --> Write (save) the file. You will still remain in the vi Editor session.
wq --> Write (save) the file and Quit (exit). You will exit out of the vi Editor
session and return to the Command Prompt
q --> Quit without saving the changes
q! --> Quit forcefully without saving the changes
wq! --> Forcefully Write and Quit with saving the changes