:%s/^\s*//g
EXPLAIN THIS BULLSHIT:
vim has sed-like regex recognition. This command tells vim to search (%s) for lines begining (^) with whitespace (\s), and include the rest of the whitespaces directly after the first one (*). Next, delete them (//). Now do this globally (g). By default, it will only match the first instance of the regex, g means "do this globally".
No comments:
Post a Comment