module-solarized.el (4536B)
1 ;;; module-solarized.el --- solarized module for my emacs 2 3 ;; Author: Mark Feller <mark.feller@member.fsf.org> 4 5 ;; This file is not part of GNU Emacs. 6 7 ;; This file is free software; you can redistribute it and/or modify 8 ;; it under the terms of the GNU General Public License as published by 9 ;; the Free Software Foundation; either version 3, or (at your option) 10 ;; any later version. 11 12 ;; This file is distributed in the hope that it will be useful, 13 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 14 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 ;; GNU General Public License for more details. 16 17 ;; You should have received a copy of the GNU General Public License 18 ;; along with this file. If not, see <http://www.gnu.org/licenses/>. 19 20 ;;; Commentary: 21 22 ;;; Code: 23 24 (use-package solarized-theme 25 :config 26 (progn (setq solarized-emphasize-indicators nil 27 solarized-high-contrast-mode-line nil 28 solarized-scale-org-headlines nil 29 solarized-use-less-bold t 30 solarized-use-variable-pitch nil 31 solarized-distinct-fringe-background nil))) 32 33 (use-package all-the-icons 34 :demand 35 :init 36 (progn (defun -custom-modeline-github-vc () 37 (let ((branch (mapconcat 'concat (cdr (split-string vc-mode "[:-]")) "-"))) 38 (concat 39 (propertize (format " %s" (all-the-icons-octicon "git-branch")) 40 'face `(:height 1 :family ,(all-the-icons-octicon-family)) 41 'display '(raise 0)) 42 (propertize (format " %s" branch)) 43 (propertize " ")))) 44 45 (defun -custom-modeline-svn-vc () 46 (let ((revision (cadr (split-string vc-mode "-")))) 47 (concat 48 (propertize (format " %s" (all-the-icons-faicon "cloud")) 49 'face `(:height 1) 50 'display '(raise 0)) 51 (propertize (format " %s" revision) 'face `(:height 0.9))))) 52 53 (defvar mode-line-my-vc 54 '(:propertize 55 (:eval (when vc-mode 56 (cond 57 ((string-match "Git[:-]" vc-mode) (-custom-modeline-github-vc)) 58 ((string-match "SVN-" vc-mode) (-custom-modeline-svn-vc)) 59 (t (format "%s" vc-mode))))) 60 face mode-line-directory) 61 "Formats the current directory.")) 62 :config 63 (progn 64 ;; (setq-default mode-line-format 65 ;; (list 66 ;; evil-mode-line-tag 67 ;; mode-line-front-space 68 ;; mode-line-mule-info 69 ;; mode-line-modified 70 ;; mode-line-frame-identification 71 ;; mode-line-buffer-identification 72 ;; " " 73 ;; mode-line-position 74 ;; mode-line-my-vc 75 ;; mode-line-modes)) 76 ;; (concat evil-mode-line-tag) 77 )) 78 79 80 ;; (bind-keys ("C-c tl" . (lambda () (interactive) (load-theme 'solarized-light))) 81 ;; ("C-c td" . (lambda () (interactive) (load-theme 'solarized-dark)))) 82 83 (load-theme 'solarized-light) 84 85 (set-face-attribute 'mode-line nil 86 :background "#eee8d5" 87 :foreground "#657b83" 88 :box '(:line-width 4 :color "#eee8d5") 89 :overline nil 90 :underline nil) 91 92 (set-face-attribute 'mode-line-inactive nil 93 :background "#fdf6e3" 94 :foreground "#93a1a1" 95 :box '(:line-width 4 :color "#eee8d5") 96 :overline nil 97 :underline nil) 98 99 (define-minor-mode minor-mode-blackout-mode 100 "Hides minor modes from the mode line." 101 t) 102 103 (catch 'done 104 (mapc (lambda (x) 105 (when (and (consp x) 106 (equal (cadr x) '("" minor-mode-alist))) 107 (let ((original (copy-sequence x))) 108 (setcar x 'minor-mode-blackout-mode) 109 (setcdr x (list "" original))) 110 (throw 'done t))) 111 mode-line-modes)) 112 113 (global-set-key (kbd "C-c m") 'minor-mode-blackout-mode) 114 ;; ;; window dividers 115 ;; (window-divider-mode t) 116 ;; (setq window-divider-default-right-width 2) 117 118 ;; (set-face-attribute 'window-divider nil :foreground "#eee8d5") 119 ;; (set-face-attribute 'window-divider-first-pixel nil :foreground "#eee8d5") 120 ;; (set-face-attribute 'window-divider-last-pixel nil :foreground "#eee8d5") 121 122 (provide 'module-solarized) 123 124 ;;; module-solarized.el ends here