Shuffle, Sort, Reverse and Unique Lines in Sublime Text


This tip isn’t a show stopper, but you are bound to find this useful. It has to do with working with multiple lines of data or code. To test these three out, give yourself a few lines of code and select them all at once.


First we have Shuffle, which does exactly that, shuffling them into a random order.

Then we have Sort, which will alphabetize your lines.

Next we have Reverse which swaps the previously sorted lines, or just flips any code in the reverse order.

Finally, we have Unique which removes any duplicate lines of code – helpful for when working with image datasets that could contain duplicate images.

All of these commands are available via the Command Palette, so select some text and try them out today!