How to highlight some words in Eshell?

129 views Asked by At

I use Eshell in Emacs to run a program and I could check the output in the Shell , but I want to highlight some words like ‘errors’ ‘info’,or other words like that. How could I do that ?

2

There are 2 answers

0
dunkaroo On BEST ANSWER
(defun font-lock-comment-annotations ()
  (font-lock-add-keywords
   nil
   '(("\\<\\(error\\)" 1 font-lock-warning-face t)
     ("\\<\\(info\\)" 1 'org-todo t)
   ))
(add-hook 'eshell-mode-hook 'font-lock-comment-annotations)

Give it a try :)

0
Jerry Zhang On

You should try nschum/highlight-symbol.el, like this:

highlight