Categories
Linux

Vi Editor magics

Adding line number to a file with vi

open the file with vi editor

:%!nl

of-course there are other ways to do it with vi :)

Add empty line after every line with vi

:%s/\v(.*\n){1}/&\r

Remove white space at the beginning of a line with vi

:%le

Sorting lines with vi

:sort u

Leave a Reply

Your email address will not be published.

*