Reverse sort lines in Vim
Vim provides sort
command for ordering lines in an ascending order, but what if you want to sort the lines in a reverse order?
Linux's tail
to the rescue!
First select the lines to be reversed in visual mode with V
(big V) then execute this Linux command from Vim's command prompt:
:'<,'>!tail -r
Tweet