Compare commits

..

14 Commits

Author SHA1 Message Date
dcdfb57eb4 feat: Replace es-windows with windmove, improve org agenda sorting 2026-07-11 21:49:11 +08:00
User
4d1bb61eec feat(org): Update agenda commands and denote file filtering 2026-07-11 19:23:45 +08:00
User
c2af33247a feat(ai): Add opencode integration and reorganize AI tools 2026-07-11 19:01:59 +08:00
User
03fa5bbfd4 chore(straight): Switch to SSH protocol for personal forks 2026-07-11 18:59:32 +08:00
User
58e01139b5 feat: Integrate consult with xref and enhance denote backlink commands
- Configure consult-xref for xref-show-definitions and xref-show-xrefs
- Add custom denote backlink commands with consult preview support
- Replace denote-backlinks keybindings with new consult-enabled versions
- Fix hardcoded org path to use org-directory variable
2026-07-02 22:17:25 +08:00
User
ddd2ba4905 style: Convert tabs to spaces across Emacs config 2026-07-02 17:36:06 +08:00
User
abe00aa936 fix(base): Correct async package loading condition on Android 2026-07-02 17:33:25 +08:00
User
3aa98696cf refactor(kbd): Replace my-color-picker with consult-colors-emacs 2026-07-02 17:09:30 +08:00
User
74691ac72b refactor(org): Centralize org-directory and simplify paths
- Replace scattered platform conditionals with unified `org-directory`
- Update todo keywords to include WAITING state
- Streamline capture templates
- Remove unused priority-based agenda custom commands
2026-07-02 17:09:30 +08:00
User
ffa5717770 feat: Add denote-lint, replace consult-note with consult-denote 2026-07-02 17:09:17 +08:00
User
a1a1797035 feat(org): Hide spaces between CJK and markup characters 2026-06-30 22:11:14 +08:00
User
97d0a4a3e4 refactor: Reorganize package configurations and fix bindings 2026-06-30 22:10:17 +08:00
User
8328d2a8ff fix: Replace projectile-ibuffer with project-ibuffer 2026-06-30 22:08:52 +08:00
959db450d7 fix(ui): Load correct theme on Android 2026-06-28 15:49:31 +08:00
24 changed files with 603 additions and 494 deletions

View File

@@ -1,4 +1,4 @@
;;; init.el --- init.el -*- lexical-binding: t -*-
;;; init.el --- init.el -*- lexical-binding: t -*-
;;; Commentary:
;; trogloxene's Emacs
@@ -6,7 +6,7 @@
;;; Code:
(add-to-list 'load-path
(expand-file-name (concat user-emacs-directory "lisp")))
(expand-file-name (concat user-emacs-directory "lisp")))
(setq custom-file (expand-file-name "custom.el" user-emacs-directory))
(load custom-file t)

View File

@@ -1,4 +1,4 @@
;;; fix-dirvish-preview.el --- fix dirvish preview on windows -*- lexical-binding: t -*-
;;; fix-dirvish-preview.el --- fix dirvish preview on windows -*- lexical-binding: t -*-
;;; Commentary:
;; Fix video-mtn preview issue on Windows

View File

