Searching multiple strings in VI editor

Sunday, December 30, 2012 , , 0 Comments

Searching three strings at a time
/string1\|string2\|string3

Search and replace a string:
%s/source/target/g

How do merge two lines in command mode:
eg:
1
2

changes to
1 2

Below are the steps to perform the same:

Open the file in VI
Set the command mode
Go to line 1(not need to be at the end of the line.cursor can be anywhere)
Now press [SHIFT]+j

0 comments: