Sort Text Lines with VIM

To sort text lines with VIM you first select the lines you wish to sort with visual mode and then sort them. To execute this task follow the following steps:

  • Place the cursor on the first line you wish to sort.

  • Move the cursor down into the last line you wish to sort.

  • Press: Shift + ;

  • Write the word sort.

  • Press enter.

Now these lines should be sorted out in alphabetical order.