conf-linum.el 946 B

123456789101112131415161718192021222324252627
  1. (require 'linum)
  2. (defcustom linum-disabled-modes-list '(eshell-mode wl-summary-mode compilation-mode org-mode text-mode dired-mode speedbar-mode nav ibuffer-mode direx:direx-mode)
  3. "* List of modes disabled when global linum mode is on"
  4. :type '(repeat (sexp :tag "Major mode"))
  5. :tag " Major modes where linum is disabled: "
  6. :group 'linum
  7. )
  8. (defun linum-on ()
  9. "* When linum is running globally, disable line number in modes defined in
  10. `linum-disabled-modes-list'. Changed by linum-off. Also turns off numbering in starred
  11. modes (except for *scratch*)"
  12. (unless (or (minibufferp) (member major-mode linum-disabled-modes-list)
  13. (and (not (eq (buffer-name) "*scratch*"))
  14. (string-match "*" (buffer-name))))
  15. (linum-mode 1)))
  16. (global-linum-mode 1) ; Show line numbers everywhere
  17. (column-number-mode 1)
  18. (line-number-mode 1)
  19. (setq linum-eager nil) ; Better linum performance
  20. (provide 'conf-linum)