Hi-Lock mode

  1. 相关命令      #+CAPTION:键绑定

    Key bindingCommand NameDescription
    M-s h lhighlight-lines-matching-regexpHighlights all lines matching a regular expression
    M-s h phighlight-phraseHighlights everything matching a phrase
    M-s h rhighlight-regexpHighlights everything matching a regular expression
    M-s h uunhighlight-regexpDeletes the highlighter under point
    M-s h whi-lock-write-interactive-patternsInserts a list of Hi-Lock patterns into the buffer
    M-s h fhi-lock-find-patternsSearches for Hi-Lock patterns in the buffer to use.
  2. 保存高亮设置

    使用命令M-s h w会把当前的高亮设置用注释的方式写在当前文件的头部.

    当Emacs进入hi-lock-mode后,会自动搜索文件头部的10000个字节(由变量`hi-lock-file-patterns-range`决定)找到高亮信息并执行高亮操作

    Emacs进入hi-lock-mode后,若搜索到有高亮设置信息,会提示你是否应用该高亮信息,若想自动应用该高亮信息在.emacs中添加如下配置项

    (global-hi-lock-mode 1)
    (setq hi-lock-file-patterns-policy #'(lambda (dummy) t))