[英]Add custom markers to emacs org-mode
我正在使用emacs組織模式用於各種目的。 最常見的功能是使用特殊標簽TODO
& DONE
標記我的任務。 有沒有辦法添加自定義標簽(例如IN_PROGRESS
)並用單獨的顏色突出顯示它?
此外,如果此標記在與TODO
和DONE
相同的緩沖區中滾動,那么我可以使用相同的熱鍵在它們之間切換。
您可以在文件的開頭執行此操作:
#+TODO: TODO IN-PROGRESS WAITING DONE
按該行上的Cc Cc刷新設置(后續加載文件不需要),一切都應該是快活的。
正如解釋在這里 。
我在init.el中使用以下內容,它為所有組織文件設置其他任務狀態及其樣式:
(setq org-todo-keyword-faces
'(
("NOT-TODO" . (:foreground "blue" :weight bold))
("IF-TIME" . (:foreground "yellow" :weight bold))
("NOT-REPRO" . (:foreground "purple" :weight bold))
))
(setq org-todo-keywords
'((sequence "TODO" "NOT-TODO" "NOT-REPRO" "IF-TIME" "DONE")))
我使用以下內容生成TODO關鍵字,看起來有點像按鈕,使它們在我的大綱和議程中更加清晰。 如果我的記憶為我服務,這種樣式來自郵件列表。
(setq org-todo-keywords
'((sequence "TODO"
"MAYBE"
"NEXT"
"STARTED"
"WAITING"
"DELEGATED"
"|"
"DONE"
"DEFERRED"
"CANCELLED")))
(setq org-todo-keyword-faces
'(("PROJ" :background "blue" :foreground "black" :weight bold :box (:line-width 2 :style released-button))
("TODO" :background "red1" :foreground "black" :weight bold :box (:line-width 2 :style released-button))
("NEXT" :background "red1" :foreground "black" :weight bold :box (:line-width 2 :style released-button))
("STARTED" :background "orange" :foreground "black" :weight bold :box (:line-width 2 :style released-button))
("WAITING" :background "yellow" :foreground "black" :weight bold :box (:line-width 2 :style released-button))
("DEFERRED" :background "gold" :foreground "black" :weight bold :box (:line-width 2 :style released-button))
("DELEGATED" :background "gold" :foreground "black" :weight bold :box (:line-width 2 :style released-button))
("MAYBE" :background "gray" :foreground "black" :weight bold :box (:line-width 2 :style released-button))
("APPT" :background "red1" :foreground "black" :weight bold :box (:line-width 2 :style released-button))
("DONE" :background "forest green" :weight bold :box (:line-width 2 :style released-button))
("CANCELLED" :background "lime green" :foreground "black" :weight bold :box (:line-width 2 :style released-button))))
這使我的議程如下:
要在不修改特定組織文件的情況下添加關鍵字,您可以修改org-todo-keywords
。
有關更多信息,請參閱組織手冊 。
作為細粒度的替代品
(setq org-todo-keyword-faces
'(...
)
這使您可以調整每一個TODO
狀態時,你可能會考慮一個二分法的做法,基本上做一個臉部的每個兩組上的兩側|
例如,管道
(set-face-attribute 'org-todo nil
:foreground "#AFD8AF"
)
(set-face-attribute 'org-done nil
:foreground "#CC9393"
)
(這個顏色選擇是我目前在zenburn
主題中的切換。)也就是說,這些顏色分別適用於
TODO1 TODO2 ... TODOk | DONE1 DONE2 ... DONEn
所以,例如,
ETA:
我已經不得不與各種組織模式標題級別有各種顏色這一事實搏斗,並且嘗試找到顏色對(對於org-todo
和org-done
)來說太不方便了,這與所有標題級別形成鮮明對比。 此外,還必須處理改變Emacs的顏色主題,因為隨着季節的變化,低對比度的zenburn可能不太合適。
簡單地反轉默認顏色要容易得多。 生成的矩形邊緣有點笨拙,因此邊框有助於使其看起來更自然。 然后,我得到了一個類似Stuart Hickinbottom的計划。
所以我現在有
(set-face-attribute 'org-todo nil
:box '(:line-width 2
:color "grey75"
:style released-button)
:inverse-video t
)
(set-face-attribute 'org-done nil
:box '(:line-width 2
:color "grey75"
:style released-button)
:inverse-video t
)
(set-face-attribute 'org-priority nil
:inherit font-lock-keyword-face
:inverse-video t
:box '(:line-width 2
:color "grey75"
:style released-button)
)
這會產生,使用init文件顏色選擇(load-theme 'deeper-blue t)
,
(紅色就像在停止!做到這一點!綠色就像你可以自由地去玩。)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.