Snippets are tiny notes I've collected for easy reference.
Numbering lines in emacs
A few ways to add line numbers in emacs:
M-x linum-mode <RET>
will annotate the buffer with line numbers. (These numbers are decoration, in the "fringe" rather than part of the buffer text.) Also see Linum Plus.C-x r N
will insert line numbers into the selected region. (These numbers are content, they are added to the text of the buffer.)M-x line-number-mode <RET>
show the line number of the current line in the modeline.C-x l
will report (in the minibuffer) the total number of lines in the current buffer as well as the number of lines before and after the cursorM-x what-line <RET>
will report (in the minibuffer) the current line number
Also see emacswiki.org/LineNumbers.
Published 13 May 2013
Snippets are tiny notes I've collected for easy reference.