# Sort Text Lines with VIM

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1694064439873/25abe3a0-7872-4b83-88e5-76ff69a29ea8.png align="center")

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.
