 ;;
 ;; Built-in packages
 
+;; Handle ansi codes in compilation buffer
+(add-hook 'compilation-filter-hook #'doom|apply-ansi-color-to-compilation-buffer)
+
+
 ;; show typed keystrokes in minibuffer
 (defun doom|enable-ui-keystrokes ()  (setq echo-keystrokes 0.02))
 (defun doom|disable-ui-keystrokes () (setq echo-keystrokes 0))

  (add-to-list 'kill-buffer-query-functions #'doom|protect-fallback-buffer nil #'eq)
  (add-to-list 'kill-buffer-query-functions #'doom|protect-visible-buffer  nil #'eq)
  (add-hook 'after-change-major-mode-hook #'doom|highlight-non-default-indentation)
  (add-hook 'compilation-filter-hook #'doom|apply-ansi-color-to-compilation-buffer)
  (run-hook-wrapped 'doom-init-ui-hook #'doom-try-run-hook))

(add-hook 'emacs-startup-hook #'doom|init-ui)

;; line numbers in most modes
(add-hook! (prog-mode text-mode conf-mode) #'display-line-numbers-mode)

(defun doom|enable-line-numbers ()  (display-line-numbers-mode +1))
(defun doom|disable-line-numbers () (display-line-numbers-mode -1))

;; Emacs 26+ has native line number support, and will ignore nlinum. This is for
;; Emacs 25 users:
(def-package! nlinum
  ;; Line number column. A faster (or equivalent, in the worst case) line number
  ;; plugin than `linum-mode'.
