aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tom Willemse2025-07-07 14:56:32 -0700
committerGravatar Tom Willemse2025-07-07 14:56:32 -0700
commit75fe56293a07c1d260c948116cd1585af3d64f2b (patch)
treea03729cd909230f78e51e9b12f728ff86432706c
parente562026ba61da58d994ede4662b9f2d0319cc684 (diff)
downloademacs-config-75fe56293a07c1d260c948116cd1585af3d64f2b.tar.gz
emacs-config-75fe56293a07c1d260c948116cd1585af3d64f2b.zip
oni-core: Add color to the unique part of a buffer name
This only applies to buffer lists like ‘switch-buffer’, ‘ibuffer’, and the like, not to the mode-line. This should help make it easier to distinguish which parts are special when more than one buffer with the same name is open.
-rw-r--r--oni-core.el13
1 files changed, 13 insertions, 0 deletions
diff --git a/oni-core.el b/oni-core.el
index 34725b6..c94bb6b 100644
--- a/oni-core.el
+++ b/oni-core.el
@@ -551,5 +551,18 @@ which normally have their errors suppressed."
;; removed along with the other whitespace.
(setq cycle-spacing-actions '((just-one-space -) (delete-all-space -) restore))
+;;; Colorize the unique part of buffers
+
+(defun oni-core-colored-post-forward-angle-brackets (base extra-strings)
+ "Return BASE<EXTRA-STRINGS> with the second part colorized.
+This does the same thing as setting ‘uniquify-buffer-name-style' to
+‘post-forward-angle-brackets', except that it colorizes the unique part
+of the buffer name."
+ (concat base
+ (propertize (concat "<" (mapconcat #'identity extra-strings "/") ">")
+ 'face '(:foreground "#72f1f1"))))
+
+(setq uniquify-buffer-name-style 'oni-core-colored-post-forward-angle-brackets)
+
(provide 'oni-core)
;;; oni-core.el ends here