简体   繁体   中英

How to highlight some words in Eshell?

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 ?

(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 :)

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

突出

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM