From ea20080f5ce3a4e7f87455308afc30d21d5a8a24 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Mon, 22 Dec 2025 14:39:56 -0800 Subject: oni-php: Add rainbow-identifiers mode --- oni-php/oni-php.el | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'oni-php') diff --git a/oni-php/oni-php.el b/oni-php/oni-php.el index 22e3ef5..e631d72 100644 --- a/oni-php/oni-php.el +++ b/oni-php/oni-php.el @@ -4,8 +4,8 @@ ;; Author: Tom Willemse ;; Keywords: local -;; Version: 2025.0415.154414 -;; Package-Requires: (php-mode oni-yasnippet oni-flycheck oni-company oni-hydra oni-smartparens ggtags fic-mode company-php rainbow-delimiters) +;; Version: 2025.1222.143742 +;; Package-Requires: (php-mode oni-yasnippet oni-flycheck oni-company oni-hydra oni-smartparens ggtags fic-mode company-php rainbow-delimiters rainbow-identifiers) ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by @@ -70,6 +70,13 @@ nil for some reason." (setq-local comment-auto-fill-only-comments t) (auto-fill-mode)) +(defun oni-php-set-rainbow-identifier-faces () + "Set the faces to override for ‘rainbow-identifiers-mode’." + (setq-local rainbow-identifiers-faces-to-override + '(font-lock-type-face php-property-name php-function-call-traditional + php-doc-variable-sigil php-method-call-traditional + php-variable-sigil php-variable-name))) + (defun oni-php-add-use (class) "Try to add a use statement for CLASS under point." (interactive (list (symbol-name (symbol-at-point)))) @@ -148,7 +155,9 @@ Otherwise call FUNC with ARGS. This is meant as advice around (add-hook 'php-mode-hook 'flycheck-mode) (add-hook 'php-mode-hook 'ggtags-mode) (add-hook 'php-mode-hook 'oni-php--auto-fill-mode) +(add-hook 'php-mode-hook 'oni-php-set-rainbow-identifier-faces) (add-hook 'php-mode-hook 'rainbow-delimiters-mode) +(add-hook 'php-mode-hook 'rainbow-identifiers-mode) (add-hook 'php-mode-hook 'smartparens-mode) (add-hook 'php-mode-hook 'subword-mode) (add-hook 'php-mode-hook 'yas-minor-mode) -- cgit v1.3-2-g0d8e