       :face highlight-face
       :skip-alternate t)
 
+    (spaceline-define-segment *buffer-encoding-abbrev
+      "The line ending convention used in the buffer."
+      (symbol-name buffer-file-coding-system)
+      :when (not (string-match-p "\\(utf-8\\|undecided\\)"
+                                 (symbol-name buffer-file-coding-system))))
+
     (spaceline-define-segment *major-mode
       (powerline-raw
        (concat

      :when (not (string-prefix-p "*" (buffer-name)))
      :skip-alternate t
      :tight t)

    (spaceline-define-segment *buffer-encoding-abbrev
      "The line ending convention used in the buffer."
      (symbol-name buffer-file-coding-system)
      :when (not (string-match-p "\\(utf-8\\|undecided\\)"
                                 (symbol-name buffer-file-coding-system))))

    (spaceline-define-segment *buffer-position
      "A more vim-like buffer position."

      :tight-right t)

    (spaceline-define-segment *env-version
      "Shows the environment version of a mode (e.g. pyenv for python or rbenv for ruby).
See `define-env-command!' to define one for a mode."
      narf--env-version
      :when narf--env-version
      :face other-face
      :skip-alternate t
      :tight-right t)


    (progn ;; search indicators
      (defface mode-line-count-face nil "")
      (make-variable-buffer-local 'anzu--state)
      (spaceline-define-segment *anzu
        "Show the current match number and the total number of matches. Requires
anzu to be enabled."
        (let ((here anzu--current-position)
              (total anzu--total-matched))
          (format " %s/%d%s "
                  (anzu--format-here-position here total)
                  total (if anzu--overflow-p "+" "")))
        :face (if active 'mode-line-count-face 'mode-line-inactive)
        :when (and (> anzu--total-matched 0) (evil-ex-hl-active-p 'evil-ex-search))
        :skip-alternate t
        :tight t)

      ;; TODO mode-line-iedit-face default face
      (spaceline-define-segment *iedit
        "Show the number of matches and what match you're on (or after). Requires
iedit."
        (let ((this-oc (iedit-find-current-occurrence-overlay))
              (length  (or (ignore-errors (length iedit-occurrences-overlays)) 0)))
          (format "%s/%s"
                  (save-excursion
                    (unless this-oc
                      (iedit-prev-occurrence)
                      (setq this-oc (iedit-find-current-occurrence-overlay)))
                    (if this-oc
                        ;; NOTE: Not terribly reliable
                        (- length (-elem-index this-oc iedit-occurrences-overlays))
                      "-"))
                  length))
        :when (bound-and-true-p iedit-mode)
        :face (if active 'mode-line-count-face 'mode-line-inactive)
        :skip-alternate t)

      (defface mode-line-substitute-face nil "")
      (spaceline-define-segment *evil-substitute
        "Show number of :s matches in real time."
        (let ((range (if evil-ex-range
                         (cons (car evil-ex-range) (cadr evil-ex-range))
                       (cons (line-beginning-position) (line-end-position))))
              (pattern (car-safe (evil-delimited-arguments evil-ex-argument 2))))
          (if pattern
              (format "%s matches"
                      (count-matches pattern (car range) (cdr range))
                      evil-ex-argument)
            " ... "))
        :when (and (evil-ex-p) (evil-ex-hl-active-p 'evil-ex-substitute))
        :face (if active 'mode-line-count-face 'mode-line-inactive)
        :skip-alternate t))

    (spaceline-define-segment *macro-recording
      "Show when recording macro"
