aboutsummaryrefslogtreecommitdiff
path: root/.emacs.d/modes/init-org-mode.el
diff options
context:
space:
mode:
authorgxlin <[email protected]>2021-04-16 11:04:08 +0800
committergxlin <[email protected]>2021-04-18 09:35:49 +0800
commit8aaabedde4f1ee045c9fedbcf20fecb3d217531a (patch)
treeca246e2a5aac5375a93c5549d0da76d74de12863 /.emacs.d/modes/init-org-mode.el
parentc81b6905aa178349c8633ac623ae2cd1d91f88a9 (diff)
downloaddotfiles-8aaabedde4f1ee045c9fedbcf20fecb3d217531a.tar.gz
dotfiles-8aaabedde4f1ee045c9fedbcf20fecb3d217531a.tar.bz2
dotfiles-8aaabedde4f1ee045c9fedbcf20fecb3d217531a.zip
Add a lot of emacs config
Diffstat (limited to '.emacs.d/modes/init-org-mode.el')
-rw-r--r--.emacs.d/modes/init-org-mode.el49
1 files changed, 49 insertions, 0 deletions
diff --git a/.emacs.d/modes/init-org-mode.el b/.emacs.d/modes/init-org-mode.el
new file mode 100644
index 0000000..ca1be2a
--- /dev/null
+++ b/.emacs.d/modes/init-org-mode.el
@@ -0,0 +1,49 @@
+(use-package org
+ :after evil
+ :config
+ (setq org-directory "~/notes/")
+ (setq org-default-notes-file (concat org-directory "/inbox.org"))
+ (setq org-capture-templates
+ '(("t" "TODO" entry (file+headline org-default-notes-file "Tasks")
+ "* TODO %?\nCaptured on %U\n %i\n %a")
+ ("j" "Journal" entry (file+datetree org-default-notes-file)
+ "* %?\nCaptured on %U\n %i\n %a")))
+ (add-hook 'org-mode-hook (lambda () (setq truncate-lines nil)))
+; (setq org-agenda-files (directory-files-recursively "~/notes/" "\\.org$"))
+ (add-to-list 'auto-mode-alist '("\\.org$" . org-mode))
+ (setq org-agenda-start-on-weekday 0)
+ (setq org-adapt-indentation nil)
+ (setq org-return-follows-link t)
+ (setq org-log-done t)
+ (evil-define-key 'normal 'global
+ (kbd "<leader>a") 'org-agenda
+ (kbd "<leader>l") 'org-store-link
+ (kbd "<leader>c") 'org-capture)
+ (evil-define-key 'normal org-mode-map
+ (kbd "TAB") 'org-cycle
+ (kbd "RET") 'org-open-at-point)
+
+ (setq org-todo-keywords
+ '((sequence "TODO" "|" "DONE" "CANCELED")))
+ (setq org-tag-alist '((:startgroup . nil)
+ ("work" . ?w) ("home" . ?h) ("errants" . ?e)
+ (:endgroup . nil)
+ ("@phone" . ?p)))
+
+ (setq org-icalendar-include-todo t)
+ (setq org-icalendar-combined-agenda-file "~/notes/org.ics")
+ (add-hook 'org-mode-hook
+ (lambda ()
+ (add-hook 'after-save-hook 'org-icalendar-combine-agenda-files nil t))))
+
+(use-package evil-org
+ :ensure t
+ :after (org evil)
+ :hook (org-mode . (lambda () (evil-org-mode)))
+
+ :config
+ (evil-org-set-key-theme '(navigation insert textobjects additional calendar todo))
+ (require 'evil-org-agenda)
+ (evil-org-agenda-set-keys))
+
+(provide 'init-org-mode)