简体   繁体   English

如何突出Eshell中的一些单词?

[英]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. 我在Emacs中使用Eshell来运行程序,我可以检查Shell中的输出,但是我想突出显示一些词语,例如'errors''info',或者其他类似的词。 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: 您应该尝试使用nschum / highlight-symbol.el ,如下所示:

突出

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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