DEV Community

Discussion on: Type less and save time with Vim's global command!

Collapse
 
moopet profile image
Ben Sinclair

I use this in Javascript to get rid of console.log lines.

I think it's a great reason people should stick to one command per line rather than chaining them with semi-colons :)

Collapse
 
rgaiken profile image
rgaiken

Same. I like to search first to see where I wrote the console statements (and ensure that they aren't inline with something important), then do :g//d (if you leave the search blank it'll just use whatever is in your search buffer)

Collapse
 
iggredible profile image
Igor Irianto

That's right, vim repeats the last search if we leave pattern blank (//)! Good call!

Collapse
 
iggredible profile image
Igor Irianto

Oh, nice!! I console.log quite a lot and didn't think of doing that. Good suggestion!
So glad you shared this 👍