Toggle navigation
Calvin's Home
Archives
Categories
Tags
About
Vi Hints
Remove blank lines
:g/^$/d
g = all occurence, d = delete
Search and replace
Replace
foo
with
bar
:%s/foo/bar/g
%s = all lines, all occurence
:s/foo/bar/g
s = current line, all occurence
:5,12s/foo/bar/g
lines 5-12, all occurence
Prev
Archive
Next
2019-04-29
Hints
1
Vi
1
▲