@@ -38,7 +38,7 @@
:demand t
:hook
(emacs-startup . (lambda ()
(unless (server-running-p)
(unless (server-running-p)
(server-mode 1)))))
;; recentf最近打开的文件
@@ -50,9 +50,9 @@
(setq recentf-max-saved-items 30)
:config
(if *is-android*
(add-to-list 'recentf-exclude "~/storage/shared/my-org-note/journal/.*\\.org\\'")
(add-to-list 'recentf-exclude "~/org/my-org-note/journal/.*\\.org\\'")
(add-to-list 'recentf-exclude "~/org/my-org-note/20260509T232442==agenda--all-my-todos__org\\.org"))
(add-to-list 'recentf-exclude "~/storage/shared/my-org-note/journal/.*\\.org\\'")
(add-to-list 'recentf-exclude "~/org/my-org-note/journal/.*\\.org\\'")
(add-to-list 'recentf-exclude "~/org/my-org-note/20260509T232442==agenda--all-my-todos__org\\.org"))
(add-to-list 'recentf-exclude "~/.emacs.d/emms/history")
(add-to-list 'recentf-exclude "~/.emacs.d/bookmarks")))
@@ -62,14 +62,13 @@
(after-init . savehist-mode)
:init
(setq enable-recursive-minibuffers t
history-length 50
savehist-additional-variables '(mark-ring
global-mark-ring
search-ring
regexp-search-ring
extended-command-history)
savehist-ignored-variables '(consult-notes-history)
savehist-autosave-interval 300))
history-length 50
savehist-additional-variables '(mark-ring
global-mark-ring
search-ring
regexp-search-ring
extended-command-history)
savehist-autosave-interval 300))
;; saveplace保存光标位置
(use-package saveplace
@@ -80,11 +79,11 @@
(use-package restart-emacs)
;; async
(if *is-android*
(use-package async
:hook
(after-init . dired-async-mode)
(after-init . async-bytecomp-package-mode)))
(unless *is-android*
(use-package async
:hook
(after-init . dired-async-mode)
(after-init . async-bytecomp-package-mode)))
;; autorevert buffer
(use-package autorevert
@@ -108,105 +107,115 @@
(use-package ibuffer
:config
(setq ibuffer-saved-filter-groups
'(("Main"
("App" (mode . exwm-mode))
("Scratch" (or
(name . "^*scratch")))
("eww" (or
(mode . eww-mode)
(mode . eww-bookmark-mode)
(mode . eww-buffers-mode)
(mode . eww-history-mode)))
("Calc" (or
(mode . calc-mode)
(mode . calc-trail-mode)))
("Shell" (or
(mode . eshell-mode)
(mode . eat-mode)
(mode . vterm-mode)))
("Scripts" (or
'(("Main"
("App" (mode . exwm-mode))
("Scratch" (or
(name . "^*scratch")))
("eww" (or
(mode . eww-mode)
(mode . eww-bookmark-mode)
(mode . eww-buffers-mode)
(mode . eww-history-mode)))
("AI" (or
(name . "^\\*OpenCode")
(name . "\\*opencode-serve\\*")
(name . "^\\*gptel")))
("Calc" (or
(mode . calc-mode)
(mode . calc-trail-mode)))
("Text" (or
(mode . org-mode)
(mode . markdown-mode)
(name . "^\\*\\[D\\] FILE backlinks for")))
("Shell" (or
(mode . eshell-mode)
(mode . eat-mode)
(mode . vterm-mode)))
("Scripts" (or
(mode . shell-script-mode)
(mode . shell-mode)
(mode . sh-mode)
(mode . lua-mode)
(mode . bat-mode)))
("Config" (or
(mode . conf-mode)
(mode . conf-desktop-mode)
(mode . conf-toml-mode)
(mode . conf-xdefaults-mode)))
("Elisp" (mode . emacs-lisp-mode))
("Scheme" (or
(mode . scheme-mode)))
("Geiser" (or
(name . "^Geiser")
(mode . geiser-repl-mode)
(mode . geiser-debug-mode)
(mode . geiser-messages-mode)
(mode . geiser-debug-mode)
(mode . geiser-doc-mode)
(mode . geiser-autodoc-mode)))
("gptel" (or
(name . "^\\*gptel")))
("Common-lisp" (or
(mode . common-lisp-mode)
(mode . lisp-mode)))
("Sly" (or
(mode . lisp-data-mode)
(mode . sly-db-mode)
(mode . sly-mrepl-mode)
(name . "\\*sly-compilation\\*")
(name . "^\\*img-cache\\*")))
("Text" (or
(mode . org-mode)
(mode . markdown-mode)
(name . "^\\*\\[D\\] FILE backlinks for")))
("Help" (or
(mode . help-mode)
(mode . helpful-mode)))
("Info" (or
(name . "^\\*info")))
("Magit" (or
("Config" (or
(mode . conf-mode)
(mode . conf-desktop-mode)
(mode . conf-toml-mode)
(mode . conf-xdefaults-mode)))
("Elisp" (mode . emacs-lisp-mode))
("Scheme" (or
(mode . scheme-mode)))
("Geiser" (or
(name . "^Geiser")
(mode . geiser-repl-mode)
(mode . geiser-debug-mode)
(mode . geiser-messages-mode)
(mode . geiser-debug-mode)
(mode . geiser-doc-mode)
(mode . geiser-autodoc-mode)))
("Common-lisp" (or
(mode . common-lisp-mode)
(mode . lisp-mode)))
("Sly" (or
(mode . lisp-data-mode)
(mode . sly-db-mode)
(mode . sly-mrepl-mode)
(name . "\\*sly-compilation\\*")
(name . "^\\*img-cache\\*")))
("Config" (or
(mode . conf-mode)
(mode . conf-toml-mode)
(mode . conf-unix-mode)
(mode . yaml-ts-mode)))
("Help" (or
(mode . help-mode)
(mode . helpful-mode)))
("Info" (or
(name . "^\\*info")))
("Magit" (or
(mode . magit-blame-mode)
(mode . magit-cherry-mode)
(mode . magit-diff-mode)
(mode . magit-log-mode)
(mode . magit-process-mode)
(mode . magit-status-mode)
(mode . magit-revision-mode)
(mode . magit-refs-mode)))
("Directories" (or
(mode . dired-mode)
(name . "^*dirvish")))
("Grep" (or
(mode . grep-mode)
(mode . rg-mode)
(mode . xref--xref-buffer-mode)
(mode . xref-edit-mode)
(mode . occur-mode)
(mode . occur-edit-mode)))
("Diff" (name . "^*Diff"))
("Emacs" (or
(mode . magit-revision-mode)
(mode . magit-refs-mode)))
("Directories" (or
(mode . dired-mode)
(name . "^*dirvish")))
("Grep" (or
(mode . grep-mode)
(mode . rg-mode)
(mode . xref--xref-buffer-mode)
(mode . xref-edit-mode)
(mode . occur-mode)
(mode . occur-edit-mode)))
("Diff" (or
(name . "^*Diff")
(mode . ediff-mode)
(mode . vundo-diff-mode)))
("Emacs" (or
(name . "^\\*Help\\*$")
(name . "^\\*Custom.*")
(name . "^\\*EMMS Playlist\\*")
(name . "^\\*Messages\\*$")
(name . "*Chinese-word-segmentation*")
(name . "^*Buffer List*")
(name . "\\*discomfort\\*")
(mode . calendar-mode)
(mode . grep-mode)
(mode . proced-mode)
(mode . syncthing-mode))))))
(name . "*Chinese-word-segmentation*")
(name . "^*Buffer List*")
(name . "\\*discomfort\\*")
(mode . calendar-mode)
(mode . grep-mode)
(mode . proced-mode)
(mode . syncthing-mode))))))
(add-hook 'ibuffer-hook
(lambda () (ibuffer-switch-to-saved-filter-groups "Main")
(unless (eq ibuffer-sorting-mode 'alphabetic)
(ibuffer-do-sort-by-alphabetic))))
(lambda () (ibuffer-switch-to-saved-filter-groups "Main")
(unless (eq ibuffer-sorting-mode 'alphabetic)
(ibuffer-do-sort-by-alphabetic))))
(setq ibuffer-show-empty-filter-groups nil
ibuffer-use-other-window t
ibuffer-default-sorting-mode 'filename))
ibuffer-use-other-window t
ibuffer-default-sorting-mode 'filename))
(use-package simple
:straight nil
@@ -214,8 +223,8 @@
(after-init . size-indication-mode)
(after-init . column-number-mode)
:config
(setq kill-whole-line t ;kill-line删除换行符
set-mark-command-repeat-pop t)) ;更方便地pop mark
(setq kill-whole-line t ;kill-line删除换行符
set-mark-command-repeat-pop t)) ;更方便地pop mark
;; 滚动
(unless *is-mac*
@@ -225,10 +234,10 @@
(after-init . pixel-scroll-precision-mode)
:init
(setq scroll-preserve-screen-position t
scroll-conservatively 101)
scroll-conservatively 101)
:config
(advice-add 'pixel-scroll-precision :around
(lambda (orig event)
(lambda (orig event)
(cl-letf (((symbol-function 'device-class)
(lambda (&rest _) 'mouse)))
(funcall orig event))))))
@@ -238,11 +247,6 @@
:config
(setq eww-auto-rename-buffer t))
;; shr
(use-package shr
:config
(setq shr-inhibit-images nil))
(provide 'init-base)
;;; init-base.el ends here

View File

@@ -1,4 +1,4 @@
;;; init-completion.el --- completion config -*- lexical-binding: t -*-
;;; init-completion.el --- completion config -*- lexical-binding: t -*-
;;; Commentary:
@@ -26,29 +26,37 @@
(cond
(*is-windows*
(setq consult-locate-args (encode-coding-string "es.exe -i -p -r" 'gbk)
consult-ripgrep-args (encode-coding-string
"rg --null --line-buffered --color=never --max-columns=1000 --path-separator / --smart-case --no-heading --line-number"
'gbk))
consult-ripgrep-args (encode-coding-string
"rg --null --line-buffered --color=never --max-columns=1000 --path-separator / --smart-case --no-heading --line-number"
'gbk))
(add-to-list 'process-coding-system-alist '("es" gbk . gbk)))
(*is-mac*
(setq consult-locate-args "mdfind -name"))
(*is-linux*
(setq consult-locate-args "plocate --basename --ignore-case")))
;; help
(define-key consult-narrow-map (vconcat consult-narrow-key "?") #'consult-narrow-help)
(setq consult-narrow-key "<")
;; xref
(setq xref-show-definitions-function #'consult-xref)
(setq xref-show-xrefs-function #'consult-xref)
;; set some buffer filter
(setq consult-buffer-filter
(cl-union consult-buffer-filter
'("^\\*dirvish"
"^PREVIEW"
"^\\*helpful"
"^\\*Help"
"Diff"
"straight"
"\\*Messages\\*"
"\\*Chinese-word-segmentation\\*"
"\\*gptel-reasoning\\*"
"\\*gptel-log\\*")
:test 'equal)))
(cl-union consult-buffer-filter
'("^\\*dirvish"
"^PREVIEW"
"^\\*helpful"
"^\\*Help"
"Diff"
"straight"
"\\*Messages\\*"
"\\*Chinese-word-segmentation\\*"
"\\*gptel-reasoning\\*"
"\\*gptel-log\\*")
:test 'equal)))
;; embark快捷指令
(use-package embark
@@ -124,7 +132,7 @@ targets."
(add-hook 'eglot-managed-mode-hook
(lambda ()
(when (derived-mode-p 'scheme-mode)
(setq-local completion-at-point-functions
(setq-local completion-at-point-functions
(remq 'eglot-completion-at-point
completion-at-point-functions))))))
@@ -134,7 +142,7 @@ targets."
(corfu-quit consult-completion-in-region)
:bind
(:map corfu-map
("M-d" . corfu-popupinfo-documentation))
("M-d" . corfu-popupinfo-documentation))
:custom
(corfu-auto t)
(corfu-auto-prefix 2)
@@ -144,10 +152,10 @@ targets."
(corfu-auto-delay 0.2)
(corfu-popupinfo-delay '(0.4 . 0.2))
(global-corfu-modes '((not erc-mode
circe-mode
help-mode
gud-mode
vterm-mode)
circe-mode
help-mode
gud-mode
vterm-mode)
t))
:hook
(after-init . global-corfu-mode)
@@ -162,7 +170,7 @@ targets."
(local-set-key (kbd "TAB") 'completion-at-point)))
:bind
(:map corfu-map
("RET" . nil)))
("RET" . nil)))
(if (not (and (display-graphic-p)
(>= emacs-major-version 31)))

View File

@@ -9,15 +9,15 @@
:hook after-init
:config
(setq dashboard-banner-logo-title (format "%s" emacs-version)
dashboard-banner-ascii " ##### # # # # ####### # # # ##### ##### \n# # ## # # # # ## ## # # # # # # \n# # # # # # # # # # # # # # # \n# #### # # # # # ##### # # # # # # ##### \n# # # # # # # # # # ####### # # \n# # # ## # # # # # # # # # # # \n ##### # # ##### ####### # # # # ##### ##### "
dashboard-startup-banner 'ascii
dashboard-footer-messages '("hello")
dashboard-center-content t
dashboard-navigation-cycle t
dashboard-items '((recents . 8)
dashboard-banner-ascii " ##### # # # # ####### # # # ##### ##### \n# # ## # # # # ## ## # # # # # # \n# # # # # # # # # # # # # # # \n# #### # # # # # ##### # # # # # # ##### \n# # # # # # # # # # ####### # # \n# # # ## # # # # # # # # # # # \n ##### # # ##### ####### # # # # ##### ##### "
dashboard-startup-banner 'ascii
dashboard-footer-messages '("hello")
dashboard-center-content t
dashboard-navigation-cycle t
dashboard-items '((recents . 8)
(bookmarks . 5)
(projects . 5))
dashboard-item-shortcuts '((recents . "r") (bookmarks . "b") (projects . "p") (agenda . "a") (registers . "e")))
dashboard-item-shortcuts '((recents . "r") (bookmarks . "b") (projects . "p") (agenda . "a") (registers . "e")))
(dashboard-setup-startup-hook))
(provide 'init-dashboard)

View File

@@ -9,25 +9,25 @@
:config
(when *is-mac*
(setq insert-directory-program "gls"
dired-use-ls-dired t))
dired-use-ls-dired t))
(setq dired-dwim-target t
dired-listing-switches
"-l --almost-all --human-readable --group-directories-first --no-group"
dired-recursive-deletes 'always
dired-recursive-copies 'always
dired-mouse-drag-files t
mouse-drag-and-drop-region-cross-program t
dired-compress-file-default-suffix ".zip"
dired-kill-when-opening-new-dired-buffer nil
dired-auto-revert-buffer t
dired-create-destination-dirs 'ask
dired-create-destination-dirs-on-trailing-dirsep t)
dired-listing-switches
"-l --almost-all --human-readable --group-directories-first --no-group"
dired-recursive-deletes 'always
dired-recursive-copies 'always
dired-mouse-drag-files t
mouse-drag-and-drop-region-cross-program t
dired-compress-file-default-suffix ".zip"
dired-kill-when-opening-new-dired-buffer nil
dired-auto-revert-buffer t
dired-create-destination-dirs 'ask
dired-create-destination-dirs-on-trailing-dirsep t)
(put 'dired-find-alternate-file 'disabled nil))
;; dirvish
(use-package dirvish
:straight
'(dirvish :fork (:host github :repo "latiagertrutis/dirvish"))
(dirvish :fork (:host github :repo "latiagertrutis/dirvish"))
:init
(dirvish-override-dired-mode)
:config
@@ -41,15 +41,15 @@
(if *is-android*
(setq dirvish-default-layout nil
dirvish-layout-recipes '((1 0.6)))
dirvish-layout-recipes '((1 0.6)))
(setq dirvish-default-layout nil
dirvish-layout-recipes '((1 0.15 0.45))))
dirvish-layout-recipes '((1 0.15 0.45))))
(setq dirvish-use-mode-line t
dirvish-mode-line-format '(:left (sort omit symlink) :right (free-space index))
dirvish-attributes '(file-time file-size)
dirvish-yank-sources 'session
dirvish-hide-cursor nil)
dirvish-mode-line-format '(:left (sort omit symlink) :right (free-space index))
dirvish-attributes '(file-time file-size)
dirvish-yank-sources 'session
dirvish-hide-cursor nil)
:custom
(dirvish-quick-access-entries
@@ -94,20 +94,20 @@
(dirvish dirvish-vc transient)
:demand t
:config
(transient-define-suffix dirvish-toggle-gitignore ()
"Toggle `dired-gitignore-mode' in current Dirvish buffer."
:description
(lambda ()
(format "Gitignore filter (%s)"
(if dired-gitignore-mode
(propertize "+" 'face 'transient-value)
(propertize "-" 'face 'transient-inactive-value))))
:transient t
(interactive)
(dired-gitignore-mode 'toggle))
(transient-define-suffix dirvish-toggle-gitignore ()
"Toggle `dired-gitignore-mode' in current Dirvish buffer."
:description
(lambda ()
(format "Gitignore filter (%s)"
(if dired-gitignore-mode
(propertize "+" 'face 'transient-value)
(propertize "-" 'face 'transient-inactive-value))))
:transient t
(interactive)
(dired-gitignore-mode 'toggle))
(transient-append-suffix 'dirvish-vc-menu "v"
'("i" dirvish-toggle-gitignore)))
(transient-append-suffix 'dirvish-vc-menu "v"
'("i" dirvish-toggle-gitignore)))
;; trashed
(use-package trashed
@@ -115,24 +115,24 @@
(trashed)
:config
(setq trashed-action-confirmer 'y-or-n-p
trashed-use-header-line t
trashed-sort-key '("Date deleted" . t)
trashed-date-format "%Y-%m-%d %H:%M:%S"))
trashed-use-header-line t
trashed-sort-key '("Date deleted" . t)
trashed-date-format "%Y-%m-%d %H:%M:%S"))
;; discomfort挂载硬盘
(when *is-linux*
(use-package debase
:straight
(debase :type git
:host codeberg
:repo "emacs-weirdware/debase"))
:host codeberg
:repo "emacs-weirdware/debase"))
(use-package discomfort
:commands discomfort
:straight
(discomfort :type git
:host codeberg
:repo "emacs-weirdware/discomfort")))
:host codeberg
:repo "emacs-weirdware/discomfort")))
(provide 'init-dired)

View File

@@ -1,4 +1,4 @@
;;; init-edit.el --- edit and navigate -*- lexical-binding: t -*-
;;; init-edit.el --- edit and navigate -*- lexical-binding: t -*-
;;; Commentary:
@@ -13,7 +13,7 @@
(use-package elec-pair
:config
(setq electric-pair-inhibit-predicate 'electric-pair-conservative-inhibit
electric-pair-pairs (append '((?\= . ?\=)) electric-pair-pairs)))
electric-pair-pairs (append '((?\= . ?\=)) electric-pair-pairs)))
;; multiple-cursors
(use-package multiple-cursors
@@ -22,20 +22,20 @@
(mc/always-run-for-all t)
:init
(setq mc/cmds-to-run-once
'(god-mode-all
hydra-multiple-cursors/body
hydra-multiple-cursors/mc/edit-lines
hydra-multiple-cursors/mc/insert-numbers
hydra-multiple-cursors/mc/mark-all-dwim
hydra-multiple-cursors/mc/mark-next-like-this
hydra-multiple-cursors/mc/mark-next-like-this-symbol
hydra-multiple-cursors/mc/mark-next-like-this-word
hydra-multiple-cursors/mc/mark-previous-like-this
hydra-multiple-cursors/mc/mark-previous-like-this-symbol
hydra-multiple-cursors/mc/mark-previous-like-this-word
hydra-multiple-cursors/mc/unmark-next-like-this
hydra-multiple-cursors/mc/unmark-previous-like-this
hydra-multiple-cursors/nil)))
'(god-mode-all
hydra-multiple-cursors/body
hydra-multiple-cursors/mc/edit-lines
hydra-multiple-cursors/mc/insert-numbers
hydra-multiple-cursors/mc/mark-all-dwim
hydra-multiple-cursors/mc/mark-next-like-this
hydra-multiple-cursors/mc/mark-next-like-this-symbol
hydra-multiple-cursors/mc/mark-next-like-this-word
hydra-multiple-cursors/mc/mark-previous-like-this
hydra-multiple-cursors/mc/mark-previous-like-this-symbol
hydra-multiple-cursors/mc/mark-previous-like-this-word
hydra-multiple-cursors/mc/unmark-next-like-this
hydra-multiple-cursors/mc/unmark-previous-like-this
hydra-multiple-cursors/nil)))
;; crux实用函数
(use-package crux)
@@ -50,7 +50,7 @@
(use-package undo-fu
:config
(setq undo-in-region t
undo-fu-allow-undo-in-region t))
undo-fu-allow-undo-in-region t))
(use-package undo-fu-session
:hook
@@ -60,8 +60,8 @@
(use-package vundo
:init
(setq undo-limit 800000
undo-strong-limit 1200000
undo-outer-limit 12000000))
undo-strong-limit 1200000
undo-outer-limit 12000000))
;; expand-region快速展开选中
(use-package expand-region
@@ -89,15 +89,15 @@
:config
(unless (or *is-android* (not use-package-always-defer)) (which-key-enable-god-mode-support))
(setq god-mode-enable-function-key-translation nil
god-exempt-major-modes
(cl-union '(diff-mode exwm-mode) god-exempt-major-modes :test 'equal)
god-mode-lighter-string "THANK-GOD-MODE")
god-exempt-major-modes
(cl-union '(diff-mode exwm-mode) god-exempt-major-modes :test 'equal)
god-mode-lighter-string "THANK-GOD-MODE")
(defun my-sync-god-mode-lighter-face (&rest _)
(set-face-attribute 'god-mode-lighter nil
:inherit 'isearch-fail
:background (face-attribute 'mode-line :background nil t)
:weight 'bold))
:inherit 'isearch-fail
:background (face-attribute 'mode-line :background nil t)
:weight 'bold))
(my-sync-god-mode-lighter-face)
(add-hook 'enable-theme-functions #'my-sync-god-mode-lighter-face)
@@ -106,7 +106,7 @@
'relative
t)))
(unless (or (eq display-line-numbers desired) (bound-and-true-p olivetti-mode))
(setq display-line-numbers desired))))
(setq display-line-numbers desired))))
(add-hook 'post-command-hook #'my-sync-line-numbers-with-god-mode))
(provide 'init-edit)

View File

@@ -1,4 +1,4 @@
;;; init-elpa.el --- package manager -*- lexical-binding: t -*-
;;; init-elpa.el --- package manager -*- lexical-binding: t -*-
;;; Commentary:
@@ -6,9 +6,6 @@
;; straight.el
;; 使用ssh
(setq straight-vc-git-default-protocol 'ssh)
(defvar bootstrap-version)
(let ((bootstrap-file
(expand-file-name

View File

@@ -1,4 +1,4 @@
;;; init-exwm.el --- exwm config -*- lexical-binding: t -*-
;;; init-exwm.el --- exwm config -*- lexical-binding: t -*-
;;; Commentary:
@@ -58,7 +58,7 @@
?\M-]
?\s-[
?\s-]
?\s-
?\s-
XF86AudioLowerVolume
XF86AudioRaiseVolume
XF86AudioMute
@@ -75,7 +75,7 @@
([?\s-s] . desktop-environment-screenshot-part)
([?\s-w] . exwm-workspace-switch)
([?\s-o] . other-window)
([?\s-m] . exwm-layout-toggle-mode-line)
([?\s-m] . exwm-layout-toggle-mode-line)
([?\s-`] . (lambda () (interactive) (exwm-workspace-switch-create 0)))
,@(mapcar (lambda (i)
`(,(kbd(format "s-%d" i)) .
@@ -85,25 +85,25 @@
(number-sequence 0 9))))
(setq exwm-input-simulation-keys
`((,(kbd "C-f") . [right])
(,(kbd "C-b") . [left])
(,(kbd "C-p") . [up])
(,(kbd "C-n") . [down])
(,(kbd "C-a") . [home])
(,(kbd "C-e") . [end])
(,(kbd "M-f") . [C-right])
(,(kbd "A-f") . [C-right])
(,(kbd "M-b") . [C-left])
(,(kbd "A-b") . [C-left])
(,(kbd "C-d") . [delete])
(,(kbd "C-k") . [S-end delete])
(,(kbd "M-<backspace>") . ,(kbd "C-<backspace>"))
(,(kbd "M-d") . ,(kbd "C-<delete>"))
(,(kbd "M-w") . [?\C-c])
(,(kbd "C-y") . [?\C-v])
(,(kbd "C-w") . [?\C-x])
(,(kbd "C-/") . [?\C-z])
(,(kbd "C-?") . ,(kbd "C-S-z"))))
`((,(kbd "C-f") . [right])
(,(kbd "C-b") . [left])
(,(kbd "C-p") . [up])
(,(kbd "C-n") . [down])
(,(kbd "C-a") . [home])
(,(kbd "C-e") . [end])
(,(kbd "M-f") . [C-right])
(,(kbd "A-f") . [C-right])
(,(kbd "M-b") . [C-left])
(,(kbd "A-b") . [C-left])
(,(kbd "C-d") . [delete])
(,(kbd "C-k") . [S-end delete])
(,(kbd "M-<backspace>") . ,(kbd "C-<backspace>"))
(,(kbd "M-d") . ,(kbd "C-<delete>"))
(,(kbd "M-w") . [?\C-c])
(,(kbd "C-y") . [?\C-v])
(,(kbd "C-w") . [?\C-x])
(,(kbd "C-/") . [?\C-z])
(,(kbd "C-?") . ,(kbd "C-S-z"))))
(defun my-exwm-update-class ()
(exwm-workspace-rename-buffer exwm-class-name))
@@ -128,21 +128,21 @@
"import -window root ~/Pictures/screenshot-$(date +%Y%m%d-%H%M%S).png")
(desktop-environment-screenshot-partial-command
"import ~/Pictures/screenshot-$(date +%Y%m%d-%H%M%S).png"))
(use-package xdg-launcher
:demand t
:after exwm
:straight
(xdg-launcher :type git
:host github
:repo "emacs-exwm/xdg-launcher")
:host github
:repo "emacs-exwm/xdg-launcher")
:bind
(("s-SPC" . xdg-launcher-run-app))
:init
(with-eval-after-load 'consult
(unless (memq 'xdg-launcher-consult-source consult-buffer-sources)
(setq consult-buffer-sources
(append consult-buffer-sources '(xdg-launcher-consult-source)))))))
(setq consult-buffer-sources
(append consult-buffer-sources '(xdg-launcher-consult-source)))))))
(when *is-mac*
;; launcher

View File

@@ -1,4 +1,4 @@
;;; init-gptel.el --- ai -*- lexical-binding: t -*-
;;; init-gptel.el --- ai -*- lexical-binding: t -*-
;;; Commentary:
@@ -7,8 +7,8 @@
(use-package gptel
:config
(setq gptel-log-level t
gptel-default-mode 'org-mode
gptel-include-reasoning "*gptel-reasoning*")
gptel-default-mode 'org-mode
gptel-include-reasoning "*gptel-reasoning*")
(add-hook 'gptel-post-response-functions 'gptel-end-of-response)
(add-hook 'gptel-post-stream-hook 'gptel-auto-scroll)
(setq gptel-prompt-prefix-alist '((markdown-mode . "## User: ") (org-mode . "** User: ") (text-mode . "## User: ")))
@@ -35,7 +35,7 @@
:stream t
:models '(kimi-for-coding)
:header (lambda (_)
(when-let ((key (gptel--get-api-key)))
(when-let* ((key (gptel--get-api-key)))
`(("User-Agent" . "RooCode/3.30.3")
("HTTP-Referer" . "https://github.com/RooVetGit/Roo-Cline")
("X-Title" . "Roo Code")
@@ -53,7 +53,8 @@
(string-trim clean)))
(defun my-gptel-save-session ()
"Save current gptel session to ~/gptel/sessions/ with AI-generated filename.
"Save current gptel session to ~/gptel/sessions/ with AI-generated
filename.
The filename is prefixed with a YYYYMMDD-HHmmss timestamp and generated
from the last 1500 characters of the buffer."
(interactive)
@@ -63,11 +64,15 @@ from the last 1500 characters of the buffer."
(content (with-current-buffer buf
(buffer-substring-no-properties (point-min) (point-max))))
(tail (substring content (max 0 (- (length content) 1500))))
(prompt-text (format "Based on the following conversation, generate a short kebab-case filename (3 to 5 lowercase English words, hyphen-separated, no file extension). Output ONLY the filename, nothing else.\n\n%s"
(prompt-text (format "Based on the following conversation, generate a short kebab-case
filename (3 to 5 lowercase English words, hyphen-separated, no file
extension). Output ONLY the filename, nothing else.\n\n%s"
tail)))
(message "Generating filename with AI...")
(let ((fsm (gptel-request prompt-text
:system "You are a filename generator. Output ONLY a short kebab-case filename (3-5 lowercase English words separated by hyphens). No explanations, no quotes, no punctuation, no file extension."
:system "You are a filename generator. Output ONLY a short kebab-case
filename (3-5 lowercase English words separated by hyphens). No
explanations, no quotes, no punctuation, no file extension."
:stream nil
:callback
(lambda (response info)
@@ -117,7 +122,7 @@ from the last 1500 characters of the buffer."
(use-package gptel-magit
:straight
'(gptel-magit :fork (:host github :repo "ArthurHeymans/gptel-magit"))
(gptel-magit :fork (:host github :repo "ArthurHeymans/gptel-magit"))
:hook
(magit-mode . gptel-magit-install)
:init
@@ -132,7 +137,7 @@ from the last 1500 characters of the buffer."
:models '((kimi-for-coding))
:request-params '(:temperature 0.6 :thinking (:type "disabled"))
:header (lambda (_)
(when-let ((key (gptel--get-api-key)))
(when-let* ((key (gptel--get-api-key)))
`(("User-Agent" . "RooCode/3.30.3")
("HTTP-Referer" . "https://github.com/RooVetGit/Roo-Cline")
("X-Title" . "Roo Code")
@@ -141,6 +146,41 @@ from the last 1500 characters of the buffer."
(setq gptel-magit-model 'kimi-for-coding
gptel-magit-backend (gptel-get-backend "gptel-Kimi-Code-magit"))))
(use-package plz
:straight
(plz :type git
:host github
:repo "alphapapa/plz.el"
:ref "v0.9.1"))
(use-package plz-media-type
:straight
(plz-media-type :type git
:host github
:repo "r0man/plz-media-type"
:ref "v0.2.4"))
(use-package plz-event-source
:straight
(plz-event-source :type git
:host github
:repo "r0man/plz-event-source"
:ref "v0.1.3"))
(use-package opencode
:straight
(opencode :type git
:host codeberg
:repo "sczi/opencode.el")
:hook
(opencode-session-control-mode . disable-truncate-lines))
(use-package eval-elisp-mcp
:straight
(eval-elisp-mcp :type git
:host codeberg
:repo "sczi/eval-elisp-mcp"))
(provide 'init-gptel)
;;; init-gptel.el ends here

View File

@@ -1,4 +1,4 @@
;;; init-kbd-func.el --- functions for keybindings -*- lexical-binding: t -*-
;;; init-kbd-func.el --- functions for keybindings -*- lexical-binding: t -*-
;;; Commentary:
@@ -55,11 +55,11 @@ otherwise toggle global-jinx-mode."
(fboundp 'w32-shell-execute))
(shell-command-to-string
(encode-coding-string
(replace-regexp-in-string "/" "\\\\"
(format "explorer.exe %s"
(file-name-directory
(expand-file-name file))))
'gbk))
(replace-regexp-in-string "/" "\\\\"
(format "explorer.exe %s"
(file-name-directory
(expand-file-name file))))
'gbk))
(call-process (pcase system-type
('darwin "open")
('cygwin "cygstart")
@@ -93,7 +93,7 @@ otherwise toggle global-jinx-mode."
"Return the path of current denote journal if it exists, otherwise return nil."
(require 'denote-journal)
(let* ((internal-date
(denote-journal--date-in-interval-p (or date (current-time)) interval))
(denote-journal--date-in-interval-p (or date (current-time)) interval))
(files (denote-journal--get-entry internal-date interval)))
(if files
(denote-journal-select-file-prompt files))))
@@ -110,9 +110,36 @@ otherwise toggle global-jinx-mode."
`~/org/my-org-note/20260508T220745==metanote--all-my-metanotes__org.org'"
(interactive)
(find-file
"~/org/my-org-note/20260508T220745==metanote--all-my-metanotes__org.org"))
(concat org-directory "/20260508T220745==metanote--all-my-metanotes__org.org")))
(defun org-table-align-all ()
(defun my-denote-find-file ()
"Find file use denote-file-prompt."
(interactive)
(let ((denote-excluded-files-regexp "=journal\\|=archive"))
(find-file (denote-file-prompt))))
(defun my-denote-find-backlink-with-location ()
"Like `denote-find-backlink-with-location' but with consult preview."
(interactive)
(when-let* ((current-file buffer-file-name)
(id (or (denote-retrieve-filename-identifier current-file)
(user-error "The current file does not have a Denote identifier")))
(files (denote-directory-files nil :omit-current :text-only))
(fetcher (lambda () (xref-matches-in-files id files))))
(consult-xref fetcher nil)))
(defun my-denote-org-find-backlink-for-heading-with-location ()
"Like `denote-org-backlinks-for-heading' but with consult preview."
(interactive)
(unless (featurep 'denote-org)
(require 'denote-org))
(when-let* ((heading-id (or (denote-org--get-file-id-and-heading-id-or-context)
(user-error "The current file does not have a denote identifier")))
(files (denote-directory-files nil :omit-current :text-only))
(fetcher (lambda () (xref-matches-in-files heading-id files))))
(consult-xref fetcher nil)))
(defun my-org-table-align-all ()
"Ajust all table in current buffer."
(interactive)
(save-excursion
@@ -128,9 +155,9 @@ otherwise toggle global-jinx-mode."
"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/")))
(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))
(message "Adding files...")
@@ -140,15 +167,15 @@ otherwise toggle global-jinx-mode."
(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)))))
(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/"
"h:/emacs/hugo/this-is-my-blog/"
"~/org/hugo/this-is-my-blog/")))
(start-process "hugo-server" "*hugo-server*"
"hugo" "server" "-D" "--bind" "0.0.0.0" "--port" "1313")
@@ -166,8 +193,8 @@ otherwise toggle global-jinx-mode."
(when (eq major-mode 'org-mode)
(setq-local header-line-format nil
mode-line-format nil
cursor-type 'hbar
olivetti-body-width 100)
cursor-type 'hbar
olivetti-body-width 100)
(blink-cursor-mode -1)
(cnfonts-increase-fontsize 3)
(hl-line-mode 'toggle)
@@ -245,24 +272,30 @@ argument)."
(let ((current-prefix-arg '-))
(call-interactively 'gptel-agent)))
(defun my-opencode ()
"Run `opencode' in project root."
(interactive)
(let ((default-directory (project-root (project-current t))))
(opencode)))
(defun my-consult-ripgrep-project ()
"Run `consult-ripgrep' in current project's root."
(interactive)
(when-let* ((proj (project-current t)))
(consult-ripgrep (project-root proj))))
(defun my-color-picker ()
"Pick a color with preview."
(interactive)
(let* ((colors (defined-colors))
(choice (completing-read
"Color: "
(mapcar (lambda (c)
(propertize
(format "%-20s %s" c "████")
'face `(:foreground ,c)))
colors))))
(string-trim (car (split-string choice)))))
(defun consult-colors-emacs (color)
"Show a list of all supported colors for a particular frame.
You can insert the name (default), or insert or kill the hexadecimal or RGB
value of the selected COLOR."
(interactive
(list (consult--read (list-colors-duplicates (defined-colors))
:prompt "Emacs color: "
:require-match t
:category 'color
:history '(:input consult-colors-history))))
(insert color))
(defun fix-theme-colors ()
"Fix invalid color name in theme files."
@@ -297,9 +330,9 @@ argument)."
"Kill and restart fcitx5, to fix random issues in exwm."
(interactive)
(if (zerop (shell-command "pgrep fcitx5"))
(progn
(eshell-command "pkill fcitx5")
(eshell-command "fcitx5 -d"))
(progn
(eshell-command "pkill fcitx5")
(eshell-command "fcitx5 -d"))
(eshell-command "fcitx5 -d"))))
(provide 'init-kbd-func)

View File

@@ -19,16 +19,35 @@
;; g for gptel
(general-def
:prefix "C-c g"
"o" 'gptel
"g" 'gptel
"m" 'gptel-menu
"s" 'gptel-send
"a" 'gptel-agent
"t" 'gptel-tools)
"t" 'gptel-tools
"o" 'opencode
"p" 'opencode-select-project
"l" 'opencode-select-session
"n" 'opencode-new-session)
(general-def gptel-mode-map
"C-c C-s" 'my-gptel-save-session
"C-c C-k" 'gptel-abort)
;; opencode
(general-def opencode-session-mode-map
"C-c C-p" 'comint-previous-prompt
"C-c M-p" 'opencode-respond-permission
"C-c x" nil
"C-c C-k" 'opencode-abort-session
"C-c C-c" 'nil
"C-c n" 'nil
"C-c N" 'opencode-new-session)
(general-def opencode-session-control-mode-map
"n" 'next-line
"p" 'previous-line
"N" 'opencode-new-session)
;; u for ui
(general-def
:prefix "C-c u"
@@ -37,7 +56,7 @@
"R" 'rainbow-mode
"b" 'indent-bars-mode
"t" 'consult-theme
"c" 'my-color-picker
"c" 'consult-colors-emacs
"f" 'describe-face
"r" 'rainbow-delimiters-mode
"k" 'keycast-header-line-mode
@@ -68,8 +87,8 @@
"R" 'project-query-replace-regexp
"v" 'magit-project-status
"V" 'project-vc-dir
"a" 'my-gptel-agent-project
"i" 'projectile-ibuffer)
"a" 'my-opencode
"i" 'project-ibuffer)
;; v for version control
(general-def
@@ -91,9 +110,9 @@
;; o for org-mode
(general-def
:prefix "C-c o"
"f" 'consult-notes
"f" 'my-denote-find-file
"g" 'consult-denote-grep
"s" 'consult-org-agenda
"g" 'consult-notes-search-in-all-notes
"C" 'calendar
"c" 'org-capture
"d" 'denote
@@ -196,10 +215,10 @@
;; eat
(general-def (eat-semi-char-mode-map
eat-line-mode-map
eat-char-mode-map
eat-eshell-semi-char-mode-map
eat-eshell-char-mode-map)
eat-line-mode-map
eat-char-mode-map
eat-eshell-semi-char-mode-map
eat-eshell-char-mode-map)
"M-[" nil
"M-]" nil)
@@ -232,8 +251,8 @@
"C-," 'crux-duplicate-current-line-or-region
"C-c o l" 'denote-link
"C-c o L" 'denote-org-link-to-heading
"C-c o b" 'denote-backlinks
"C-c o B" 'denote-org-backlinks-for-heading
"C-c o b" 'my-denote-find-backlink-with-location
"C-c o B" 'my-denote-org-find-backlink-for-heading-with-location
"C-c o t" 'my-org-tree-slide-start)
;; org-tree-slide-mode

View File

@@ -1,4 +1,4 @@
;;; init-org.el --- org-mode config -*- lexical-binding: t -*-
;;; init-org.el --- org-mode config -*- lexical-binding: t -*-
;;; Commentary:
@@ -11,7 +11,24 @@
(org-mode . my-org-electric-pair-fix)
(org-mode . electric-pair-local-mode)
:init
(setq org-directory
(cond
(*is-windows* "h:/emacs/my-org-note")
(*is-mac* "~/org/my-org-note")
(*is-linux* "~/org/my-org-note")
(*is-android* "~/storage/shared/my-org-note")))
:config
(defvar org-hide-space-keywords
'(("\\cc\\( \\)[*/_=~+]\\cc.*?[*/_=~+]"
(0 (prog1 () (add-text-properties (match-beginning 1) (match-end 1) '(invisible t)))))
("[*/_=~+].*?\\cc[*/_=~+]\\( \\)\\cc"
(0 (prog1 () (add-text-properties (match-beginning 1) (match-end 1) '(invisible t)))))))
(font-lock-add-keywords 'org-mode org-hide-space-keywords 'append)
(add-to-list 'org-src-lang-modes '("yaml" . yaml-ts))
(if *is-windows*
(add-hook 'org-mode-hook 'font-lock-update))
@@ -20,37 +37,28 @@
(defun my-org-electric-pair-fix ()
(setq-local electric-pair-inhibit-predicate
(lambda (char)
(lambda (char)
(or (eq char ?<)
(electric-pair-default-inhibit char)))))
;; log默认放入drawer中
(setq org-log-done t
org-log-into-drawer t)
org-log-into-drawer t)
;; 不要在capture时设置bookmark
(setq org-bookmark-names-plist nil)
;; 设置todo关键字
(setq org-todo-keywords
(quote ((sequence "TODO(t)" "STARTED(S)" "|" "DONE(d!/!)")
(sequence "IDKY(i)" "SOMEDAY(s)" "|" "CANCELLED(c@/!)"))))
(quote ((sequence "TODO(t)" "SOMEDAY(S)" "STARTED(s)" "WAITING(w)" "|" "DONE(d!/!)" "CANCELLED(c@/!)")
(sequence "IDKY(i)" "|" "KNOWN(k)" "CANCELLED(c@/!)"))))
;; agenda相关
(cond
(*is-windows*
(setq org-agenda-files '("h:/emacs/hugo/this-is-my-blog/all-blog.org"
"h:/emacs/my-org-note/20260509T232442==agenda--all-my-todos__org.org")))
(*is-mac*
(setq org-agenda-files '("~/org/my-org-note/20260509T232442==agenda--all-my-todos__org.org")))
(*is-linux*
(setq org-agenda-files '("~/org/my-org-note/20260509T232442==agenda--all-my-todos__org.org")))
(*is-android*
(setq org-agenda-files '("~/storage/shared/my-org-note/20260509T232442==agenda--all-my-todos__org.org"))))
(setq org-agenda-files `(,(concat org-directory "/20260509T232442==agenda--all-my-todos__org.org")))
(setq org-agenda-span 'day)
(setq org-agenda-skip-function-global
'(org-agenda-skip-entry-if 'todo '("COMMENT"))))
'(org-agenda-skip-entry-if 'todo '("COMMENT"))))
;; phscroll优化表格换行
(use-package phscroll
@@ -75,26 +83,30 @@
:hook
(after-init . denote-rename-buffer-mode)
(dired-mode . denote-dired-mode)
:config
(cond
(*is-android*
(setq denote-directory "~/storage/shared/my-org-note/"))
(*is-windows*
(setq denote-directory "H:/emacs/my-org-note/"))
(t
(setq denote-directory "~/org/my-org-note/")))
:init
(setq denote-prompts '(title signature keywords))
(setq denote-title-history nil)
(setq denote-signature-history
'("note" "project" "fun" "wisdom" "article" "data" "metanote" "agenda" "journal" "archive"))
(setq denote-known-keywords
'("emacs"))
(setq denote-title-history nil))
(setq denote-directory org-directory)
(setq denote-org-store-link-to-heading 'context
denote-prompts '(title signature keywords))
(setq denote-title-history nil
denote-signature-history
'("note" "project" "fun" "wisdom" "article" "data" "metanote" "agenda" "journal" "archive")
denote-known-keywords
'("emacs")
denote-title-history nil))
;; denote-org
(use-package denote-org)
;; denote-lint
(use-package denote-lint
:straight
(denote-lint :type git
:host github
:repo "Andsy10/denote-lint"
:protocol ssh)
:config
(setq org-link-elisp-confirm-function nil))
;; denote-journal
(use-package denote-journal
:hook
@@ -108,16 +120,12 @@
;; denote-explore
(use-package denote-explore)
;; consult-notes
(use-package consult-notes
:straight
'(consult-notes :fork (:host github :repo "Andsy10/consult-notes"))
;; consult-denote
(use-package consult-denote
:hook
(after-init . consult-notes-denote-mode)
:config
(setq consult-notes-denote-display-keywords-indicator "_")
(setq consult-notes-denote-display-id-format 'date)
(setq consult-notes-denote-display-signature t))
(after-init . consult-denote-mode)
:init
(setq consult-denote-grep-command 'consult-ripgrep))
;; org-download
(use-package org-download
@@ -127,12 +135,12 @@
(org-mode . org-link-preview-region)
:config
(setq-default org-download-image-dir "./images/"
org-download-heading-lvl nil)
org-download-heading-lvl nil)
(setq org-download-dragndrop t
org-download-method 'directory
org-image-actual-width nil
org-download-image-html-width 600
org-return-follows-link t))
org-download-method 'directory
org-image-actual-width nil
org-download-image-html-width 600
org-return-follows-link t))
;; org-ql
(use-package org-ql)
@@ -148,39 +156,34 @@
:hook
(org-agenda-finalize . disable-truncate-lines)
:config
(setq org-agenda-prefix-format '((agenda . " %?-12t% s")
(todo . " ")
(tags . " ")
(search . " ")))
(setq org-agenda-sorting-strategy
'((agenda time-up scheduled-up deadline-up priority-down category-keep)
(todo priority-down category-keep)
(tags priority-down category-keep)
(search category-keep)))
(setq org-agenda-custom-commands
'(("pa" "priority >= A"
((org-ql-block '(and (priority "A") (todo))
((org-ql-block-header "priority = A")))))
("pb" "priority >= B"
((org-ql-block '(and (priority >= "B") (todo))
((org-ql-block-header "priority >= B")
(org-super-agenda-groups
'((:name "priority = A" :priority "A")
(:name "priority = B" :priority "B")))))))
("pc" "priority >= C"
((org-ql-block '(and (priority >= "C") (todo))
((org-ql-block-header "priority >= C")
(org-super-agenda-groups
'((:name "priority = A" :priority "A")
(:name "priority = B" :priority "B")
(:name "priority = C" :priority "C")))))))
("qd" "TODO entries sort by closed time"
'(("qd" "TODO entries sort by closed time"
((org-ql-block '(closed)
((org-ql-block-header "Closed TODOs")
(org-super-agenda-groups
'((:auto-ts t)))))))
("qs" "SOMEDAYs"
("qS" "SOMEDAYs"
((org-ql-block '(todo "SOMEDAY")
((org-ql-block-header "SOMEDAYs")
(org-super-agenda-groups
'((:auto-ts t)))))))
("qS" "STARTEDs"
("qs" "STARTEDs"
((org-ql-block '(todo "STARTED")
((org-ql-block-header "STARTEDs")
(org-super-agenda-groups
'((:auto-ts t)))))))
("qt" "TODOs sort by start time"
("qt" "TODOs sort by start time"
((org-ql-block '(todo)
((org-ql-block-header "TODOs")
(org-super-agenda-groups
@@ -190,57 +193,43 @@
((org-ql-block-header "all TODOs")
(org-super-agenda-groups
'((:name "started" :todo "STARTED")
(:name "waiting" :todo "WAITING")
(:name "priority = A" :priority "A")
(:name "priority = B" :priority "B")
(:name "priority = C" :priority "C")
(:name "other priority" :priority< "C")
(:name "someday" :todo "SOMEDAY")
(:name "I dont know yet" :todo "IDKY"))))))))))
(:name "I dont know yet" :todo "IDKY"))))))))))
;; capture
(use-package org-capture
:straight nil
:config
(setq my-org-capture-file (concat org-directory "/20260509T232442==agenda--all-my-todos__org.org"))
(setq org-capture-templates
(cond
((or *is-linux* *is-mac*)
'(("t" "TODO" entry
(file+headline "~/org/my-org-note/20260509T232442==agenda--all-my-todos__org.org" "Something to do")
"* TODO %<%m-%d> %?\n%T"
:empty-lines 1)
("s" "SOMEDAY" entry
(file+headline "~/org/my-org-note/20260509T232442==agenda--all-my-todos__org.org" "Something to do")
"* SOMEDAY %<%m-%d> %?\n%T"
:empty-lines 1)
("i" "IDKY" entry
(file+headline "~/org/my-org-note/20260509T232442==agenda--all-my-todos__org.org" "Something to do")
"* IDKY %<%m-%d> %?\n%T"
:empty-lines 1)))
(*is-android*
'(("t" "TODO" entry
(file+headline "~/storage/shared/my-org-note/20260509T232442==agenda--all-my-todos__org.org" "Something to do")
"* TODO %<%m-%d> %?\n%T"
:empty-lines 1)
("s" "SOMEDAY" entry
(file+headline "~/storage/shared/my-org-note/20260509T232442==agenda--all-my-todos__org.org" "Something to do")
"* SOMEDAY %<%m-%d> %?\n%T"
:empty-lines 1)
("i" "IDKY" entry
(file+headline "~/org/my-org-note/20260509T232442==agenda--all-my-todos__org.org" "Something to do")
"* IDKY %<%m-%d> %?\n%T"
:empty-lines 1)))
(t nil))))
`(("t" "TODO" entry
(file+headline ,my-org-capture-file "Something to do")
"* TODO %<%m-%d> %?\n%T" :empty-lines 1)
("s" "STARTED" entry
(file+headline ,my-org-capture-file "Something to do")
"* STARTED %<%m-%d> %?\n%T" :empty-lines 1)
("S" "SOMEDAY" entry
(file+headline ,my-org-capture-file "Something to do")
"* SOMEDAY %<%m-%d> %?\n%T" :empty-lines 1)
("i" "IDKY" entry
(file+headline ,my-org-capture-file "Something to know")
"* IDKY %<%m-%d> %?\n%T" :empty-lines 1))))
;; hugo
(use-package ox-hugo
:config
:init
(with-eval-after-load 'org-capture
(defun org-hugo-new-subtree-post-capture-template ()
"Returns `org-capture' template string for new Hugo post.
See `org-capture-templates' for more information."
(let* ((title (read-from-minibuffer "Post Title: ")) ;Prompt to enter the post title
(fname (org-hugo-slug title)))
(mapconcat #'identity
(mapconcat #'identity
`(
,(concat "* TODO " title)
":PROPERTIES:"
@@ -248,25 +237,18 @@ See `org-capture-templates' for more information."
":END:"
"\n\n") ;Place the cursor here finally
"\n")))
(if *is-windows*
(add-to-list 'org-capture-templates
'("h" ;`org-capture' binding + h
"Hugo post"
entry
;; 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 "h:/emacs/hugo/this-is-my-blog/all-blog.org" "Blog Ideas")
(function org-hugo-new-subtree-post-capture-template)))
(add-to-list 'org-capture-templates
'("h" ;`org-capture' binding + h
"Hugo post"
entry
;; 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 "~/org/hugo/this-is-my-blog/all-blog.org" "Blog Ideas")
(function org-hugo-new-subtree-post-capture-template))))))
(add-to-list 'org-capture-templates
`("h" ;`org-capture' binding + h
"Hugo post"
entry
;; 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 ,(if *is-windows*
"h:/emacs/hugo/this-is-my-blog/all-blog.org"
"~/org/hugo/this-is-my-blog/all-blog.org")
"Blog Ideas")
(function org-hugo-new-subtree-post-capture-template)))))
;; presentation
(use-package org-tree-slide)
@@ -290,7 +272,7 @@ See `org-capture-templates' for more information."
holiday-other-holidays '((holiday-fixed 2 14 "情人节")
(holiday-fixed 4 1 "愚人节")
(holiday-fixed 12 25 "圣诞节")
(holiday-fixed 6 7 "高考")
(holiday-fixed 6 7 "高考")
(holiday-float 5 0 2 "母亲节")
(holiday-float 6 0 3 "父亲节")
(holiday-float 11 4 4 "感恩节"))

View File

@@ -1,4 +1,4 @@
;;; init-package.el --- some other packages -*- lexical-binding: t -*-
;;; init-package.el --- some other packages -*- lexical-binding: t -*-
;;; Commentary:
@@ -6,7 +6,7 @@
;; keycast按键广播
(if use-package-always-defer
(use-package keycast))
(use-package keycast))
;; anzu显示isearch匹配数字
(use-package anzu
@@ -68,30 +68,34 @@ _a_ : all dwim
(#x3000 . #x303F)
(#xFF00 . #xFFEF)
(#x20000 . #x2A6DF)))
(let ((start (car range))
(let ((start (car range))
(end (cdr range)))
(dotimes (i (- end start))
(dotimes (i (- end start))
(modify-syntax-entry (+ start i) "_" jinx--syntax-table))))))
(use-package consult-jinx
:straight
(:host github :repo "Andsy10/consult-jinx")))
(consult-jinx
:type git
:host github
:repo "Andsy10/consult-jinx"
:protocol ssh)))
;; eat终端
(unless *is-windows*
(use-package eat
:straight
(eat :type git
:host codeberg
:repo "akib/emacs-eat"
:files ("*.el"
("term" "term/*.el")
"*.texi"
"*.ti"
("terminfo/e" "terminfo/e/*")
("terminfo/65" "terminfo/65/*")
("integration" "integration/*")
(:exclude ".dir-locals.el" "*-tests.el")))
:host codeberg
:repo "akib/emacs-eat"
:files ("*.el"
("term" "term/*.el")
"*.texi"
"*.ti"
("terminfo/e" "terminfo/e/*")
("terminfo/65" "terminfo/65/*")
("integration" "integration/*")
(:exclude ".dir-locals.el" "*-tests.el")))
:hook
(eshell-load . eat-eshell-mode)
(eshell-load . eat-eshell-visual-command-mode)
@@ -113,7 +117,7 @@ _a_ : all dwim
(consult-customize consult-source-buffer :hidden t :default nil)
(add-to-list 'consult-buffer-sources persp-consult-source))
(setq switch-to-prev-buffer-skip
(lambda (win buff bury-or-kill)
(lambda (win buff bury-or-kill)
(or (not (persp-is-current-buffer buff))
(cl-some (lambda (re) (string-match-p re (buffer-name buff)))
consult-buffer-filter))))
@@ -133,7 +137,7 @@ _a_ : all dwim
(use-package ediff
:config
(setq ediff-window-setup-function 'ediff-setup-windows-plain
ediff-split-window-function 'split-window-horizontally))
ediff-split-window-function 'split-window-horizontally))
;; diff-hl
(use-package diff-hl
@@ -147,13 +151,21 @@ _a_ : all dwim
:config
(setq project-switch-commands (assq-delete-all 'project-vc-dir project-switch-commands))
(setq project-switch-commands
(seq-uniq (append project-switch-commands
'((magit-project-status "Magit" ?v)
(eat-project "Eat" ?E)
(project-query-replace-regexp "Query Replace" ?R)
(consult-ripgrep "Ripgrep" ?r))))))
(seq-uniq (append project-switch-commands
'((magit-project-status "Magit" ?v)
(eat-project "Eat" ?E)
(project-query-replace-regexp "Query Replace" ?R)
(consult-ripgrep "Ripgrep" ?r)
(consult-project-buffer "Buffers" ?b)
(project-ibuffer "Ibuffer" ?i)
(opencode "OpenCode" ?a))))))
(use-package ibuffer-projectile)
(use-package project-ibuffer
:straight
(project-ibuffer :type git
:host github
:repo "Andsy10/project-ibuffer"
:protocol ssh))
;; emms
(use-package emms
@@ -162,7 +174,7 @@ _a_ : all dwim
:config
(emms-all)
(setq emms-player-list '(emms-player-vlc)
emms-info-functions '(emms-info-native))
emms-info-functions '(emms-info-native))
(emms-history-load))
;; tokei
@@ -208,7 +220,7 @@ _a_ : all dwim
'proced-format-alist
'(custom user pid ppid sess tree pcpu pmem rss start time state (args comm)))
(setq proced-low-memory-usage-threshold 0.025
proced-medium-memory-usage-threshold 0.125))
proced-medium-memory-usage-threshold 0.125))
;; syncthing
(use-package syncthing

View File

@@ -1,4 +1,4 @@
;;; init-prog.el --- programming -*- lexical-binding: t -*-
;;; init-prog.el --- programming -*- lexical-binding: t -*-
;;; Commentary:
@@ -31,9 +31,10 @@
;; tree-sitter
(use-package treesit-auto
:hook
(after-init . global-treesit-auto-mode)
:config
(setq treesit-auto-install 'prompt)
(global-treesit-auto-mode)
(setq treesit-font-lock-level 4))
;; scheme
@@ -59,14 +60,18 @@
(:map markdown-mode-map
("C-c C-e" . markdown-do))
:hook
(markdown-mode . toggle-truncate-lines)
(markdown-mode . visual-line-mode)
:init
(setq markdown-command "multimarkdown"
markdown-fontify-code-blocks-natively t))
markdown-fontify-code-blocks-natively t))
(use-package edit-indirect)
;; html
(use-package shr
:config
(setq shr-inhibit-images nil))
(use-package htmlize)
(provide 'init-prog)

View File

@@ -14,17 +14,17 @@
(cond
(*is-windows*
(add-to-list 'load-path "h:/emacs/emacs-chinese-word-segmentation/") ;设置为进程调用方式
(setq cns-process-type 'shell) ;设置可执行文件路径
(setq cns-process-type 'shell) ;设置可执行文件路径
(setq cns-prog "h:/emacs/emacs-chinese-word-segmentation/cnws.exe") ;设置字典目录
(setq cns-dict-directory "h:/emacs/emacs-chinese-word-segmentation/cppjieba/dict") ;直接设置进程命令,绕过 Windows shell 检测
(setq cns-process-shell-command
(format "%s %s %s %s %s %s"
cns-prog
(concat (file-name-as-directory cns-dict-directory) "jieba.dict.utf8")
(concat (file-name-as-directory cns-dict-directory) "hmm_model.utf8")
(concat (file-name-as-directory cns-dict-directory) "user.dict.utf8")
(concat (file-name-as-directory cns-dict-directory) "idf.utf8")
(concat (file-name-as-directory cns-dict-directory) "stop_words.utf8"))))
(format "%s %s %s %s %s %s"
cns-prog
(concat (file-name-as-directory cns-dict-directory) "jieba.dict.utf8")
(concat (file-name-as-directory cns-dict-directory) "hmm_model.utf8")
(concat (file-name-as-directory cns-dict-directory) "user.dict.utf8")
(concat (file-name-as-directory cns-dict-directory) "idf.utf8")
(concat (file-name-as-directory cns-dict-directory) "stop_words.utf8"))))
(t
(add-to-list 'load-path "~/emacs-stuff/emacs-chinese-word-segmentation/")

View File

@@ -1,4 +1,4 @@
;;; init-startup.el --- startup settings -*- lexical-binding: t -*-
;;; init-startup.el --- startup settings -*- lexical-binding: t -*-
;;; Commentary:
@@ -89,6 +89,9 @@
;; 优化换行规则
(setq word-wrap-by-category t)
;; 禁用制表符
(setq-default indent-tabs-mode nil)
;; 修改mac键位
(when *is-mac*
(setq mac-command-modifier 'meta)

View File

@@ -1,4 +1,4 @@
;;; init-terminal-kbd.el --- keybindings -*- lexical-binding: t -*-
;;; init-terminal-kbd.el --- keybindings -*- lexical-binding: t -*-
;;; Commentary:

View File

@@ -35,14 +35,13 @@
(after-init . savehist-mode)
:init
(setq enable-recursive-minibuffers t
history-length 50
savehist-additional-variables '(mark-ring
global-mark-ring
search-ring
regexp-search-ring
extended-command-history)
savehist-ignored-variables '(consult-notes-history)
savehist-autosave-interval 300))
history-length 50
savehist-additional-variables '(mark-ring
global-mark-ring
search-ring
regexp-search-ring
extended-command-history)
savehist-autosave-interval 300))
(use-package saveplace
:hook
@@ -75,13 +74,13 @@
(use-package savehist
:init
(setq enable-recursive-minibuffers t
history-length 50
savehist-additional-variables '(mark-ring
global-mark-ring
search-ring
regexp-search-ring
extended-command-history)
savehist-autosave-interval 300)
history-length 50
savehist-additional-variables '(mark-ring
global-mark-ring
search-ring
regexp-search-ring
extended-command-history)
savehist-autosave-interval 300)
(savehist-mode))
;; saveplace保存光标位置

View File

@@ -81,6 +81,8 @@
(setq word-wrap-by-category t)
(setq-default indent-tabs-mode nil)
(setq kill-whole-line t)
(provide 'init-terminal-startup)

View File

@@ -13,15 +13,19 @@
;; 安装solarized dark
(use-package solarized-theme
:straight
'(solarized-emacs :fork (:host github :repo "Andsy10/solarized-emacs"))
(solarized-emacs
:fork
(:type git :host github :repo "Andsy10/solarized-emacs" :protocol ssh))
:init
;; 把主题加载延迟到frame创建之后防止daemon模式下宏不能正常展开
(if (daemonp)
(if (and (daemonp) (not *is-android*))
(add-hook 'after-make-frame-functions
(lambda (frame)
(with-selected-frame frame
(load-theme 'my-dark t))))
(load-theme 'my-dark t)))
(lambda (frame)
(with-selected-frame frame
(load-theme 'my-dark t))))
(if *is-android*
(load-theme 'my-light t)
(load-theme 'my-dark t))))
;; 行号
(use-package display-line-numbers
@@ -29,8 +33,8 @@
(after-init . global-display-line-numbers-mode)
:config
(setq display-line-numbers-type '2
display-line-numbers-grow-only t
display-line-numbers-width-start 4))
display-line-numbers-grow-only t
display-line-numbers-width-start 4))
;; org-mode美化
(use-package olivetti
@@ -48,8 +52,6 @@
(use-package rainbow-delimiters)
;; 很多主题
;; (use-package doom-themes)
;; (use-package color-theme-modern)
(use-package naysayer-theme)
(use-package ef-themes)
@@ -87,12 +89,12 @@
(persp-mode . display-time-mode)
:config
(setq display-time-default-load-average nil
display-time-string-forms
'((propertize
(concat
(propertize (format-time-string " %I:%M") 'face 'display-time-date-and-time)
(propertize (format-time-string "-%p") 'face 'font-lock-comment-face))
'help-echo (format-time-string "%A, %B %d, %Y"))))))
display-time-string-forms
'((propertize
(concat
(propertize (format-time-string " %I:%M") 'face 'display-time-date-and-time)
(propertize (format-time-string "-%p") 'face 'font-lock-comment-face))
'help-echo (format-time-string "%A, %B %d, %Y"))))))
;; 安装cnfonts修复中英文对齐
(use-package cnfonts
@@ -100,11 +102,11 @@
(after-init . cnfonts-mode)
:init
(setq cnfonts-personal-fontnames
'(("Sarasa Fixed TC") ;英文
("Sarasa Fixed TC") ;中文
nil ;ext-B
nil ;symbol
nil)) ;装饰
'(("Sarasa Fixed TC") ;英文
("Sarasa Fixed TC") ;中文
nil ;ext-B
nil ;symbol
nil)) ;装饰
:config
(cnfonts--select-profile "profile1"))

View File

@@ -16,7 +16,7 @@
popper-group-by-directory
:hook
(after-init . popper-mode)
:init
(setq popper-reference-buffers
'("\\*Messages\\*"
@@ -38,17 +38,18 @@
"\\*Edit Annotation.*\\*"
"\\*Flutter\\*"
"\\*Ibuffer\\*"
"^\\*Finder-"
"^\\*Finder-"
"Buffers\\*$"
"^\\*Geiser"
"\\*gptel-Kimi-Code\\*"
"^\\*sly"
"\\*gptel-agent:.*\\*"
"^\\*OpenCode Sessions"
"^\\*sly"
"^magit"
"\\*discomfort\\*"
"\\*eww bookmarks\\*"
"\\*eww history\\*"
"\\*Proced\\*"
"\\*discomfort\\*"
"\\*eww bookmarks\\*"
"\\*eww history\\*"
"\\*Proced\\*"
bookmark-bmenu-mode
lsp-bridge-ref-mode
comint-mode
@@ -63,10 +64,10 @@
process-menu-mode list-environment-mode cargo-process-mode
youdao-dictionary-mode osx-dictionary-mode fanyi-mode
gptel-mode
ibuffer-mode
ibuffer-mode
"^\\*eshell.*\\*.*$" eshell-mode
".*eshell\\*$"
".*eshell\\*$"
"^\\*shell.*\\*.*$" shell-mode
"^\\*terminal.*\\*.*$" term-mode
"^\\*vterm.*\\*.*$" vterm-mode
@@ -94,7 +95,7 @@
"\\*rustfmt\\*$" rustic-compilation-mode rustic-cargo-clippy-mode
rustic-cargo-outdated-mode rustic-cargo-test-mode
"^\\*\\[D\\] FILE backlinks for" "^\\*Denote HEADING backlinks for"))
"^\\*\\[D\\] FILE backlinks for" "^\\*Denote HEADING backlinks for"))
(when (display-grayscale-p)
(setq popper-mode-line
@@ -125,8 +126,10 @@
(delete-window window)))))
(advice-add #'keyboard-quit :before #'popper-close-window-hack)))
;; es-windos快速管理窗口
(use-package es-windows)
;; windmove
(use-package windmove
:hook
(after-init . windmove-swap-states-default-keybindings))
(provide 'init-window)

View File

@@ -1,4 +1,4 @@
;;; my-dark-theme.el --- Dark Theme -*- lexical-binding: t -*-
;;; my-dark-theme.el --- Dark Theme -*- lexical-binding: t -*-
;;; Commentary:
;; A green dark theme base on solarized-theme

View File

@@ -1,4 +1,4 @@
;;; my-light-theme.el --- Light Theme -*- lexical-binding: t -*-
;;; my-light-theme.el --- Light Theme -*- lexical-binding: t -*-
;;; Commentary:
;; A green light theme base on solarized-theme