From 069c3e2a734166a7a0f6c1528e6bee0a5e75fc11 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 30 Jan 2023 11:25:48 -0500 Subject: Add shell and compilation mode ANSI coloriazation hooks Disabled because the compilation mode one is too sketchy, but handy to have around to manually evaluate when working with shitty build tools. --- emacs/.emacs.d/init.el | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/emacs/.emacs.d/init.el b/emacs/.emacs.d/init.el index 6da1cc1..c3b75e4 100644 --- a/emacs/.emacs.d/init.el +++ b/emacs/.emacs.d/init.el @@ -535,6 +535,18 @@ (add-hook 'doc-view-mode-hook 'my-doc-view-hook) (add-hook 'pdf-view-mode-hook 'my-doc-view-hook) +;; Shell + +(add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on) +(add-to-list 'comint-output-filter-functions 'ansi-color-process-output) + +;; Compilation + +(defun colorize-compilation-buffer () + (let ((inhibit-read-only t)) + (ansi-color-apply-on-region (point-min) (point-max)))) + +;; (add-hook 'compilation-filter-hook 'colorize-compilation-buffer) ;; Associations -- cgit v1.2.1