TODO highlighting in all programming modes

What root mode do I need to highlight TODO in Ruby, Lisp, and C-like? I tried the following, but does not highlight TODO in Ruby or Lisp:

(defun highlight-todos (font-lock-add-keywords nil
             '(("\\<\\(FIXME\\|TODO\\|BUG\\):" 1 font-lock-warning-face t))))
(add-hook 'text-mode-hook 'highlight-todos)
+5
source share
1 answer

I think to use it in all programming modes to use prog-mode-hook

(add-hook 'prog-mode-hook 'highlight-todos)
+5
source

All Articles