Search code examples
emacs

How to auto run the `M-x linum-mode` to display line number


I have installed the package to display line number in emacs. However, each time I have to manually call M-x linum-mode to trigger this function.

Is there a way that I can modify my .emacs file and make it called automatically?

Thank you

; .emacs
(require 'linum)

Solution

  • It should be sufficient to add

    (global-linum-mode 1)
    

    to your .emacs file.

    Then linum-mode will start as soon as you open a file.