commit f70cc46deac077ca1be052518426ce31b1081eea parent ef2cc7b50631b1c74b761b0b6f564eca044fbe97 Author: Vincent Demeester <vincent@sbr.pm> Date: Fri, 31 Jul 2020 18:53:52 +0200 tools/emacs: add color-identifiers-mode Signed-off-by: Vincent Demeester <vincent@sbr.pm> Diffstat:
M | tools/emacs/config/config-editing.el | | | 19 | +++++++++++++++++++ |
M | users/vincent/dev/emacs.nix | | | 1 | + |
2 files changed, 20 insertions(+), 0 deletions(-)
diff --git a/tools/emacs/config/config-editing.el b/tools/emacs/config/config-editing.el @@ -30,6 +30,25 @@ (sp-local-pair "`" "'" :when '(sp-in-string-p sp-in-comment-p)))) ;; -UseSmartParens +(use-package color-identifiers-mode + :commands (color-identifiers-mode) + :config + (defun myfunc-color-identifiers-mode-hook () + (let ((faces '(font-lock-comment-face font-lock-comment-delimiter-face font-lock-constant-face font-lock-type-face font-lock-function-name-face font-lock-variable-name-face font-lock-keyword-face font-lock-string-face font-lock-builtin-face font-lock-preprocessor-face font-lock-warning-face font-lock-doc-face font-lock-negation-char-face font-lock-regexp-grouping-construct font-lock-regexp-grouping-backslash))) + (dolist (face faces) + (face-remap-add-relative face '((:foreground "" :weight normal :slant normal))))) + (face-remap-add-relative 'font-lock-keyword-face '((:weight bold))) + (face-remap-add-relative 'font-lock-comment-face '((:slant italic))) + (face-remap-add-relative 'font-lock-builtin-face '((:weight bold))) + (face-remap-add-relative 'font-lock-preprocessor-face '((:weight bold))) + (face-remap-add-relative 'font-lock-function-name-face '((:slant italic))) + (face-remap-add-relative 'font-lock-string-face '((:slant italic))) + (face-remap-add-relative 'font-lock-constant-face '((:weight bold)))) + (add-hook 'color-identifiers-mode-hook 'myfunc-color-identifiers-mode-hook) + :hook ((go-mode . color-identifiers-mode) + (js-mode . color-identifiers-mode) + (python-mode . color-identifiers-mode))) + ;; UseAggressiveIndent (use-package aggressive-indent :bind ("C-c e i" . aggressive-indent-mode) diff --git a/users/vincent/dev/emacs.nix b/users/vincent/dev/emacs.nix @@ -25,6 +25,7 @@ let avy bbdb beginend + color-identifiers-mode company company-emoji company-go