aboutsummaryrefslogtreecommitdiffstats
path: root/_emacs.d/personal/30-linum.el
diff options
context:
space:
mode:
Diffstat (limited to '_emacs.d/personal/30-linum.el')
-rw-r--r--_emacs.d/personal/30-linum.el66
1 files changed, 66 insertions, 0 deletions
diff --git a/_emacs.d/personal/30-linum.el b/_emacs.d/personal/30-linum.el
new file mode 100644
index 0000000..8ce1571
--- /dev/null
+++ b/_emacs.d/personal/30-linum.el
@@ -0,0 +1,66 @@
+;;; ~/.emacs.d/personal/30-linum.el --- Configure linum-mode
+;;
+;; -*- mode: emacs-lisp -*-
+;; vim: set ts=8 sw=2 tw=0 fenc=utf-8 ft=lisp:
+;;
+;; Credits:
+;; [1] https://stackoverflow.com/a/3879664/4856091
+;; [2] https://github.com/redguardtoo/emacs.d - lisp/init-linum-mode.el
+;;
+;; Aaron LI
+;; 2016-02-24
+;;
+
+;;; Commentary:
+;; Configure linum-mode for Emacs.
+
+;;; Code:
+
+;; Turn on `linum-mode' globally
+(global-linum-mode t)
+
+;; Inhibit `linum-mode' for following specified modes
+(setq linum-mode-inhibit-modes-list '(eshell-mode
+ shell-mode
+ dictionary-mode
+ erc-mode
+ browse-kill-ring-mode
+ etags-select-mode
+ dired-mode
+ help-mode
+ ;text-mode
+ fundamental-mode
+ jabber-roster-mode
+ jabber-chat-mode
+ inferior-js-mode
+ inferior-python-mode
+ inferior-scheme-mode
+ twittering-mode
+ compilation-mode
+ weibo-timeline-mode
+ woman-mode
+ Info-mode
+ calc-mode
+ calc-trail-mode
+ comint-mode
+ inf-ruby-mode
+ gud-mode
+ org-mode
+ vc-git-log-edit-mode
+ log-edit-mode
+ term-mode
+ w3m-mode
+ speedbar-mode
+ mu4e-main-mode
+ mu4e-headers-mode
+ mu4e-view-mode
+ gnus-group-mode
+ gnus-summary-mode
+ gnus-article-mode
+ calendar-mode))
+(defadvice linum-on (around linum-on-inhibit-for-modes)
+ "Stop the load of linum-mode for some major modes."
+ (unless (member major-mode linum-mode-inhibit-modes-list)
+ ad-do-it))
+(ad-activate 'linum-on)
+