I currently have some syntax highlighting in my ESS code (e.g., for brackets, =, and strings). I would like to add highlighting of function calls, like RStudio's "Highlight R function calls" option. How can I do this?

1 Answer 1


ess-R-font-lock-keywords is a user option that is mentioned in the ESS manual as:

Font-lock patterns for ESS R programming mode. (There is a corresponding ess-S-font-lock-keywords for S buffers.) The default value highlights function names, literals, assignments, source functions and reserved words.

Example configuration:

    (setq ess-R-font-lock-keywords
      '((ess-R-fl-keyword:keywords   . t)
        (ess-R-fl-keyword:constants  . t)
        (ess-R-fl-keyword:modifiers  . t)
        (ess-R-fl-keyword:fun-defs   . t)
        (ess-R-fl-keyword:assign-ops . t)
        (ess-R-fl-keyword:%op%       . t)
        (ess-fl-keyword:fun-calls    . t)
        (ess-fl-keyword:operators . t)

Setting ess-fl-keyword:fun-calls to t turns on function call highlighting.

I also found out from a stack overflow answer that these can also be set manually through the ESS > Font Lock submenu.

  • Could you elaborate, to make your Q&A more useful to others? Maybe explain why that change takes care of it?
    – Drew
    Commented Oct 1, 2020 at 17:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.