Remove Single Line HTML Comments using VIM

8 August 2008
by Billy Czajkowska

If you want to remove all HTML style comments (ones that span a single line), use the following VIM commands :
Check for all single line HTML comments in VIM :-
:g/<!– .{-}–>/p
Typing the above displays all lines that contain HTML style comments
To remove all the comments use the following VIM command :-
:%s/<!– .{-}–>//g
 

Our Latest News