Last Updated: February 25, 2018
·
70.49K
· kevinsuttle

Extract Unique Lines in Sublime Text 2

Here's a handy tip in Sublime Text 2 for removing duplicated lines.
Select the text you have, or suspect you have, duplicates in.

Picture

Then, you can go to Edit > Permute Lines > Unique.

Picture

Bam.

Picture

6 Responses
Add your response

And for the shortcut for this is a custom combination to be added to your user keymap:
{ "keys": ["f8"], "command": "permute_lines", "args": {"operation": "unique"} }

over 1 year ago ·

Lots of thanks Kevin! Your tip saved my day!!!

over 1 year ago ·

Hey this is cool, how would we go about removing duplicates if we have columns?

e.g.

id|url
id|url
id|url

over 1 year ago ·

@Mycamerafocus: I don't think you can. Focus can only be on one pane at a time.

over 1 year ago ·

Thanks God.

over 1 year ago ·

So, somebody asked about finding the duplicates. Don't forget you can use a Unix command, 'uniq -d' to print those out. (Sort the file, first.)

over 1 year ago ·