emacs - org mode add capture template
authorPeng Li <seudut@gmail.com>
Wed, 20 Jan 2016 12:14:21 +0000 (20:14 +0800)
committerPeng Li <seudut@gmail.com>
Wed, 20 Jan 2016 13:26:12 +0000 (21:26 +0800)
emacs.d/elisp/init-org.el
emacs.d/init.el
note.org

index f48e949..bc3c35b 100644 (file)
@@ -3,11 +3,68 @@
 ;; http://doc.norang.ca/org-mode.html  Org Mode - Organize Your Life In Plain Text!
 
 (add-to-list 'auto-mode-alist '("\\.\\(org\\|org_archive\\|txt\\)$" . org-mode))
-(require 'org)
 
 (global-set-key "\C-cl" 'org-store-link)
 (global-set-key "\C-ca" 'org-agenda)
 (global-set-key "\C-cb" 'org-iswitchb)
 
 
+(global-set-key (kbd "<f12>") 'org-agenda)
+
+(setq org-agenda-files (quote ("~/Private/org")))
+
+(setq org-todo-keywords
+      (quote ((sequence "TODO(t)" "ONGOING(n)" "|" "DONE(d)")
+              (sequence "WAITING(w@/!)" "HOLD(h@/!)" "|" "CANCELLED(c@/!)" ))))
+
+(setq org-todo-keyword-faces
+      (quote (("TODO" :foreground "red" :weight bold)
+              ("ONGOING" :foreground "blue" :weight bold)
+              ("DONE" :foreground "forest green" :weight bold)
+              ("WAITING" :foreground "orange" :weight bold)
+              ("HOLD" :foreground "magenta" :weight bold)
+              ("CANCELLED" :foreground "forest green" :weight bold))))
+
+(setq org-todo-state-tags-triggers
+      (quote (("CANCELLED" ("CANCELLED" . t))
+              ("WAITING" ("WAITING" . t))
+              ("HOLD" ("WAITING") ("HOLD" . t))
+              (done ("WAITING") ("HOLD"))
+              ("TODO" ("WAITING") ("CANCELLED") ("HOLD"))
+              ("ONGOING" ("WAITING") ("CANCELLED") ("HOLD"))
+              ("DONE" ("WAITING") ("CANCELLED") ("HOLD")))))
+
+;; change a task state C-c C-t Key
+(setq org-use-fast-todo-selection t)
+(setq org-treat-S-cursor-todo-selection-as-state-change nil)
+
+
+
+;; Org Capture
+(setq org-directory "~/Private/org/")
+(setq org-default-notes-file (concat org-directory "refile.org"))
+(setq org-default-diary-file (concat org-directory "diary.org"))
+
+(global-set-key (kbd "C-c c") 'org-capture)
+
+;; Capture templates for: TODO tasks, Notes, appointments, phone calls, meetings, and org-protocol
+(setq org-capture-templates
+      (quote (("t" "Todo" entry (file org-default-notes-file)
+               "* TODO %?\n\n  %U\n  %a\n" :clock-in t :clock-resume t)
+              ("r" "Respond" entry (file org-default-notes-file)
+               "* NEXT Respond to %:from on %:subject\nSCHEDULED: %t\n  %U\n  %a\n" :clock-in t :clock-resume t :immediate-finish t)
+              ("n" "Note" entry (file org-default-notes-file)
+               "* %? :NOTE:\n\n  %U\n  %a\n" :clock-in t :clock-resume t)
+              ("j" "Journal" entry (file+datetree org-default-diary-file)
+               "* %?\n%U\n" :clock-in t :clock-resume t)
+              ("w" "Org-protocol" entry (file org-default-notes-file)
+               "* TODO Review %c\n%U\n" :immediate-finish t)
+              ("m" "Meeting" entry (file org-default-notes-file)
+               "* MEETING with %? :MEETING:\n%U" :clock-in t :clock-resume t)
+              ("p" "Phone call" entry (file org-default-notes-file)
+               "* PHONE %? :PHONE:\n  %U" :clock-in t :clock-resume t)
+              ("h" "Habit" entry (file org-default-notes-file)
+               "* NEXT %?\n\n  %U\n  %a\n\nSCHEDULED: %(format-time-string \"%<<%Y-%m-%d %a .+1d/3d>>\")\n:PROPERTIES:\n:STYLE: habit\n:REPEAT_TO_STATE: NEXT\n:END:\n"))))
+
+
 (provide 'init-org)
index b349205..3953f8a 100644 (file)
@@ -38,6 +38,7 @@
 (require 'init-magit)
 (require 'init-helm)
 (require 'init-projectile)
+(require 'init-org)
 
 
 
index 53823c7..6ff6a7d 100644 (file)
--- a/note.org
+++ b/note.org
@@ -1,23 +1,27 @@
 
-** emacs change note
+#+TITLE: Emacs configure 
 
-**** config basic 
+#+STARTUP: indent
 
-**** color theme
 
-**** font family
 
-**** font size
+** config basic
 
-**** eshell config
+*** color theme
 
-**** Org setting
+*** font
 
-**** TODO
+** Magit
+
+** eshell config
+
+** projectile
+
+** Org setting
+
+** Keybinding
+
+** Motion
 
-- helm
-- projectile
-- 
--