               (- length (-elem-index this-oc iedit-occurrences-overlays))
             "-"))
         length))
-     'face (if active 'mode-line-count-face))))
+     'face (if active 'doom-modeline-count))))
 
 (defun *buffer-position ()
   "A more vim-like buffer position."
   (let ((start (window-start))
         (end (window-end))
         (pend (point-max)))
-    (if (and (= start 1)
-             (= end pend))
-        ":All"
-      (cond ((= start 1) ":Top")
-            ((= end pend) ":Bot")
-            (t (format ":%d%%%%" (/ end 0.01 pend)))))))
+    (propertize
+     (concat
+      " %l:%c :"
+      (if (and (= start 1)
+               (= end pend))
+          "All"
+        (cond ((= start 1) "Top")
+              ((= end pend) "Bot")
+              (t (format "%d%%%%" (/ end 0.01 pend))))))
+     'face (if active 'doom-modeline-alternate))))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 (defun doom-mode-line (&optional id)
   `(:eval
     (let* ((active (eq (selected-window) mode-line-selected-window))
-           (lhs (list (propertize " " 'display (if active mode-line-bar mode-line-inactive-bar))
-                      (*flycheck)
+           (lhs (list (propertize " "
+                                  'display
+                                  (pl/percent-xpm doom-modeline-height 100 0 100 0 3
+                                                  (face-attribute (if active 'doom-modeline-bar 'doom-modeline-inactive-bar) :background nil t)
+                                                  nil))
                       (*macro-recording)
                       (*selection-info)
                       (*anzu)
                       (*evil-substitute)
                       (*iedit)
                       " "
-                      (*buffer-path)
-                      (*buffer-name)
-                      " "
+                      ,(if (eq id 'scratch)
+                           '(*buffer-pwd)
+                         '(list (*buffer-path) (*buffer-name) " "))
                       (*buffer-state)
-                      ,(if (eq id 'scratch) '(*buffer-pwd))))
+                      (*flycheck)))
            (rhs (list (*buffer-encoding-abbrev)
                       (*vc)
-                      "  " (*major-mode) "  "
-                      (propertize
-                       (concat "(%l,%c) " (*buffer-position))
-                       'face (if active 'mode-line-2))))
+                      (*major-mode)
+                      (*buffer-position)))
            (middle (propertize
                     " " 'display `((space :align-to (- (+ right right-fringe right-margin)
                                                        ,(1+ (string-width (format-mode-line rhs)))))))))

;;       + s
;;       + powerline
;;       + projectile
;;       + DejaVu Mono for Powerline font <https://github.com/powerline/fonts>
;;   + OPTIONAL
;;       + evil-mode
;;       + anzu + evil-anzu
;;       + iedit and evil-multiedit
;;       + flycheck
;;
;; The only external functions used are:
;;  `doom-fix-unicode'  in core/core-defuns.el
;;  `doom/project-root' in core/defuns/defuns-projectile.el
;;
;; Both are simple, isolated functions and, besides projectile, has no other
;; dependencies.

(defvar mode-line-height 30
  "How tall the mode-line should be. This is only respected in GUI emacs.")

;; Load powerline only when uncompiled, in order to generate the xpm bitmaps for
;; the mode-line. This is the tall blue bar on the left of the mode-line.
;; NOTE Compile this file for a faster startup!
(eval-when-compile (require 'powerline))
;; FIXME Don't hardcode colors in
(defvar mode-line-bar          (eval-when-compile (pl/percent-xpm mode-line-height 100 0 100 0 3 "#00B3EF" nil)))
(defvar mode-line-eldoc-bar    (eval-when-compile (pl/percent-xpm mode-line-height 100 0 100 0 3 "#B3EF00" nil)))
(defvar mode-line-inactive-bar (eval-when-compile (pl/percent-xpm mode-line-height 100 0 100 0 3 nil nil)))

;; Custom faces
(defface mode-line-is-modified nil
  "Face for mode-line modified symbol")

(defface mode-line-2 nil
  "The alternate color for mode-line text.")

(defface mode-line-highlight nil
  "Face for bright segments of the mode-line.")

(defface mode-line-count-face nil
  "Face for anzu/evil-substitute/evil-search number-of-matches display.")

;; Git/VCS segment faces
(defface mode-line-vcs-info '((t (:inherit warning)))
  "")
(defface mode-line-vcs-warning '((t (:inherit warning)))
  "")

;; Flycheck segment faces
(defface doom-flycheck-error '((t (:inherit error)))
  "Face for flycheck error feedback in the modeline.")
(defface doom-flycheck-warning '((t (:inherit warning)))
  "Face for flycheck warning feedback in the modeline.")


;;

  (when buffer-file-name
    (propertize
     (f-dirname
      (let ((buffer-path (file-relative-name buffer-file-name (projectile-project-root)))
            (max-length (truncate (/ (window-body-width) 1.75))))
        (concat (projectile-project-name) "/"
                (if (> (length buffer-path) max-length)
