Skip to content
| Marketplace
Sign in
Visual Studio Code>Formatters>Remove Duplicate LinesNew to Visual Studio Code? Get it now.
Remove Duplicate Lines

Remove Duplicate Lines

marhaendev

|
4 installs
| (0) | Free
Quickly remove duplicate lines from selected text or document.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Remove Duplicate Lines

A simple yet powerful VS Code extension that cleans up your code by removing consecutive duplicate lines. Ideally used for cleaning up logs, lists, or messy formatting where multiple empty lines or repeated text occur.

Features

  • Consecutive Deduplication: Only removes a line if it is identical to the one immediately before it.
  • Smart Formatting: Collapses multiple empty lines into a single empty line (preserves structure).
  • Selection Mode: Works on selected text.
  • Document Mode: Works on the entire file if no text is selected.
  • Reporting: Shows the count of removed lines in the status bar.

Usage

  1. Select the text you want to clean (or place cursor anywhere to process the whole file).
  2. Right Click and choose "Remove Duplicate Lines".
  3. Alternatively: Open Command Palette (Ctrl+Shift+P) and type Remove Duplicate Lines.

Example

Before:

Item A

Item B


Item B
Item C

After:

Item A

Item B
Item C

Credits

  • Author: MarhaenDev (aka Hasan Askari)
  • Website: hasanaskari.com
  • Email: hasanaskari.id@gmail.com
  • Homepage: vsix.hasanaskari.com
  • Repository: github.com/marhaendev/vsix-remove-duplicate-lines

License

MIT

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft