Grimoire-
Command
.es

GNU+Linux command memo

Vim sort and deduplicate lines

Trier et dédupliquer des lignes dans vim. Supprimer les doublons.

:%sort (1)
:%sort -u (2)
:%sort! (3)
:%!sort -u (4)
1 sort all the lines in lexicographical order (a-z) ; other ranges can replace the %
2 sort all lines and undup (remove duplicate lines)
3 sort in reverse order
4 sort using an external sort command