How can I sort by frequency without deleting any?
one two one
one one two
The output of the standard sort-by-frequency
:%!sort | uniq -c | sort -nr is
2 one 1 two
It has deleted all the copies of the line (bc of
uniq), and the spaces and numbers are not desired in the output.
So how can I sort by frequency and keep all lines in VIM?