How can I remove duplicate lines in Visual Studio Code?

前端 未结 8 1233
轻奢々
轻奢々 2020-12-12 09:28

Say you have the following text:

abc
123
abc
456
789
abc
abc

I want to remove all \"abc\" lines and just keep one. I don\'t mind sorting. T

8条回答
  •  隐瞒了意图╮
    2020-12-12 09:54

    Here is a very interesting extension: Transformer

    Features:

    • Unique Lines
    • Unique Lines As New Document
    • Filter Lines
    • Filter Lines As New Document
    • Sort Lines
    • Sort Lines By Length
    • Align To Cursor
    • Align CSV
    • Compact CSV
    • Copy To New Document
    • Select Lines
    • Lines As JSON
    • Trim Lines
    • Count Duplicate Lines As New Document
    • Macros

    For removing duplicate lines:

    • Removes duplicate lines from the document

    • Operates on selection or current block if no selection

    I haven't played with it much besides the "Unique Lines" command but it seems quite nicely done (including attempting a macro recorder!).

提交回复
热议问题