I have a file in the following format
--Some-XYZ-code ;
--Somemore--xyz--code;
COMMENT = " THIS IS A DEMO"
--somemore--code;
--somemore--code;
I want to put an semicolon at the end of line COMMENT, keeping the rest of the line intact.
Try this:
:g/^COMMENT/ normal A;
For every line that matches COMMENT
at the beginning enter in Insert Mode at the end of the line and append a semicolon.
Explanation: :g
selects every line that matches following pattern ^COMMENT
and does the action after last slash, normal A;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With