vim - Replace end of line for lines that start with a particular pattern -
i have file in following format
--some-xyz-code ; --somemore--xyz--code; comment = " demo" --somemore--code; --somemore--code;
i want put semicolon @ end of line comment, keeping rest of line intact.
try this:
:g/^comment/ normal a;
for every line matches comment
@ beginning enter in insert mode @ end of line , append semicolon.
explanation: :g
selects every line matches following pattern ^comment
, action after last slash, normal a;
Comments
Post a Comment