Browse files

Tweak powerline theme and add a flycheck status icon.

  • Loading branch information...
1 parent e443ad8 commit f2a1d2f4946b0efcf9a8bbf464c7fc0c32f6da5b @bodil committed Feb 18, 2014
Showing with 90 additions and 65 deletions.
  1. +88 −0 bodil-powerline.el
  2. +0 −63 bodil-theme.el
  3. +1 −0 init.el
  4. +1 −2 themes/bclues-theme.el
View
88 bodil-powerline.el
@@ -0,0 +1,88 @@
+;;; bodil-powerline-el -- Modeline fashion
+
+(package-require 'powerline)
+(require 'bodil-flycheck)
+(require 'flycheck)
+
+(defun powerline-nyan-theme ()
+ (interactive)
+ (setq-default mode-line-format
+ '("%e"
+ (:eval
+ (let* ((active (powerline-selected-window-active))
+ (mode-line (if active 'mode-line 'mode-line-inactive))
+ (face1 (if active 'powerline-active1
+ 'powerline-inactive1))
+ (face2 (if active 'powerline-active2
+ 'powerline-inactive2))
+ (error-face '((t . (:foreground "#f44"))))
+ (warning-face '((t . (:foreground "#f94"))))
+ (info-face '((t . (:foreground "#ff4"))))
+ (all-clear-face '((t . (:foreground "#4f4"))))
+ (separator-left
+ (intern (format "powerline-%s-%s"
+ powerline-default-separator
+ (car powerline-default-separator-dir))))
+ (separator-right
+ (intern (format "powerline-%s-%s"
+ powerline-default-separator
+ (cdr powerline-default-separator-dir))))
+ (lhs (list
+ (powerline-raw "%*%*" nil 'l)
+ (powerline-buffer-id nil 'l)
+
+ (when (and (boundp 'which-func-mode) which-func-mode)
+ (powerline-raw which-func-format nil 'l))
+
+ (powerline-raw " ")
+ (funcall separator-left mode-line face1)
+
+ (when (boundp 'erc-modified-channels-object)
+ (powerline-raw erc-modified-channels-object
+ face1 'l))
+
+ (powerline-major-mode face1 'l)
+ (powerline-process face1)
+ (powerline-minor-modes face1 'l)
+ (powerline-narrow face1 'l)
+
+ (powerline-raw " " face1)
+ (funcall separator-left face1 face2)
+
+ (powerline-vc face2 'r)))
+ (rhs (list
+ (powerline-raw global-mode-string face2 'r)
+
+ (funcall separator-right face2 face1)
+
+ (powerline-raw "%4l" face1 'l)
+ (powerline-raw ":" face1 'l)
+ (powerline-raw "%3c" face1 'r)
+
+ (funcall separator-right face1 mode-line)
+ (powerline-raw " ")
+ (powerline-raw
+ (cond ((flycheck-has-current-errors-p 'error)
+ "\u26d4")
+ ((flycheck-has-current-errors-p 'warning)
+ "\u2691")
+ ((flycheck-has-current-errors-p 'info)
+ "\u2689")
+ (t "\u263b"))
+ (cond ((flycheck-has-current-errors-p 'error)
+ error-face)
+ ((flycheck-has-current-errors-p 'warning)
+ warning-face)
+ ((flycheck-has-current-errors-p 'info)
+ info-face)
+ (t all-clear-face)) 'r)
+ (powerline-raw " ")
+
+ (powerline-raw (nyan-create)))))
+ (concat
+ (powerline-render lhs)
+ (powerline-fill face2 (powerline-width rhs))
+ (powerline-render rhs)))))))
+(powerline-nyan-theme)
+
+(provide 'bodil-powerline)
View
63 bodil-theme.el
@@ -222,67 +222,4 @@
(defadvice emacs-lisp-mode (after elisp-rename-modeline activate)
(setq mode-name "ELisp"))
-;; Powerline
-(package-require 'powerline)
-(defun powerline-nyan-theme ()
- (interactive)
- (setq-default mode-line-format
- '("%e"
- (:eval
- (let* ((active (powerline-selected-window-active))
- (mode-line (if active 'mode-line 'mode-line-inactive))
- (face1 (if active 'powerline-active1
- 'powerline-inactive1))
- (face2 (if active 'powerline-active2
- 'powerline-inactive2))
- (separator-left
- (intern (format "powerline-%s-%s"
- powerline-default-separator
- (car powerline-default-separator-dir))))
- (separator-right
- (intern (format "powerline-%s-%s"
- powerline-default-separator
- (cdr powerline-default-separator-dir))))
- (lhs (list
- (powerline-raw "%*%*" nil 'l)
- (powerline-buffer-id nil 'l)
-
- (when (and (boundp 'which-func-mode) which-func-mode)
- (powerline-raw which-func-format nil 'l))
-
- (powerline-raw " ")
- (funcall separator-left mode-line face1)
-
- (when (boundp 'erc-modified-channels-object)
- (powerline-raw erc-modified-channels-object
- face1 'l))
-
- (powerline-major-mode face1 'l)
- (powerline-process face1)
- (powerline-minor-modes face1 'l)
- (powerline-narrow face1 'l)
-
- (powerline-raw " " face1)
- (funcall separator-left face1 face2)
-
- (powerline-vc face2 'r)))
- (rhs (list
- (powerline-raw global-mode-string face2 'r)
-
- (funcall separator-right face2 face1)
-
- (powerline-raw "%4l" face1 'l)
- (powerline-raw ":" face1 'l)
- (powerline-raw "%3c" face1 'r)
-
- (funcall separator-right face1 mode-line)
- (powerline-raw " ")
-
- (powerline-raw (nyan-create)))))
- (concat
- (powerline-render lhs)
- (powerline-fill face2 (powerline-width rhs))
- (powerline-render rhs)))))))
-(powerline-nyan-theme)
-
(provide 'bodil-theme)
View
1 init.el
@@ -88,6 +88,7 @@
'(bodil-defuns
bodil-session
bodil-theme
+ bodil-powerline
bodil-nav
bodil-editing
bodil-snippets
View
3 themes/bclues-theme.el
@@ -122,7 +122,7 @@
'(mode-line-emphasis ((t ( :weight bold ))))
'(mode-line-buffer-id ((t ( :box nil :weight bold ))))
'(mode-line-inactive ((t (:foreground "#555555" :background "#111111" :box nil :weight light :inherit (mode-line) ))))
- '(mode-line ((t (:foreground "#777777" :background "#111111" :box nil :height 85 :inherit (variable-pitch) ))))
+ '(mode-line ((t (:foreground "#777777" :background "#111111" :box nil :height 120 :inherit (variable-pitch) ))))
'(isearch ((t (:foreground "#99ccee" :background "#444444" ))))
'(isearch-fail ((t ( :background "#ffaaaa" ))))
'(lazy-highlight ((t ( :background "#77bbdd" ))))
@@ -151,7 +151,6 @@
'(diff-file-header ((t (:background "#362145"))))
'(diff-context ((t (:foreground "#E0E4CC"))))
'(diff-hunk-header ((t (:background "#242130"))))
-
)
;; Rainbow delimiters

0 comments on commit f2a1d2f

Please sign in to comment.