VSCode/Sublime how to select and remove all lines containing an occurrence

VSCode/Sublime how to select and remove all lines containing an occurrence

This is the first article in the series, of useful VSCode / Sublime commands. How many times did you try to edit a large file of text and wanted to format it in a fast and efficient way?

Did you know that modern code editors have many shortcuts that can save you a ton of time? This is just one of the massive time savers if you need to process big files of text or data, and you don’t want to write a script for it.

As VSCode and Sublime have most of the commands the same I will cover both editors with this articles.

Here is the sequence of command you need to perform in order to achieve the desired effect.

  • Select the text to check.
  • Ctrl/Cmd-Shift-L selects all occurrences.
  • Ctrl-I will select the entire line.
  • Delete or whichever other action you want to do with selected lines

1. Select the text to check.

2. Ctrl/Cmd-Shift-L selects all occurrences.

3. Ctrl/Cmd-I will select the entire line.

4. Delete or whichever other action you want to do with selected lines

I hope this helped and I have saved you some time.

Leave a Comment