Created
January 2, 2013 13:15
-
-
Save anonymous/4434524 to your computer and use it in GitHub Desktop.
Emacs tweek of the modeline for Clojure development - the various modes appear as symbols on the mode line to conserve space and make Emacs look even more intriguing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defvar mode-line-cleaner-alist | |
`((auto-complete-mode . " α") | |
(yas-minor-mode . " γ") | |
(paredit-mode . " Φ") | |
(eldoc-mode . "") | |
(abbrev-mode . "") | |
(undo-tree-mode . " τ") | |
(volatile-highlights-mode . " υ") | |
(elisp-slime-nav-mode . " δ") | |
(nrepl-mode . " ηζ") | |
(nrepl-interaction-mode . " ηζ") | |
;; Major modes | |
(clojure-mode . "λ") | |
(hi-lock-mode . "") | |
(python-mode . "Py") | |
(emacs-lisp-mode . "EL") | |
(markdown-mode . "md")) | |
"Alist for `clean-mode-line'. | |
When you add a new element to the alist, keep in mind that you | |
must pass the correct minor/major mode symbol and a string you | |
want to use in the modeline *in lieu of* the original.") | |
(defun clean-mode-line () | |
(interactive) | |
(loop for cleaner in mode-line-cleaner-alist | |
do (let* ((mode (car cleaner)) | |
(mode-str (cdr cleaner)) | |
(old-mode-str (cdr (assq mode minor-mode-alist)))) | |
(when old-mode-str | |
(setcar old-mode-str mode-str)) | |
;; major mode | |
(when (eq mode major-mode) | |
(setq mode-name mode-str))))) | |
(add-hook 'after-change-major-mode-hook 'clean-mode-line) | |
;;; Greek letters - C-u C-\ greek ;; C-\ to revert to default | |
;;; ς ε ρ τ υ θ ι ο π α σ δ φ γ η ξ κ λ ζ χ ψ ω β ν μ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment