Very simply, I need to remove lines in a file that end with a :.

I've tried many things but have not managed it. I cannot even find the right search pattern.

example line:


I would like to delete the line since it ends with a :.

Thanks for the help

1 Answer 1


Unless the character is special, the command :g/:$/d (abbreviated from :global/:$/delete) should do it.

Perhaps you meant the line ends with ":", in which case simply change /:$/ to /":"$/ in either command.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.