4

A bit long in the tooth, but still seems to work fine, highlight-sexp will do what you want. Move out of your inner if, it highlights the entire for block. Out again, the entire outer if. Out again, your function. Note that by default it highlights inside the "parens" of each scope.


3

(Thanks to @Lindydance) Here is what I am currently doing to get the effect I want: (define-minor-mode fontify-line-limit-mode "Make sure the highlighting doesn't extend beyond the end of line." :lighter "" :init-value nil ;; Too lazy to define a face for this (font-lock-add-keywords nil '(("\n" . (0 font-lock-function-name-face t))) t)) (define-...


3

Hey this answer solved my similar problem. A bit late but I had the same issue today. As mentioned, I add the following code snipped to my .spacemacs/.emacs config: (require 'org) (require 'ox-latex) (add-to-list 'org-latex-packages-alist '("" "minted")) (setq org-latex-listings 'minted) (setq org-latex-pdf-process '("pdflatex -shell-escape -...


2

highlight-numbers mode will provide color for all numbers in a buffer, and you can use it in your R process buffer. It only supports a single highlight, so you can't use a different color for positive and negative numbers. However, you can tweak it to highlight only negative numbers, leaving the other numbers to be colored according to ESS's font-locking. ...


2

Based on the examples in section Customizing Search-Based Fontification of the elisp manual, I would propose this: (add-hook 'clojure-mode-hook (lambda () (font-lock-add-keywords nil '(("\\(@\\)" 1 '(:foreground "red") prepend))))) This uses an anonymous face with red foreground, any face could of course be used.


2

Here's my attempt. I learnt org-font-lock-set-keywords-hook on https://www.gonsie.com/blorg/org-highlight.html. The org-green face is defined in @amitp's answer. (defun org-add-my-extra-markup () (add-to-list 'org-font-lock-extra-keywords `(,(rx (group "{{") (group (+? anything)) (group "}}")) ...


2

There are two things you want. Apply a face (green text) to the area between {{ and }}. Hide the {{ and }}. For the first, you can define a green face and then use font-lock to mark the text: (defface org-green '((t :foreground "green4")) "Face for green text in org mode") (defun my/org-mode-font-lock () (font-lock-add-keywords nil '(("{{\\(.*...


2

Inside a string, you need to double the backslashes. It makes the regexps look rather ugly, but it's something we have to live with. :-)


2

You do not need to modify web-mode.el. You just add a new font-lock keyword in web-mode-hook. The code below demonstrates that. You can store it in your init file. (defface my-web-mode-hl__lg '((t (:foreground "#ff007c"))) "Face for the first arg of __lg.") (defun my-web-mode-hl__lg () "Configure web mode such that the first arg of __lg(...) is high-...


1

I believe what you need to do is check the inheritance of the various faces. This can be done with describe-face. The available options are given in the manual under Face Attributes, but I believe the one you want is unspecified. Here is what I use in my init.el for highlighting and how I solved the problem of the highlight clobbering other faces: (...


1

These syntax-table settings imply that there are 4 comment-start markers: /* of style a -- of style b -* of style a /- of style b IIUC two of those are undesired and need to be "weeded out" via syntax-propertize-function.


1

I've found a solution using the emacs package mmm-mode. Most of the information I got was from this article. What this package does, is allow multiple major modes in the same buffer. You basically set the opening and closing clauses for whatever nested syntax you have, and that block will be highlighted in a submode. M-x package-install RET graphql-mode M-...


1

I just released a package for highlighting Doxygen comments. In addition to highlighting Doxygen commands and their arguments, it highlights code examples according to the language they are written in. See highlight-doxygen for more information.


Only top voted, non community-wiki answers of a minimum length are eligible