How to remove duplicate lines in VS Code

  1. In the search bar type: ^(.*)(\n\1)+$ then press the little downwards arrow and in the replace input field type: $1

(Make sure you have the regex option selected in the find and replace popup)

3. Press the “Replace all” button

There you go! You should have all duplicates removed now!

--

--

--

26K+ Reads ✍🏼 Ex-Amazon, Ex-Startup Founder, Ex-Nike 👨‍💻 Passionate about ML, Software and giving people genuine value on Medium 👌 Views are all my own.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Fetch Maven Central info from the Command Line

Why Redux Doesn’t Work

How to add Vuex and Axios to your project

Tutorial ESP32 Door Lock 3in1 Fingerprint Keypad 4x3 and RFID PN532

Tutorial ESP32 Door Lock 3in1 Fingerprint Keypad 4x3 and RFID PN532

A Playground to become an advance JavaScript developer

My Plans & Goals For 2021

Deploying React App (with environment variables) on Red Hat OpenShift

Making Complex Builds Easy with Gulp

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Nicolas Carmont

Nicolas Carmont

26K+ Reads ✍🏼 Ex-Amazon, Ex-Startup Founder, Ex-Nike 👨‍💻 Passionate about ML, Software and giving people genuine value on Medium 👌 Views are all my own.

More from Medium

Google Foobar Challenge’s Tips and Hints

Don’t be scared of the regex

How to reduce lines of code [python]

Extensiones VS Code 2022