Config: update path, add org capture tamplate.

This commit is contained in:
trogloxene
2026-04-07 21:34:38 +08:00
parent 0139328623
commit f415371331
4 changed files with 55 additions and 24 deletions

View File

@@ -35,17 +35,17 @@
(setq org-journal-file-format "%Y-%m-%d.org"
org-journal-file-header "#+category: journal\n#+STARTUP: content\n\n"
org-journal-time-prefix "\n*** TODO "
org-journal-time-format "%m-%d \n:PROPERTIES:\n:Created: <%Y-%m-%d %a %H:%M:%S>\n:END:\n"
org-journal-time-format "%m-%d \n<%Y-%m-%d %a %H:%M:%S>\n"
org-journal-hide-entries-p t
org-journal-date-format (lambda (time)
(format "* %s %s\n:PROPERTIES:\n:Created: [%s]\n:END:"
(format "* %s %s\n[%s]\n"
(format-time-string "%Y-%m-%d" time)
(format-time-string "%a" time)
(format-time-string "%Y-%m-%d %a" time)))
org-journal-carryover-items "TODO=\"TODO\"|TODO=\"STARTED\"|TODO=\"WAITING\"|TODO=\"SOMEDAY\"")
(when *is-windows*
(setq org-journal-dir "D:/emacs/my-org-daily/"))
(setq org-journal-dir "h:/emacs/my-org-daily/"))
(when *is-mac*
(setq org-journal-dir "~/org/my-org-daily/"))
@@ -110,6 +110,7 @@
(lambda ()
(global-cns-mode-enable-in-buffer)))
;; 一些随org-mode加载的基础配置
(add-hook 'org-mode-hook
(lambda ()
@@ -155,8 +156,9 @@
(when *is-windows*
(with-eval-after-load 'org
(setq org-agenda-files '("d:/emacs/hugo/this-is-my-blog/all-blog.org"
"d:/emacs/my-org-daily/"))))
(setq org-agenda-files '("h:/emacs/hugo/this-is-my-blog/all-blog.org"
"h:/emacs/my-org-daily/"
"h:/emacs/my-org-note/"))))
(when *is-mac*
(with-eval-after-load 'org
(setq org-agenda-files '("~/org/my-org-daily"))))
@@ -168,14 +170,14 @@
(setq org-agenda-skip-function-global
'(org-agenda-skip-entry-if 'todo '("COMMENT")))
;; org-ql
(use-package org-ql)
;; org-super-agenda 配置
(use-package org-super-agenda
:config
(org-super-agenda-mode))
;; org-ql
(use-package org-ql)
;; 自定义已完成任务视图
(setq org-agenda-custom-commands
'(("pa" "Priority >= A"
@@ -209,12 +211,39 @@
(org-super-agenda-groups
'((:auto-ts t)))))))))
(setq org-tag-alist '(
("scheme" . ?s)
("emacs" . ?e)
("linux" . ?l)
("computer-stuff" . ?c)
("philosophy" . ?p)
("game" . ?g)
("gamestudies" . ?G)
))
;; capture模板
(when *is-windows*
(defvar my-org-capture-temp-title "" "Temporarily store the org-capture filename.")
(setq org-capture-templates
'(("t" "Todo" entry (file+headline "d:/emacs/org/todos.org" "Workspace")
"* TODO [#B] %?\n %i\n %U"
:empty-lines 1))))
'(("n" "New Note" plain
(file (lambda ()
(setq my-org-capture-temp-title (read-string "Filename (without .org): "))
(expand-file-name (format "%s/%s-%s.org"
"h:/emacs/my-org-note"
(format-time-string "%Y%m%d")
my-org-capture-temp-title))))
"#+title: %(symbol-value 'my-org-capture-temp-title)
#+created: %U
#+category: %^{Category|none|plan|book|article|note|insight}
#+filetags: %^g
* %(symbol-value 'my-org-capture-temp-title)
:PROPERTIES:
:END:
%?
"
:jump-to-captured t))))
(when *is-mac*
(setq org-capture-templates
@@ -260,14 +289,14 @@ See `org-capture-templates' for more information."
;; It is assumed that below file is present in `org-directory'
;; and that it has a "Blog Ideas" heading. It can even be a
;; symlink pointing to the actual location of all-posts.org!
(file+headline "d:/emacs/hugo/this-is-my-blog/all-blog.org" "Blog Ideas")
(file+headline "h:/emacs/hugo/this-is-my-blog/all-blog.org" "Blog Ideas")
(function org-hugo-new-subtree-post-capture-template))))
;; 快速部署
(defun my-blog-publish ()
"Publish blog , git add/commit/push , generate commit message."
(interactive)
(let* ((blog-dir "d:/emacs/hugo/this-is-my-blog/")
(let* ((blog-dir "h:/emacs/hugo/this-is-my-blog/")
(timestamp (format-time-string "%Y-%m-%d %H:%M:%S"))
(default-directory blog-dir))
@@ -296,7 +325,7 @@ See `org-capture-templates' for more information."
"Save and preview blog."
(interactive)
(save-buffer)
(let ((default-directory "d:/emacs/hugo/this-is-my-blog/"))
(let ((default-directory "h:/emacs/hugo/this-is-my-blog/"))
;; 启动 Hugo server
(start-process "hugo-server" "*hugo-server*"
"hugo" "server" "-D" "--bind" "0.0.0.0" "--port" "1313")