# Highlighting a single character with syntax coloring

**URL:** <https://racket.discourse.group/t/highlighting-a-single-character-with-syntax-coloring/4413>\
**Category:** Questions & Answers\
**Created:** [October 6, 2026, 4:49pm UTC](https://racket.discourse.group/t/highlighting-a-single-character-with-syntax-coloring/4413 "2026-10-06T16:49:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![CT37](https://avatars.discourse-cdn.com/v4/letter/c/f19dbf/32.png) [@CT37](https://racket.discourse.group/u/CT37)\
**Post date:** [October 6, 2026, 4:49pm UTC](https://racket.discourse.group/t/highlighting-a-single-character-with-syntax-coloring/4413/1 "2026-10-06T16:49:28Z")

</div>

For a custom drracket color scheme, is there any way to color a single character anywhere in the editor regardless of where it is?

---

<div class="post-metadata">

**Author:** ![shhyou](https://avatars.discourse-cdn.com/v4/letter/s/ccd318/32.png) [@shhyou](https://racket.discourse.group/u/shhyou)\
**Post date:** [October 7, 2026, 2:00am UTC](https://racket.discourse.group/t/highlighting-a-single-character-with-syntax-coloring/4413/2 "2026-10-07T02:00:11Z")

</div>

I don't think there's a way to highlight a single character. DrRacket colors the program by tokens using `#lang`-provided lexer, so the colorer doesn't even see characters.

---

<div class="post-metadata">

**Author:** ![damien\_mattei](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/damien_mattei/32/2706_2.png) [@damien\_mattei](https://racket.discourse.group/u/damien_mattei)\
**Post date:** [October 7, 2026, 10:33am UTC](https://racket.discourse.group/t/highlighting-a-single-character-with-syntax-coloring/4413/3 "2026-10-07T10:33:43Z")

</div>

Seems not possible in Racket editor, but in Emacs yes (i already have the config) : if you high light syntax for a string it does not need to be a space or tab isolated token, for example if i high light TODO in color then the TODO? string will still have TODO in color.So i suppose you can color a single character string too.

TODO is a string of char being a token in color :

 ![Capture d’écran_2026-10-07_12-11-13](https://global.discourse-cdn.com/free1/uploads/racket/original/2X/5/592c8638845f721ad21441ebe6f40be56624a1a8.png)

TODO is a string of char not being a token but still in color :

 ![Capture d’écran_2026-10-07_12-27-51](https://global.discourse-cdn.com/free1/uploads/racket/original/2X/e/e5fce8b1816a327e57978356bfe0dd5d415ed2fc.png)

this could be done in emacs with this config in .emacs :

```scheme
(font-lock-add-keywords 'scheme-mode
  '(("\\<\\(TODO\\)" 1 font-lock-warning-face prepend))) ; case sensitive !
   

```

Instead of TODO you can test with a single string char of what you want.
