how to replace multiple leading space, each space with a specific char, in vscode? FROM:
abcd
bcd
cd
d
TO:
abcd
_bcd
__cd
___d
CodePudding user response:
To do it "interactively":
Find: ^\s|(?<=_)\s
Replace: _
- Enter those find/replace in the Find widget first.
- Select the lines you want to work on.
- Enable the
Find in Selection
option on the Find widget. - Ctrl Alt Enter will progressively add the underscores.