Merge pull request #19 from trishume/master

Fix powerline separators and make them configurable
This commit is contained in:
Sylvain Benner 2014-10-18 21:20:57 -04:00
commit c6acb276bf

View file

@ -380,9 +380,11 @@ inserted in the buffer (if it is not read-only)."
(setq spacemacs-mode-line-flycheckp nil)
(setq spacemacs-mode-line-flycheckp t)))
(evil-leader/set-key "tmf" 'spacemacs/mode-line-flycheck-info-toggle)
(setq-default powerline-height 17)
(setq-default powerline-default-separator 'wave)
(setq-default mode-line-format '("%e" (:eval
(let* ((active (eq (frame-selected-window) (selected-window)))
(line-face (if active 'mode-line 'mode-line-inactive))
(face1 (if active 'powerline-active1 'powerline-inactive1))
(face2 (if active 'powerline-active2 'powerline-inactive2))
(state-face (if active (spacemacs/current-state-face) face2))
@ -393,24 +395,30 @@ inserted in the buffer (if it is not read-only)."
(eq 'running flycheck-last-status-change))))
(vc-face (if (or flycheckp spacemacs-mode-line-minor-modesp)
face1 nil))
(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 (append (list
;; window number
;; (powerline-wave-left state-face face1)
;; (funcall separator-left state-face face1)
(powerline-raw (spacemacs/window-number) state-face)
(powerline-wave-right state-face nil)
(funcall separator-right state-face line-face)
;; evil state
;; (powerline-raw evil-mode-line-tag state-face)
;; (powerline-wave-right state-face nil)
;; (funcall separator-right state-face nil)
;; buffer name
(powerline-raw "%*" nil 'l)
(powerline-buffer-size nil 'l)
(powerline-buffer-id nil 'l)
(powerline-raw " " nil)
;; major mode
(powerline-wave-left nil face1)
(funcall separator-left line-face face1)
(powerline-major-mode face1 'l)
(powerline-raw " " face1)
(powerline-wave-right face1 nil))
(funcall separator-right face1 line-face))
;; flycheck
(if flycheckp
(list
@ -424,9 +432,9 @@ inserted in the buffer (if it is not read-only)."
;; separator between flycheck and minor modes
(if (and flycheckp spacemacs-mode-line-minor-modesp)
(list
(powerline-wave-left nil face1)
(funcall separator-left line-face face1)
(powerline-raw " " face1)
(powerline-wave-right face1 nil)))
(funcall separator-right face1 line-face)))
;; minor modes
(if spacemacs-mode-line-minor-modesp
(list
@ -435,19 +443,19 @@ inserted in the buffer (if it is not read-only)."
(powerline-raw " " nil)))
;; version control
(if (or flycheckp spacemacs-mode-line-minor-modesp)
(list (powerline-wave-left (if vc-face nil face1) vc-face)))
(list (funcall separator-left (if vc-face line-face face1) vc-face)))
(list
(powerline-vc vc-face)
(powerline-raw " " vc-face)
(powerline-wave-right vc-face face2))))
(funcall separator-right vc-face face2))))
(rhs (list
(powerline-wave-right face2 face1)
(funcall separator-right face2 face1)
(powerline-raw " " face1)
(powerline-raw "%l:%2c" face1 'r)
(powerline-wave-left face1 nil)
(funcall separator-left face1 line-face)
(powerline-raw " " nil)
(powerline-raw "%p" nil 'r)
(powerline-chamfer-left nil face1)
(powerline-chamfer-left line-face face1)
;; display hud only if necessary
(let ((progress (format-mode-line "%p")))
(if (string-match "\%" progress)