Sort numerically
The sort command :sort
in vim sorts by the string representation by default. For numbers this is weird. If you have 2, 12, and 1 on separate lines they end up sorted like this:
1
12
2
To sort them numerically you can pass the n
argument to the sort command, like this :sort n
which gives you what you want:
1
2
12
Tweet