转:emacs org-mode如何设置文字颜色,设置文字前景色?

转:https://stackoverflow.com/questions/20016634/highlight-selected-text-in-emacs-org-mode

  1. In org-mode you can use word to get word in bold face, /word/ to get word in italics and word to get word underlined.
  2. You can re-define the characters for emphasizing via “Options->Customize Emacs->Specific Option”,then input “org-emphasis-alist”. That is permanent in the sense that if you save and kill the buffer and reload the file into emacs you have the same high-lighting again.

M-x hi-lock-mode 使能后,Edit菜单会多出一项,如图1所示:
图1

"highlight-regexp" will ask you for a regexp to highlight and a color (there are some combinations of background and foreground).
"highlight-lines-matching-regexp" does what it means.
you can enable or disable it with "hi-lock-mode".

and you can permanently save them with “hi-lock-write-interactive-patterns (M-s h w)”. Emacs will write a bit of lisp in a commented line in your buffer.

See more tricks here: https://www.gnu.org/software/emacs/manual/html_node/emacs/Highlight-Interactively.html

http://www.masteringemacs.org/articles/2010/10/13/highlighting-by-word-line-regexp/

Enjoy !

选择颜色参考图2:
图2

在 .org 文件最顶部, “C-x w b”,保存。

在 .emacs file 中,加入:
;; – 像pdf文件一样高亮某些字符
(global-hi-lock-mode 1) ; 使能高亮
(setq hi-lock-file-patterns-policy #’(lambda (dummy) t)) ; 加载高亮模式

idea:hl-line
essentials:hi-blue

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值