add org config

This commit is contained in:
zedhugh committed 2022-10-30 21:56:42 +08:00
1 parent f2fe92d06f
commit f5c4fd5e16
8 files changed
+96

No files matched your search

+15
View File
@@ -133,3 +133,18 @@
[submodule "site-lisp/circadian"]
path = site-lisp/circadian
url = https://github.com/guidoschmidt/circadian.el.git
[submodule "site-lisp/tomelr"]
path = site-lisp/tomelr
url = https://github.com/kaushalmodi/tomelr.git
[submodule "site-lisp/ox-hugo"]
path = site-lisp/ox-hugo
url = https://github.com/kaushalmodi/ox-hugo.git
[submodule "site-lisp/org-pomodoro"]
path = site-lisp/org-pomodoro
url = https://github.com/marcinkoziej/org-pomodoro.git
[submodule "site-lisp/alert"]
path = site-lisp/alert
url = https://github.com/jwiegley/alert.git
[submodule "site-lisp/gntp"]
path = site-lisp/gntp
url = https://github.com/tekai/gntp.el.git
+1
View File
@@ -122,6 +122,7 @@ If freezing sometimes, decrease it. If stuttering, increase it.")
(require 'init-prettier)
(require 'init-emmet)
(require 'init-flymake)
(require 'init-org)
(setq custom-file (expand-file-name "custom.el" creature/cache-dir))
+75
View File
@@ -0,0 +1,75 @@
;; -*- coding: utf-8; lexical-binding: t; -*-
;; customize mode for src lang
(defconst creature/org-src-lang-modes
'(("js" . js)
("ts" . typescript)
("html" . web))
"Better src lang reflex to mode.")
;; enable code block in org file
(defconst creature/org-src-enable-lang
'((C . t)
(js . t)
(latex . t)
(shell . t)
(python . t)
(emacs-lisp . t))
"Enabled lang in org src code block.")
(autoload 'org-pomodoro "org-pomodoro" "" t)
(with-eval-after-load 'org-pomodoro
(setq org-pomodoro-audio-player "mpv"))
;; 保存链接
(defun creature/org-capture-setup ()
(require 'org-capture)
(require 'org-protocol)
(setq org-capture-templates
'(("" "org-protocol" entry (file "~/org/bookmarks.org")
"* TODO Review %a\n %T:initial\n" :immediate-finish t)
))
(setq org-protocol-default-template-key ""))
(run-with-idle-timer 10 nil #'creature/org-capture-setup)
(with-eval-after-load 'org
;; (setq org-adapt-indentation t)
;; show inline image when open org file
(creature/org-capture-setup)
(add-hook 'org-mode-hook 'org-display-inline-images)
;; org agenda
(setq org-agenda-files '("~/org"))
(global-set-key (kbd "C-c a") 'org-agenda)
;; enable scale image
(setq org-image-actual-width nil)
;; config latex preview
(setq org-preview-latex-default-process 'dvipng)
(setq org-preview-latex-image-directory
(expand-file-name "ltximg/" creature/cache-dir))
;; don't prompt before eval code
(setq org-confirm-babel-evaluate nil)
;; sub-superscripts
(setq org-export-with-sub-superscripts '{})
;; make options configged before work
(org-babel-do-load-languages
'org-babel-load-languages
creature/org-src-enable-lang)
(dolist (src2mode creature/org-src-lang-modes)
(add-to-list 'org-src-lang-modes src2mode))
;; (define-key org-mode-map (kbd "RET") 'org-return-indent)
)
(with-eval-after-load 'ox
(setq org-export-preserve-breaks t)
(require 'ox-hugo))
(provide 'init-org)
+1
Submodule site-lisp/alert added at 2c11cf9374.
+1
Submodule site-lisp/gntp added at 767571135e.
+1
Submodule site-lisp/ox-hugo added at a66063a991.
+1
Submodule site-lisp/tomelr added at 670e0a08f6.