Laman

totorial vi editor

for make vi editor:

cut line example:
:1,5d ;cut line 1 s/d 5
:1:$d ;cut line 1 s/d end



copy lines example:
:2,4y ;copy line 2 upto 4
:54y ;copy line 54 only

if copy to another file:
: e /path/file
press p

replace example:
:4,5s/^AB/#/g ;line 4 to 5 front AB replace to #
:4,10s/^#//g ;line 4 to 10 front # remove char