Created
May 3, 2014 18:46
-
-
Save KOBA789/aaebfa36494974b1627c to your computer and use it in GitHub Desktop.
Powerline for IMAGINE THE FUTURE.
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
| ;; -Powerline | |
| (defun git-branch-mode-line () | |
| (let* ((branch (replace-regexp-in-string | |
| "[\r\n]+\\'" "" | |
| (shell-command-to-string "git symbolic-ref -q HEAD"))) | |
| (mode-line-str (if (string-match "^refs/heads/" branch) | |
| (format " [%s]" (substring branch 11)) ""))) | |
| (propertize mode-line-str 'face 'mode-line-4-fg))) | |
| (line-number-mode t) | |
| (column-number-mode t) | |
| (setq-default mode-line-format | |
| '((:propertize " %m :" face mode-line-1-fg) | |
| (:propertize minor-mode-alist face mode-line-1-fg) | |
| (:propertize " " face mode-line-1-fg) | |
| (:propertize " %b " face mode-line-3-fg) | |
| (:eval (git-branch-mode-line)) | |
| (:propertize " %+ %Z" face mode-line-2-fg) | |
| (:propertize " %p " face mode-line-2-fg) | |
| (:propertize " %l" face mode-line-4-fg) | |
| (:propertize ":%c" face mode-line-4-fg) | |
| (:propertize " " display ((space :align-to (- right-fringe 21)))) | |
| (:propertize " IMAGINE THE FUTURE. " face mode-line-5-fg))) | |
| (set-face-attribute 'mode-line nil | |
| :foreground "color-56" :background "color-234" :box nil) | |
| (set-face-attribute 'mode-line-inactive nil | |
| :foreground "color-56" :background "color-234" :box nil) | |
| (defun make/set-face (face-name fg-color bg-color weight) | |
| (make-face face-name) | |
| (set-face-attribute face-name nil | |
| :foreground fg-color :background bg-color :box nil :weight weight)) | |
| (make/set-face 'mode-line-1-fg "color-54" "color-231" 'bold) | |
| (make/set-face 'mode-line-2-fg "color-231" "color-56" 'normal) | |
| (make/set-face 'mode-line-3-fg "color-231" "color-54" 'bold) | |
| (make/set-face 'mode-line-4-fg "color-99" "color-234" 'normal) | |
| (make/set-face 'mode-line-5-fg "color-231" "color-45" 'normal) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment