Emacs Sort Lines

Get In Order

Sorting lines in Emacs is pretty simple. Press Ctrl-spc to set the mark on the first line. Navigate down to the last line you want sorted. The selected range should be highlighted.

Press M-x key and the focus will jump to the minibuffer, then type sort-lines:

M-x sort-lines

Emacs will take of the rest. Your selection will instantly be sorted.

. . .