       :face highlight-face
       :skip-alternate t)
 
-    (defun narf--flycheck-count (state)
-      "Return flycheck information for the given error type STATE."
-      (let* ((counts (flycheck-count-errors flycheck-current-errors))
-             (errorp (flycheck-has-current-errors-p state))
-             (running (eq 'running flycheck-last-status-change))
-             (err (cdr (assq state counts))))
-        (when errorp (if running "?" err))))
-
-    (defface spaceline-flycheck-error
-      '((t (:foreground "#FC5C94" :distant-foreground "#A20C41")))
-      "Face for flycheck error feedback in the modeline.")
-    (defface spaceline-flycheck-warning
-      '((t (:foreground "#F3EA98" :distant-foreground "#968B26")))
-      "Face for flycheck warning feedback in the modeline.")
-    (defface spaceline-flycheck-info
-      '((t (:foreground "#8DE6F7" :distant-foreground "#21889B")))
-      "Face for flycheck info feedback in the modeline.")
-
-    (defvar narf--flycheck-err-cache nil "")
-    (defvar narf--flycheck-cache nil "")
-    (spaceline-define-segment *flycheck
-      "Persistent and cached flycheck indicators in the mode-line."
-      (or (and (or (eq narf--flycheck-err-cache narf--flycheck-cache)
-                   (memq flycheck-last-status-change '(running not-checked)))
-               narf--flycheck-cache)
-          (and (setq narf--flycheck-err-cache flycheck-current-errors)
-               (setq narf--flycheck-cache
-                     (let ((fe (narf--flycheck-count 'error))
-                           (fw (narf--flycheck-count 'warning))
-                           (fi (narf--flycheck-count 'info)))
-                       (concat
-                        (when fe (powerline-raw (format " ⚠%s " fe) 'spaceline-flycheck-error))
-                        (when fw (powerline-raw (format " ⚠%s " fw) 'spaceline-flycheck-warning))
-                        (when fi (powerline-raw (format " ⚠%s " fi) 'spaceline-flycheck-info)))))))
-      :when (and (bound-and-true-p flycheck-mode)
-                 (or flycheck-current-errors
-                     (eq 'running flycheck-last-status-change)))
-      :tight-left t))
+    (progn ;; flycheck
+      (defun narf--flycheck-count (state)
+        "Return flycheck information for the given error type STATE."
+        (let* ((counts (flycheck-count-errors flycheck-current-errors))
+               (errorp (flycheck-has-current-errors-p state))
+               (running (eq 'running flycheck-last-status-change))
+               (err (cdr (assq state counts))))
+          (when errorp (if running "?" err))))
+
+      (defface spaceline-flycheck-error
+        '((t (:foreground "#FC5C94" :distant-foreground "#A20C41")))
+        "Face for flycheck error feedback in the modeline.")
+      (defface spaceline-flycheck-warning
+        '((t (:foreground "#F3EA98" :distant-foreground "#968B26")))
+        "Face for flycheck warning feedback in the modeline.")
+      (defface spaceline-flycheck-info
+        '((t (:foreground "#8DE6F7" :distant-foreground "#21889B")))
+        "Face for flycheck info feedback in the modeline.")
+
+      (defvar narf--flycheck-err-cache nil "")
+      (defvar narf--flycheck-cache nil "")
+      (spaceline-define-segment *flycheck
+        "Persistent and cached flycheck indicators in the mode-line."
+        (or (and (or (eq narf--flycheck-err-cache narf--flycheck-cache)
+                     (memq flycheck-last-status-change '(running not-checked)))
+                 narf--flycheck-cache)
+            (and (setq narf--flycheck-err-cache flycheck-current-errors)
+                 (setq narf--flycheck-cache
+                       (let ((fe (narf--flycheck-count 'error))
+                             (fw (narf--flycheck-count 'warning))
+                             (fi (narf--flycheck-count 'info)))
+                         (concat
+                          (when fe (powerline-raw (format " ⚠%s " fe) 'spaceline-flycheck-error))
+                          (when fw (powerline-raw (format " ⚠%s " fw) 'spaceline-flycheck-warning))
+                          (when fi (powerline-raw (format " ⚠%s " fi) 'spaceline-flycheck-info)))))))
+        :when (and (bound-and-true-p flycheck-mode)
+                   (or flycheck-current-errors
+                       (eq 'running flycheck-last-status-change)))
+        :tight-left t
+        :skip-alternate t))
+
+    (spaceline-define-segment *hud
+      "A HUD that shows which part of the buffer is currently visible."
+      (powerline-hud highlight-face other-face 1)
+      :face other-face
+      :tight-right t))
 
   ;; Initialize modeline
   (spaceline-install

      :face highlight-face
      :skip-alternate t)

    (spaceline-define-segment *major-mode
      (powerline-raw
       (concat

      :skip-alternate t
      :tight-right t)

    (spaceline-define-segment *remote-host
      "Hostname for remote buffers."
      (concat "@" (file-remote-p default-directory 'host))
      :when (file-remote-p default-directory 'host))

    (spaceline-define-segment *buffer-modified
      (concat
       (when buffer-file-name
