feat: Add notes helpers, magit keybindings, and phscroll

- Move `my-blog-publish`, `my-blog-preview`, and `my-note-push` from init-org.el to init-kbd-func.el for better organization
- Add magit keybindings under C-x g prefix
- Add phscroll package for better org table line wrapping
- Remove visual-line-mode hook from gptel
- Add Chinese word segmentation buffer to consult ignore list
This commit is contained in:
User
2026-06-09 04:20:24 +08:00
parent aaf9dcbcc6
commit 83c0f153f3
5 changed files with 57 additions and 51 deletions

View File

@@ -49,6 +49,13 @@
(setq org-agenda-skip-function-global
'(org-agenda-skip-entry-if 'todo '("COMMENT"))))
;; phscroll优化表格换行
(use-package phscroll
:hook
(org-mode . org-phscroll-activate)
:init
(setq org-startup-truncated nil))
;; org-babel scheme
(use-package ob-scheme
:demand t
@@ -240,48 +247,7 @@ See `org-capture-templates' for more information."
;; 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 "~/org/hugo/this-is-my-blog/all-blog.org" "Blog Ideas")
(function org-hugo-new-subtree-post-capture-template)))))
;; 快速部署
(defun my-blog-publish (&optional directory)
"Publish blog , git add/commit/push , generate commit message."
(interactive)
(let* ((blog-dir (or directory
(if *is-windows*
"h:/emacs/hugo/this-is-my-blog/"
"~/org/hugo/this-is-my-blog/")))
(timestamp (format-time-string "%Y-%m-%d %H:%M:%S"))
(default-directory blog-dir))
;; save buffer
(save-buffer)
;; git add
(message "Adding files...")
(eshell-command "git add .")
;; git commit with timestamp
(message "Committing: %s" timestamp)
(eshell-command (format "git commit -m \"Update: %s\"" timestamp))
;; git push
(message "Pushing to remote...")
(let ((exit-code (eshell-command "git push")))
(if (eq exit-code t)
(message "Push may have failed or nothing to push, check *Messages* buffer for details")
(message "Push successfully %s" timestamp)))))
;; 预览博客
(defun my-blog-preview ()
"Save and preview blog."
(interactive)
(save-buffer)
(let ((default-directory (if *is-windows*
"h:/emacs/hugo/this-is-my-blog/"
"~/org/hugo/this-is-my-blog/")))
;; 启动 Hugo server
(start-process "hugo-server" "*hugo-server*"
"hugo" "server" "-D" "--bind" "0.0.0.0" "--port" "1313")
;; 等待服务器启动
(sleep-for 2)
;; 自动打开浏览器
(browse-url "http://localhost:1313"))))
(function org-hugo-new-subtree-post-capture-template))))))
;; 农历日历
(use-package cal-china-x