Emacs: Activate linum on prog-mode and text-mode

master
Pierre Neidhardt 2017-05-25 12:12:23 +02:00
parent 016a152ca0
commit 0a22167237
1 changed files with 4 additions and 1 deletions

View File

@ -68,7 +68,10 @@
(define-key mickey-minor-mode-map (kbd "C-x M-p") (lambda () (interactive) (narrow-to-page -1)))
;; Line numbers
(add-hook 'find-file-hook (lambda () (linum-mode 1)))
;; Adding to `find-file-hook' ensures it will work for every file, regardless of
;; the mode, but it won't work for buffers without files nor on mode change.
(add-hook 'prog-mode-hook 'linum-mode)
(add-hook 'text-mode-hook 'linum-mode)
;; Emacs-nox does not display a fringe after the linum: Setting linum-format in
;; linum-before-numbering-hook is not the right approach as it will change the
;; type of linum-format in the middle. See linum-update-window.