高速にメモをとるためのOrg Capture
Org Capture とはOrg-Modeのメモ取りツール(わかりやすく書いてある -> 色々 Org Capture する | Amrta )
以下のように書いておくと(キーバインドはなんだっていい)
(setq org-capture-templates '(("t" "Task" entry (file (expand-file-name (concat org-directory "/task.org"))) "* TODO %?\n %i\n %a\n %T") ("n" "note" entry (file (expand-file-name (concat org-directory "/notes.org"))) "* %?\n %a\n %T") ("r" "reading" entry (file (expand-file-name (concat org-directory "/reading.org"))) "* %?\n %a\n %T"))) (global-set-key (kbd "C-c C-q") 'org-capture)
C-c C-q
と押した時に以下のようなバッファが現れどれかを選択するとメモが簡単に書ける
Select a capture template ========================= [t] Task [n] note [r] reading ------------------------------------------------------------------------------- [C] Customize org-capture-templates [q] Abort
ただ問題があって,たかがメモをとるためにC-c C-q n
とおさないとメモを取れないのはだるすぎる(C-c C-q
の部分は好きに設定できるが最小でも2回必要.しかも画面が勝手に開いて視点がコロコロ変わり本当にだるい)
そこで以下のような関数を作った.これでC-M-=
を一度押せばいきなりメモをかけるようになった.
org-captureの第二引数を上記で記述したorg-capture-templates
のt
(Task)かn
(note)かr
(reading)にすることで指定のテンプレートを使用できる.
(defun org/note-right-now (content) (interactive "sContent: ") (org-capture nil "n") (insert content) (org-capture-finalize)) (global-set-key (kbd "C-M-=") 'org/note-right-now)