Reputation: 334
Line1 starting after some initial space
Line2 starting after few initial space
Line3 starting after someother initial space
In Vim, i want to change some pattern not on all line, but per each line starting from non white-space character horizontally. Suppose on each line, right from L (first non space character in that line) i want to insert multiple space between each words.
Upvotes: 0
Views: 415
Reputation: 16938
Use this command for adding another space:
:%s/\v\w+\s/& /g
Explanation:
:s command
% entire file
/ delimiter
\v regex magic mode
\w+ at least one word character
\s a whitespace character
& replace match with itself plus a space
g match multiple times per line
Upvotes: 1