- replace "add-pkg-in-pkg-dir" (recursive load-path scanning) with a central "creature/pkgs" registry that handles load path, autoloads, info dirs and dependencies - adapt all init-*.el files to the new activation function - add a top-level Makefile to byte-compile site-lisp packages - remove unused "emacs-kv" and "emacs-db" submodules
96 lines
2.5 KiB
EmacsLisp
96 lines
2.5 KiB
EmacsLisp
;; -*- coding: utf-8; lexical-binding: t; -*-
|
|
|
|
(require 'init-package)
|
|
|
|
(creature/pkg-active 'org-pomodoro)
|
|
(creature/pkg-active 'ox-hugo)
|
|
|
|
;; customize mode for src lang
|
|
(defconst creature/org-src-lang-modes
|
|
(if (bound-and-true-p creature/treesit-available)
|
|
'(("js" . js)
|
|
("ts" . typescript-ts)
|
|
("tsx" . tsx-ts)
|
|
("dot" . graphviz-dot)
|
|
("html" . mhtml)
|
|
("json" . js-json))
|
|
'(("js" . js)
|
|
("ts" . typescript)
|
|
("tsx" . typescript-tsx)
|
|
("dot" . graphviz-dot)
|
|
("html" . mhtml)
|
|
("json" . js-json)))
|
|
"Better src lang reflex to mode.")
|
|
|
|
;; enable code block in org file
|
|
(defconst creature/org-src-enable-lang
|
|
'((C . t)
|
|
(js . t)
|
|
(dot . t)
|
|
(latex . t)
|
|
(shell . t)
|
|
(python . t)
|
|
(plantuml . 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))
|
|
|
|
(with-eval-after-load 'ob-plantuml
|
|
(setq org-plantuml-exec-mode 'plantuml))
|
|
|
|
|
|
(provide 'init-org)
|