Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I know how to display line numbers (and columns) in the mode-line, but I'd like emacs to display the line numbers for all the lines on the left-hand side. I've seen this done in vim and other text editors. How do I do this for emacs?

share|improve this question
up vote 122 down vote accepted

M-x linum-mode (or global-linum-mode), and put (global-linum-mode t) in your ~/.emacs (or ~/.emacs.d/init.el) to enable it at startup.

share|improve this answer
Is there a way to do this with column numbers? – Topo Nov 24 '12 at 20:09
For any late readers: M-x column-number-mode is one way to display the current column your pointer is at. – monotux Mar 13 '14 at 11:42

Take a look here:

share|improve this answer
Just a link is not ideal for the SX format. – Prof. Falken Nov 15 '12 at 10:03

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.