Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I enable line numbers (on the left) every time I open Emacs?

Tags:

emacs

I enable them by pressing: M-x linum-mode. How can I "translate" that into my.emacs file in order to enable it automatically every time I open EMACS?

like image 822
alexchenco Avatar asked Jan 09 '10 18:01

alexchenco


People also ask

How do I turn on line numbers in Emacs?

By default, Emacs displays the current line number of the point in the mode line. You can toggle this feature off or on with the command M-x line-number-mode , or by setting the variable line-number-mode .

How do I turn off line numbers in Emacs?

Instructions are in the file: place the file into the Emacs load-path and add (require 'linum-off) to ~/. emacs. This script turns off line numbering for the modes specified only.

How do you add lines in Emacs?

If you're running it in a terminal ( emacs -nw ), then it's M-x line-number-mode . M- is usually the Windows key, but may be Alt , or you can press Esc followed by x .


1 Answers

Drop (global-linum-mode t) into your .emacs if you want it for every buffer. Otherwise, you can add a function to the appropriate hook of modes you're interested in to enable it for just that mode.


You should really read though the manual like I suggested in the last question of yours that I answered. ;)

like image 100
Noufal Ibrahim Avatar answered Oct 08 '22 02:10

Noufal Ibrahim