I want to remove blank and commented lined at one time. I already found the similar question regarding removing blank lines, so for blank lines I use:
:g/^$/d
and for commented lines:
:g/^#/d
I’m curious is there any way to merge these regex in one? Something like
:g/^[$#]/d
but obviously it doesn’t work in vim.
You can try this command:
Or
$matches literal ‘$’ inside […] (type:help /$for help)\|is for alternation\vis very magic (minimal backslash escape)