Vim Tip: Sort Lines Alphabetically

Have a list that you need to alphabetize quickly? Vim has you covered. There’s a handy :sort command (:help sort for optional arguments) that will do just what it says on the box. All you have to do is select the lines in visual mode (v), and run :sort.

vim :sort

What sort of arguments does it support? The most common are probably ! and i, which reverse the sort order and ignore case, respectively. It supports some more advanced pattern-matching stuff, but I haven’t had cause to experiment with it yet.

  • Kaloyan Banev

    VIM is one of the most powerful IDEs. It is not as polished as the others, but it is extremely flexible and platform independent.

  • FredLuis

    Yes tree was there in MS-DOS and is there in Windows too.

  • Mary Solero

    That’s interesting tip.
    roofing milwaukee

  • Yvette Katerine

    You should now revoke any SSL certificates and issue new ones, in case they were leaked in an exploit of the bug. hudson roofing

  • Mary Solero

    Sounds interesting.
    cheap waterproofing