Sometimes ago, on SO, I've posted a solution to have a :global command which asks for confirmation before executing anything (:delete in your case): https://stackoverflow.com/a/46830106/15934
It's a little bit convoluted :D. It's shipped with my library plugin, and it can be used with
Note: unlike the :g/pattern/s/.*\n//c solution, ...
One way to achieve what you want to do is to use the :s command inside your :g command:
We know that we can delete a line, with a confirmation using the following substitution:
This will replace all the characters (.*) and the next end of line character (\n) with nothing, effectively deleting the line. The c flag at the end of the substitution ...