Compare commits

..

10 Commits

Author SHA1 Message Date
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 500 additions and 482 deletions

View File

@@ -1,4 +1,4 @@
;;; init.el --- init.el -*- lexical-binding: t -*- ;;; init.el --- init.el -*- lexical-binding: t -*-
;;; Commentary: ;;; Commentary:
;; trogloxene's Emacs ;; trogloxene's Emacs
@@ -6,7 +6,7 @@
;;; Code: ;;; Code:
(add-to-list 'load-path (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)) (setq custom-file (expand-file-name "custom.el" user-emacs-directory))
(load custom-file t) (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: ;;; Commentary:
;; Fix video-mtn preview issue on Windows ;; Fix video-mtn preview issue on Windows

View File

@@ -38,7 +38,7 @@
:demand t :demand t
:hook :hook
(emacs-startup . (lambda () (emacs-startup . (lambda ()
(unless (server-running-p) (unless (server-running-p)
(server-mode 1))))) (server-mode 1)))))
;; recentf最近打开的文件 ;; recentf最近打开的文件
@@ -50,9 +50,9 @@
(setq recentf-max-saved-items 30) (setq recentf-max-saved-items 30)
:config :config
(if *is-android* (if *is-android*
(add-to-list 'recentf-exclude "~/storage/shared/my-org-note/journal/.*\\.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/journal/.*\\.org\\'")
(add-to-list 'recentf-exclude "~/org/my-org-note/20260509T232442==agenda--all-my-todos__org\\.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/emms/history")
(add-to-list 'recentf-exclude "~/.emacs.d/bookmarks"))) (add-to-list 'recentf-exclude "~/.emacs.d/bookmarks")))
@@ -62,14 +62,13 @@
(after-init . savehist-mode) (after-init . savehist-mode)
:init :init
(setq enable-recursive-minibuffers t (setq enable-recursive-minibuffers t
history-length 50 history-length 50
savehist-additional-variables '(mark-ring savehist-additional-variables '(mark-ring
global-mark-ring global-mark-ring
search-ring search-ring
regexp-search-ring regexp-search-ring
extended-command-history) extended-command-history)
savehist-ignored-variables '(consult-notes-history) savehist-autosave-interval 300))
savehist-autosave-interval 300))
;; saveplace保存光标位置 ;; saveplace保存光标位置
(use-package saveplace (use-package saveplace
@@ -80,11 +79,11 @@
(use-package restart-emacs) (use-package restart-emacs)
;; async ;; async
(if *is-android* (unless *is-android*
(use-package async (use-package async
:hook :hook
(after-init . dired-async-mode) (after-init . dired-async-mode)
(after-init . async-bytecomp-package-mode))) (after-init . async-bytecomp-package-mode)))
;; autorevert buffer ;; autorevert buffer
(use-package autorevert (use-package autorevert
@@ -108,105 +107,105 @@
(use-package ibuffer (use-package ibuffer
:config :config
(setq ibuffer-saved-filter-groups (setq ibuffer-saved-filter-groups
'(("Main" '(("Main"
("App" (mode . exwm-mode)) ("App" (mode . exwm-mode))
("Scratch" (or ("Scratch" (or
(name . "^*scratch"))) (name . "^*scratch")))
("eww" (or ("eww" (or
(mode . eww-mode) (mode . eww-mode)
(mode . eww-bookmark-mode) (mode . eww-bookmark-mode)
(mode . eww-buffers-mode) (mode . eww-buffers-mode)
(mode . eww-history-mode))) (mode . eww-history-mode)))
("Calc" (or ("Calc" (or
(mode . calc-mode) (mode . calc-mode)
(mode . calc-trail-mode))) (mode . calc-trail-mode)))
("Shell" (or ("Shell" (or
(mode . eshell-mode) (mode . eshell-mode)
(mode . eat-mode) (mode . eat-mode)
(mode . vterm-mode))) (mode . vterm-mode)))
("Scripts" (or ("Scripts" (or
(mode . shell-script-mode) (mode . shell-script-mode)
(mode . shell-mode) (mode . shell-mode)
(mode . sh-mode) (mode . sh-mode)
(mode . lua-mode) (mode . lua-mode)
(mode . bat-mode))) (mode . bat-mode)))
("Config" (or ("Config" (or
(mode . conf-mode) (mode . conf-mode)
(mode . conf-desktop-mode) (mode . conf-desktop-mode)
(mode . conf-toml-mode) (mode . conf-toml-mode)
(mode . conf-xdefaults-mode))) (mode . conf-xdefaults-mode)))
("Elisp" (mode . emacs-lisp-mode)) ("Elisp" (mode . emacs-lisp-mode))
("Scheme" (or ("Scheme" (or
(mode . scheme-mode))) (mode . scheme-mode)))
("Geiser" (or ("Geiser" (or
(name . "^Geiser") (name . "^Geiser")
(mode . geiser-repl-mode) (mode . geiser-repl-mode)
(mode . geiser-debug-mode) (mode . geiser-debug-mode)
(mode . geiser-messages-mode) (mode . geiser-messages-mode)
(mode . geiser-debug-mode) (mode . geiser-debug-mode)
(mode . geiser-doc-mode) (mode . geiser-doc-mode)
(mode . geiser-autodoc-mode))) (mode . geiser-autodoc-mode)))
("gptel" (or ("gptel" (or
(name . "^\\*gptel"))) (name . "^\\*gptel")))
("Common-lisp" (or ("Common-lisp" (or
(mode . common-lisp-mode) (mode . common-lisp-mode)
(mode . lisp-mode))) (mode . lisp-mode)))
("Sly" (or ("Sly" (or
(mode . lisp-data-mode) (mode . lisp-data-mode)
(mode . sly-db-mode) (mode . sly-db-mode)
(mode . sly-mrepl-mode) (mode . sly-mrepl-mode)
(name . "\\*sly-compilation\\*") (name . "\\*sly-compilation\\*")
(name . "^\\*img-cache\\*"))) (name . "^\\*img-cache\\*")))
("Text" (or ("Text" (or
(mode . org-mode) (mode . org-mode)
(mode . markdown-mode) (mode . markdown-mode)
(name . "^\\*\\[D\\] FILE backlinks for"))) (name . "^\\*\\[D\\] FILE backlinks for")))
("Help" (or ("Help" (or
(mode . help-mode) (mode . help-mode)
(mode . helpful-mode))) (mode . helpful-mode)))
("Info" (or ("Info" (or
(name . "^\\*info"))) (name . "^\\*info")))
("Magit" (or ("Magit" (or
(mode . magit-blame-mode) (mode . magit-blame-mode)
(mode . magit-cherry-mode) (mode . magit-cherry-mode)
(mode . magit-diff-mode) (mode . magit-diff-mode)
(mode . magit-log-mode) (mode . magit-log-mode)
(mode . magit-process-mode) (mode . magit-process-mode)
(mode . magit-status-mode) (mode . magit-status-mode)
(mode . magit-revision-mode) (mode . magit-revision-mode)
(mode . magit-refs-mode))) (mode . magit-refs-mode)))
("Directories" (or ("Directories" (or
(mode . dired-mode) (mode . dired-mode)
(name . "^*dirvish"))) (name . "^*dirvish")))
("Grep" (or ("Grep" (or
(mode . grep-mode) (mode . grep-mode)
(mode . rg-mode) (mode . rg-mode)
(mode . xref--xref-buffer-mode) (mode . xref--xref-buffer-mode)
(mode . xref-edit-mode) (mode . xref-edit-mode)
(mode . occur-mode) (mode . occur-mode)
(mode . occur-edit-mode))) (mode . occur-edit-mode)))
("Diff" (name . "^*Diff")) ("Diff" (name . "^*Diff"))
("Emacs" (or ("Emacs" (or
(name . "^\\*Help\\*$") (name . "^\\*Help\\*$")
(name . "^\\*Custom.*") (name . "^\\*Custom.*")
(name . "^\\*EMMS Playlist\\*") (name . "^\\*EMMS Playlist\\*")
(name . "^\\*Messages\\*$") (name . "^\\*Messages\\*$")
(name . "*Chinese-word-segmentation*") (name . "*Chinese-word-segmentation*")
(name . "^*Buffer List*") (name . "^*Buffer List*")
(name . "\\*discomfort\\*") (name . "\\*discomfort\\*")
(mode . calendar-mode) (mode . calendar-mode)
(mode . grep-mode) (mode . grep-mode)
(mode . proced-mode) (mode . proced-mode)
(mode . syncthing-mode)))))) (mode . syncthing-mode))))))
(add-hook 'ibuffer-hook (add-hook 'ibuffer-hook
(lambda () (ibuffer-switch-to-saved-filter-groups "Main") (lambda () (ibuffer-switch-to-saved-filter-groups "Main")
(unless (eq ibuffer-sorting-mode 'alphabetic) (unless (eq ibuffer-sorting-mode 'alphabetic)
(ibuffer-do-sort-by-alphabetic)))) (ibuffer-do-sort-by-alphabetic))))
(setq ibuffer-show-empty-filter-groups nil (setq ibuffer-show-empty-filter-groups nil
ibuffer-use-other-window t ibuffer-use-other-window t
ibuffer-default-sorting-mode 'filename)) ibuffer-default-sorting-mode 'filename))
(use-package simple (use-package simple
:straight nil :straight nil
@@ -214,8 +213,8 @@
(after-init . size-indication-mode) (after-init . size-indication-mode)
(after-init . column-number-mode) (after-init . column-number-mode)
:config :config
(setq kill-whole-line t ;kill-line删除换行符 (setq kill-whole-line t ;kill-line删除换行符
set-mark-command-repeat-pop t)) ;更方便地pop mark set-mark-command-repeat-pop t)) ;更方便地pop mark
;; 滚动 ;; 滚动
(unless *is-mac* (unless *is-mac*
@@ -225,10 +224,10 @@
(after-init . pixel-scroll-precision-mode) (after-init . pixel-scroll-precision-mode)
:init :init
(setq scroll-preserve-screen-position t (setq scroll-preserve-screen-position t
scroll-conservatively 101) scroll-conservatively 101)
:config :config
(advice-add 'pixel-scroll-precision :around (advice-add 'pixel-scroll-precision :around
(lambda (orig event) (lambda (orig event)
(cl-letf (((symbol-function 'device-class) (cl-letf (((symbol-function 'device-class)
(lambda (&rest _) 'mouse))) (lambda (&rest _) 'mouse)))
(funcall orig event)))))) (funcall orig event))))))
@@ -238,11 +237,6 @@
:config :config
(setq eww-auto-rename-buffer t)) (setq eww-auto-rename-buffer t))
;; shr
(use-package shr
:config
(setq shr-inhibit-images nil))
(provide 'init-base) (provide 'init-base)
;;; init-base.el ends here ;;; 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: ;;; Commentary:
@@ -26,29 +26,37 @@
(cond (cond
(*is-windows* (*is-windows*
(setq consult-locate-args (encode-coding-string "es.exe -i -p -r" 'gbk) (setq consult-locate-args (encode-coding-string "es.exe -i -p -r" 'gbk)
consult-ripgrep-args (encode-coding-string consult-ripgrep-args (encode-coding-string
"rg --null --line-buffered --color=never --max-columns=1000 --path-separator / --smart-case --no-heading --line-number" "rg --null --line-buffered --color=never --max-columns=1000 --path-separator / --smart-case --no-heading --line-number"
'gbk)) 'gbk))
(add-to-list 'process-coding-system-alist '("es" gbk . gbk))) (add-to-list 'process-coding-system-alist '("es" gbk . gbk)))
(*is-mac* (*is-mac*
(setq consult-locate-args "mdfind -name")) (setq consult-locate-args "mdfind -name"))
(*is-linux* (*is-linux*
(setq consult-locate-args "plocate --basename --ignore-case"))) (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 ;; set some buffer filter
(setq consult-buffer-filter (setq consult-buffer-filter
(cl-union consult-buffer-filter (cl-union consult-buffer-filter
'("^\\*dirvish" '("^\\*dirvish"
"^PREVIEW" "^PREVIEW"
"^\\*helpful" "^\\*helpful"
"^\\*Help" "^\\*Help"
"Diff" "Diff"
"straight" "straight"
"\\*Messages\\*" "\\*Messages\\*"
"\\*Chinese-word-segmentation\\*" "\\*Chinese-word-segmentation\\*"
"\\*gptel-reasoning\\*" "\\*gptel-reasoning\\*"
"\\*gptel-log\\*") "\\*gptel-log\\*")
:test 'equal))) :test 'equal)))
;; embark快捷指令 ;; embark快捷指令
(use-package embark (use-package embark
@@ -124,7 +132,7 @@ targets."
(add-hook 'eglot-managed-mode-hook (add-hook 'eglot-managed-mode-hook
(lambda () (lambda ()
(when (derived-mode-p 'scheme-mode) (when (derived-mode-p 'scheme-mode)
(setq-local completion-at-point-functions (setq-local completion-at-point-functions
(remq 'eglot-completion-at-point (remq 'eglot-completion-at-point
completion-at-point-functions)))))) completion-at-point-functions))))))
@@ -134,7 +142,7 @@ targets."
(corfu-quit consult-completion-in-region) (corfu-quit consult-completion-in-region)
:bind :bind
(:map corfu-map (:map corfu-map
("M-d" . corfu-popupinfo-documentation)) ("M-d" . corfu-popupinfo-documentation))
:custom :custom
(corfu-auto t) (corfu-auto t)
(corfu-auto-prefix 2) (corfu-auto-prefix 2)
@@ -144,10 +152,10 @@ targets."
(corfu-auto-delay 0.2) (corfu-auto-delay 0.2)
(corfu-popupinfo-delay '(0.4 . 0.2)) (corfu-popupinfo-delay '(0.4 . 0.2))
(global-corfu-modes '((not erc-mode (global-corfu-modes '((not erc-mode
circe-mode circe-mode
help-mode help-mode
gud-mode gud-mode
vterm-mode) vterm-mode)
t)) t))
:hook :hook
(after-init . global-corfu-mode) (after-init . global-corfu-mode)
@@ -162,7 +170,7 @@ targets."
(local-set-key (kbd "TAB") 'completion-at-point))) (local-set-key (kbd "TAB") 'completion-at-point)))
:bind :bind
(:map corfu-map (:map corfu-map
("RET" . nil))) ("RET" . nil)))
(if (not (and (display-graphic-p) (if (not (and (display-graphic-p)
(>= emacs-major-version 31))) (>= emacs-major-version 31)))

View File

@@ -9,15 +9,15 @@
:hook after-init :hook after-init
:config :config
(setq dashboard-banner-logo-title (format "%s" emacs-version) (setq dashboard-banner-logo-title (format "%s" emacs-version)
dashboard-banner-ascii " ##### # # # # ####### # # # ##### ##### \n# # ## # # # # ## ## # # # # # # \n# # # # # # # # # # # # # # # \n# #### # # # # # ##### # # # # # # ##### \n# # # # # # # # # # ####### # # \n# # # ## # # # # # # # # # # # \n ##### # # ##### ####### # # # # ##### ##### " dashboard-banner-ascii " ##### # # # # ####### # # # ##### ##### \n# # ## # # # # ## ## # # # # # # \n# # # # # # # # # # # # # # # \n# #### # # # # # ##### # # # # # # ##### \n# # # # # # # # # # ####### # # \n# # # ## # # # # # # # # # # # \n ##### # # ##### ####### # # # # ##### ##### "
dashboard-startup-banner 'ascii dashboard-startup-banner 'ascii
dashboard-footer-messages '("hello") dashboard-footer-messages '("hello")
dashboard-center-content t dashboard-center-content t
dashboard-navigation-cycle t dashboard-navigation-cycle t
dashboard-items '((recents . 8) dashboard-items '((recents . 8)
(bookmarks . 5) (bookmarks . 5)
(projects . 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)) (dashboard-setup-startup-hook))
(provide 'init-dashboard) (provide 'init-dashboard)

View File

@@ -9,19 +9,19 @@
:config :config
(when *is-mac* (when *is-mac*
(setq insert-directory-program "gls" (setq insert-directory-program "gls"
dired-use-ls-dired t)) dired-use-ls-dired t))
(setq dired-dwim-target t (setq dired-dwim-target t
dired-listing-switches dired-listing-switches
"-l --almost-all --human-readable --group-directories-first --no-group" "-l --almost-all --human-readable --group-directories-first --no-group"
dired-recursive-deletes 'always dired-recursive-deletes 'always
dired-recursive-copies 'always dired-recursive-copies 'always
dired-mouse-drag-files t dired-mouse-drag-files t
mouse-drag-and-drop-region-cross-program t mouse-drag-and-drop-region-cross-program t
dired-compress-file-default-suffix ".zip" dired-compress-file-default-suffix ".zip"
dired-kill-when-opening-new-dired-buffer nil dired-kill-when-opening-new-dired-buffer nil
dired-auto-revert-buffer t dired-auto-revert-buffer t
dired-create-destination-dirs 'ask dired-create-destination-dirs 'ask
dired-create-destination-dirs-on-trailing-dirsep t) dired-create-destination-dirs-on-trailing-dirsep t)
(put 'dired-find-alternate-file 'disabled nil)) (put 'dired-find-alternate-file 'disabled nil))
;; dirvish ;; dirvish
@@ -41,15 +41,15 @@
(if *is-android* (if *is-android*
(setq dirvish-default-layout nil (setq dirvish-default-layout nil
dirvish-layout-recipes '((1 0.6))) dirvish-layout-recipes '((1 0.6)))
(setq dirvish-default-layout nil (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 (setq dirvish-use-mode-line t
dirvish-mode-line-format '(:left (sort omit symlink) :right (free-space index)) dirvish-mode-line-format '(:left (sort omit symlink) :right (free-space index))
dirvish-attributes '(file-time file-size) dirvish-attributes '(file-time file-size)
dirvish-yank-sources 'session dirvish-yank-sources 'session
dirvish-hide-cursor nil) dirvish-hide-cursor nil)
:custom :custom
(dirvish-quick-access-entries (dirvish-quick-access-entries
@@ -94,20 +94,20 @@
(dirvish dirvish-vc transient) (dirvish dirvish-vc transient)
:demand t :demand t
:config :config
(transient-define-suffix dirvish-toggle-gitignore () (transient-define-suffix dirvish-toggle-gitignore ()
"Toggle `dired-gitignore-mode' in current Dirvish buffer." "Toggle `dired-gitignore-mode' in current Dirvish buffer."
:description :description
(lambda () (lambda ()
(format "Gitignore filter (%s)" (format "Gitignore filter (%s)"
(if dired-gitignore-mode (if dired-gitignore-mode
(propertize "+" 'face 'transient-value) (propertize "+" 'face 'transient-value)
(propertize "-" 'face 'transient-inactive-value)))) (propertize "-" 'face 'transient-inactive-value))))
:transient t :transient t
(interactive) (interactive)
(dired-gitignore-mode 'toggle)) (dired-gitignore-mode 'toggle))
(transient-append-suffix 'dirvish-vc-menu "v" (transient-append-suffix 'dirvish-vc-menu "v"
'("i" dirvish-toggle-gitignore))) '("i" dirvish-toggle-gitignore)))
;; trashed ;; trashed
(use-package trashed (use-package trashed
@@ -115,24 +115,24 @@
(trashed) (trashed)
:config :config
(setq trashed-action-confirmer 'y-or-n-p (setq trashed-action-confirmer 'y-or-n-p
trashed-use-header-line t trashed-use-header-line t
trashed-sort-key '("Date deleted" . t) trashed-sort-key '("Date deleted" . t)
trashed-date-format "%Y-%m-%d %H:%M:%S")) trashed-date-format "%Y-%m-%d %H:%M:%S"))
;; discomfort挂载硬盘 ;; discomfort挂载硬盘
(when *is-linux* (when *is-linux*
(use-package debase (use-package debase
:straight :straight
(debase :type git (debase :type git
:host codeberg :host codeberg
:repo "emacs-weirdware/debase")) :repo "emacs-weirdware/debase"))
(use-package discomfort (use-package discomfort
:commands discomfort :commands discomfort
:straight :straight
(discomfort :type git (discomfort :type git
:host codeberg :host codeberg
:repo "emacs-weirdware/discomfort"))) :repo "emacs-weirdware/discomfort")))
(provide 'init-dired) (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: ;;; Commentary:
@@ -13,7 +13,7 @@
(use-package elec-pair (use-package elec-pair
:config :config
(setq electric-pair-inhibit-predicate 'electric-pair-conservative-inhibit (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 ;; multiple-cursors
(use-package multiple-cursors (use-package multiple-cursors
@@ -22,20 +22,20 @@
(mc/always-run-for-all t) (mc/always-run-for-all t)
:init :init
(setq mc/cmds-to-run-once (setq mc/cmds-to-run-once
'(god-mode-all '(god-mode-all
hydra-multiple-cursors/body hydra-multiple-cursors/body
hydra-multiple-cursors/mc/edit-lines hydra-multiple-cursors/mc/edit-lines
hydra-multiple-cursors/mc/insert-numbers hydra-multiple-cursors/mc/insert-numbers
hydra-multiple-cursors/mc/mark-all-dwim hydra-multiple-cursors/mc/mark-all-dwim
hydra-multiple-cursors/mc/mark-next-like-this 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-symbol
hydra-multiple-cursors/mc/mark-next-like-this-word 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
hydra-multiple-cursors/mc/mark-previous-like-this-symbol hydra-multiple-cursors/mc/mark-previous-like-this-symbol
hydra-multiple-cursors/mc/mark-previous-like-this-word hydra-multiple-cursors/mc/mark-previous-like-this-word
hydra-multiple-cursors/mc/unmark-next-like-this hydra-multiple-cursors/mc/unmark-next-like-this
hydra-multiple-cursors/mc/unmark-previous-like-this hydra-multiple-cursors/mc/unmark-previous-like-this
hydra-multiple-cursors/nil))) hydra-multiple-cursors/nil)))
;; crux实用函数 ;; crux实用函数
(use-package crux) (use-package crux)
@@ -50,7 +50,7 @@
(use-package undo-fu (use-package undo-fu
:config :config
(setq undo-in-region t (setq undo-in-region t
undo-fu-allow-undo-in-region t)) undo-fu-allow-undo-in-region t))
(use-package undo-fu-session (use-package undo-fu-session
:hook :hook
@@ -60,8 +60,8 @@
(use-package vundo (use-package vundo
:init :init
(setq undo-limit 800000 (setq undo-limit 800000
undo-strong-limit 1200000 undo-strong-limit 1200000
undo-outer-limit 12000000)) undo-outer-limit 12000000))
;; expand-region快速展开选中 ;; expand-region快速展开选中
(use-package expand-region (use-package expand-region
@@ -89,15 +89,15 @@
:config :config
(unless (or *is-android* (not use-package-always-defer)) (which-key-enable-god-mode-support)) (unless (or *is-android* (not use-package-always-defer)) (which-key-enable-god-mode-support))
(setq god-mode-enable-function-key-translation nil (setq god-mode-enable-function-key-translation nil
god-exempt-major-modes god-exempt-major-modes
(cl-union '(diff-mode exwm-mode) god-exempt-major-modes :test 'equal) (cl-union '(diff-mode exwm-mode) god-exempt-major-modes :test 'equal)
god-mode-lighter-string "THANK-GOD-MODE") god-mode-lighter-string "THANK-GOD-MODE")
(defun my-sync-god-mode-lighter-face (&rest _) (defun my-sync-god-mode-lighter-face (&rest _)
(set-face-attribute 'god-mode-lighter nil (set-face-attribute 'god-mode-lighter nil
:inherit 'isearch-fail :inherit 'isearch-fail
:background (face-attribute 'mode-line :background nil t) :background (face-attribute 'mode-line :background nil t)
:weight 'bold)) :weight 'bold))
(my-sync-god-mode-lighter-face) (my-sync-god-mode-lighter-face)
(add-hook 'enable-theme-functions #'my-sync-god-mode-lighter-face) (add-hook 'enable-theme-functions #'my-sync-god-mode-lighter-face)
@@ -106,7 +106,7 @@
'relative 'relative
t))) t)))
(unless (or (eq display-line-numbers desired) (bound-and-true-p olivetti-mode)) (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)) (add-hook 'post-command-hook #'my-sync-line-numbers-with-god-mode))
(provide 'init-edit) (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: ;;; Commentary:

View File

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

View File

@@ -1,4 +1,4 @@
;;; init-gptel.el --- ai -*- lexical-binding: t -*- ;;; init-gptel.el --- ai -*- lexical-binding: t -*-
;;; Commentary: ;;; Commentary:
@@ -7,8 +7,8 @@
(use-package gptel (use-package gptel
:config :config
(setq gptel-log-level t (setq gptel-log-level t
gptel-default-mode 'org-mode gptel-default-mode 'org-mode
gptel-include-reasoning "*gptel-reasoning*") gptel-include-reasoning "*gptel-reasoning*")
(add-hook 'gptel-post-response-functions 'gptel-end-of-response) (add-hook 'gptel-post-response-functions 'gptel-end-of-response)
(add-hook 'gptel-post-stream-hook 'gptel-auto-scroll) (add-hook 'gptel-post-stream-hook 'gptel-auto-scroll)
(setq gptel-prompt-prefix-alist '((markdown-mode . "## User: ") (org-mode . "** User: ") (text-mode . "## User: "))) (setq gptel-prompt-prefix-alist '((markdown-mode . "## User: ") (org-mode . "** User: ") (text-mode . "## User: ")))
@@ -35,7 +35,7 @@
:stream t :stream t
:models '(kimi-for-coding) :models '(kimi-for-coding)
:header (lambda (_) :header (lambda (_)
(when-let ((key (gptel--get-api-key))) (when-let* ((key (gptel--get-api-key)))
`(("User-Agent" . "RooCode/3.30.3") `(("User-Agent" . "RooCode/3.30.3")
("HTTP-Referer" . "https://github.com/RooVetGit/Roo-Cline") ("HTTP-Referer" . "https://github.com/RooVetGit/Roo-Cline")
("X-Title" . "Roo Code") ("X-Title" . "Roo Code")
@@ -53,7 +53,8 @@
(string-trim clean))) (string-trim clean)))
(defun my-gptel-save-session () (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 The filename is prefixed with a YYYYMMDD-HHmmss timestamp and generated
from the last 1500 characters of the buffer." from the last 1500 characters of the buffer."
(interactive) (interactive)
@@ -63,11 +64,15 @@ from the last 1500 characters of the buffer."
(content (with-current-buffer buf (content (with-current-buffer buf
(buffer-substring-no-properties (point-min) (point-max)))) (buffer-substring-no-properties (point-min) (point-max))))
(tail (substring content (max 0 (- (length content) 1500)))) (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))) tail)))
(message "Generating filename with AI...") (message "Generating filename with AI...")
(let ((fsm (gptel-request prompt-text (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 :stream nil
:callback :callback
(lambda (response info) (lambda (response info)
@@ -132,7 +137,7 @@ from the last 1500 characters of the buffer."
:models '((kimi-for-coding)) :models '((kimi-for-coding))
:request-params '(:temperature 0.6 :thinking (:type "disabled")) :request-params '(:temperature 0.6 :thinking (:type "disabled"))
:header (lambda (_) :header (lambda (_)
(when-let ((key (gptel--get-api-key))) (when-let* ((key (gptel--get-api-key)))
`(("User-Agent" . "RooCode/3.30.3") `(("User-Agent" . "RooCode/3.30.3")
("HTTP-Referer" . "https://github.com/RooVetGit/Roo-Cline") ("HTTP-Referer" . "https://github.com/RooVetGit/Roo-Cline")
("X-Title" . "Roo Code") ("X-Title" . "Roo Code")

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: ;;; Commentary:
@@ -55,11 +55,11 @@ otherwise toggle global-jinx-mode."
(fboundp 'w32-shell-execute)) (fboundp 'w32-shell-execute))
(shell-command-to-string (shell-command-to-string
(encode-coding-string (encode-coding-string
(replace-regexp-in-string "/" "\\\\" (replace-regexp-in-string "/" "\\\\"
(format "explorer.exe %s" (format "explorer.exe %s"
(file-name-directory (file-name-directory
(expand-file-name file)))) (expand-file-name file))))
'gbk)) 'gbk))
(call-process (pcase system-type (call-process (pcase system-type
('darwin "open") ('darwin "open")
('cygwin "cygstart") ('cygwin "cygstart")
@@ -93,7 +93,7 @@ otherwise toggle global-jinx-mode."
"Return the path of current denote journal if it exists, otherwise return nil." "Return the path of current denote journal if it exists, otherwise return nil."
(require 'denote-journal) (require 'denote-journal)
(let* ((internal-date (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))) (files (denote-journal--get-entry internal-date interval)))
(if files (if files
(denote-journal-select-file-prompt 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'" `~/org/my-org-note/20260508T220745==metanote--all-my-metanotes__org.org'"
(interactive) (interactive)
(find-file (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"))
(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." "Ajust all table in current buffer."
(interactive) (interactive)
(save-excursion (save-excursion
@@ -128,9 +155,9 @@ otherwise toggle global-jinx-mode."
"Publish blog , git add/commit/push , generate commit message." "Publish blog , git add/commit/push , generate commit message."
(interactive) (interactive)
(let* ((blog-dir (or directory (let* ((blog-dir (or directory
(if *is-windows* (if *is-windows*
"h:/emacs/hugo/this-is-my-blog/" "h:/emacs/hugo/this-is-my-blog/"
"~/org/hugo/this-is-my-blog/"))) "~/org/hugo/this-is-my-blog/")))
(timestamp (format-time-string "%Y-%m-%d %H:%M:%S")) (timestamp (format-time-string "%Y-%m-%d %H:%M:%S"))
(default-directory blog-dir)) (default-directory blog-dir))
(message "Adding files...") (message "Adding files...")
@@ -140,15 +167,15 @@ otherwise toggle global-jinx-mode."
(message "Pushing to remote...") (message "Pushing to remote...")
(let ((exit-code (eshell-command "git push"))) (let ((exit-code (eshell-command "git push")))
(if (eq exit-code t) (if (eq exit-code t)
(message "Push may have failed or nothing to push, check *Messages* buffer for details") (message "Push may have failed or nothing to push, check *Messages* buffer for details")
(message "Push successfully %s" timestamp))))) (message "Push successfully %s" timestamp)))))
(defun my-blog-preview () (defun my-blog-preview ()
"Save and preview blog." "Save and preview blog."
(interactive) (interactive)
(save-buffer) (save-buffer)
(let ((default-directory (if *is-windows* (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/"))) "~/org/hugo/this-is-my-blog/")))
(start-process "hugo-server" "*hugo-server*" (start-process "hugo-server" "*hugo-server*"
"hugo" "server" "-D" "--bind" "0.0.0.0" "--port" "1313") "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) (when (eq major-mode 'org-mode)
(setq-local header-line-format nil (setq-local header-line-format nil
mode-line-format nil mode-line-format nil
cursor-type 'hbar cursor-type 'hbar
olivetti-body-width 100) olivetti-body-width 100)
(blink-cursor-mode -1) (blink-cursor-mode -1)
(cnfonts-increase-fontsize 3) (cnfonts-increase-fontsize 3)
(hl-line-mode 'toggle) (hl-line-mode 'toggle)
@@ -251,18 +278,18 @@ argument)."
(when-let* ((proj (project-current t))) (when-let* ((proj (project-current t)))
(consult-ripgrep (project-root proj)))) (consult-ripgrep (project-root proj))))
(defun my-color-picker () (defun consult-colors-emacs (color)
"Pick a color with preview." "Show a list of all supported colors for a particular frame.
(interactive)
(let* ((colors (defined-colors)) You can insert the name (default), or insert or kill the hexadecimal or RGB
(choice (completing-read value of the selected COLOR."
"Color: " (interactive
(mapcar (lambda (c) (list (consult--read (list-colors-duplicates (defined-colors))
(propertize :prompt "Emacs color: "
(format "%-20s %s" c "████") :require-match t
'face `(:foreground ,c))) :category 'color
colors)))) :history '(:input consult-colors-history))))
(string-trim (car (split-string choice))))) (insert color))
(defun fix-theme-colors () (defun fix-theme-colors ()
"Fix invalid color name in theme files." "Fix invalid color name in theme files."
@@ -297,9 +324,9 @@ argument)."
"Kill and restart fcitx5, to fix random issues in exwm." "Kill and restart fcitx5, to fix random issues in exwm."
(interactive) (interactive)
(if (zerop (shell-command "pgrep fcitx5")) (if (zerop (shell-command "pgrep fcitx5"))
(progn (progn
(eshell-command "pkill fcitx5") (eshell-command "pkill fcitx5")
(eshell-command "fcitx5 -d")) (eshell-command "fcitx5 -d"))
(eshell-command "fcitx5 -d")))) (eshell-command "fcitx5 -d"))))
(provide 'init-kbd-func) (provide 'init-kbd-func)

View File

@@ -37,7 +37,7 @@
"R" 'rainbow-mode "R" 'rainbow-mode
"b" 'indent-bars-mode "b" 'indent-bars-mode
"t" 'consult-theme "t" 'consult-theme
"c" 'my-color-picker "c" 'consult-colors-emacs
"f" 'describe-face "f" 'describe-face
"r" 'rainbow-delimiters-mode "r" 'rainbow-delimiters-mode
"k" 'keycast-header-line-mode "k" 'keycast-header-line-mode
@@ -69,7 +69,7 @@
"v" 'magit-project-status "v" 'magit-project-status
"V" 'project-vc-dir "V" 'project-vc-dir
"a" 'my-gptel-agent-project "a" 'my-gptel-agent-project
"i" 'projectile-ibuffer) "i" 'project-ibuffer)
;; v for version control ;; v for version control
(general-def (general-def
@@ -91,9 +91,9 @@
;; o for org-mode ;; o for org-mode
(general-def (general-def
:prefix "C-c o" :prefix "C-c o"
"f" 'consult-notes "f" 'my-denote-find-file
"g" 'consult-denote-grep
"s" 'consult-org-agenda "s" 'consult-org-agenda
"g" 'consult-notes-search-in-all-notes
"C" 'calendar "C" 'calendar
"c" 'org-capture "c" 'org-capture
"d" 'denote "d" 'denote
@@ -196,10 +196,10 @@
;; eat ;; eat
(general-def (eat-semi-char-mode-map (general-def (eat-semi-char-mode-map
eat-line-mode-map eat-line-mode-map
eat-char-mode-map eat-char-mode-map
eat-eshell-semi-char-mode-map eat-eshell-semi-char-mode-map
eat-eshell-char-mode-map) eat-eshell-char-mode-map)
"M-[" nil "M-[" nil
"M-]" nil) "M-]" nil)
@@ -232,8 +232,8 @@
"C-," 'crux-duplicate-current-line-or-region "C-," 'crux-duplicate-current-line-or-region
"C-c o l" 'denote-link "C-c o l" 'denote-link
"C-c o L" 'denote-org-link-to-heading "C-c o L" 'denote-org-link-to-heading
"C-c o b" 'denote-backlinks "C-c o b" 'my-denote-find-backlink-with-location
"C-c o B" 'denote-org-backlinks-for-heading "C-c o B" 'my-denote-org-find-backlink-for-heading-with-location
"C-c o t" 'my-org-tree-slide-start) "C-c o t" 'my-org-tree-slide-start)
;; org-tree-slide-mode ;; 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: ;;; Commentary:
@@ -11,7 +11,22 @@
(org-mode . my-org-electric-pair-fix) (org-mode . my-org-electric-pair-fix)
(org-mode . electric-pair-local-mode) (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 :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)
(if *is-windows* (if *is-windows*
(add-hook 'org-mode-hook 'font-lock-update)) (add-hook 'org-mode-hook 'font-lock-update))
@@ -20,37 +35,28 @@
(defun my-org-electric-pair-fix () (defun my-org-electric-pair-fix ()
(setq-local electric-pair-inhibit-predicate (setq-local electric-pair-inhibit-predicate
(lambda (char) (lambda (char)
(or (eq char ?<) (or (eq char ?<)
(electric-pair-default-inhibit char))))) (electric-pair-default-inhibit char)))))
;; log默认放入drawer中 ;; log默认放入drawer中
(setq org-log-done t (setq org-log-done t
org-log-into-drawer t) org-log-into-drawer t)
;; 不要在capture时设置bookmark ;; 不要在capture时设置bookmark
(setq org-bookmark-names-plist nil) (setq org-bookmark-names-plist nil)
;; 设置todo关键字 ;; 设置todo关键字
(setq org-todo-keywords (setq org-todo-keywords
(quote ((sequence "TODO(t)" "STARTED(S)" "|" "DONE(d!/!)") (quote ((sequence "TODO(t)" "SOMEDAY(S)" "STARTED(s)" "WAITING(w)" "|" "DONE(d!/!)" "CANCELLED(c@/!)")
(sequence "IDKY(i)" "SOMEDAY(s)" "|" "CANCELLED(c@/!)")))) (sequence "IDKY(i)" "|" "KNOWN(k)" "CANCELLED(c@/!)"))))
;; agenda相关 ;; agenda相关
(cond (setq org-agenda-files `(,(concat org-directory "/20260509T232442==agenda--all-my-todos__org.org")))
(*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-span 'day) (setq org-agenda-span 'day)
(setq org-agenda-skip-function-global (setq org-agenda-skip-function-global
'(org-agenda-skip-entry-if 'todo '("COMMENT")))) '(org-agenda-skip-entry-if 'todo '("COMMENT"))))
;; phscroll优化表格换行 ;; phscroll优化表格换行
(use-package phscroll (use-package phscroll
@@ -75,26 +81,28 @@
:hook :hook
(after-init . denote-rename-buffer-mode) (after-init . denote-rename-buffer-mode)
(dired-mode . denote-dired-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 :init
(setq denote-prompts '(title signature keywords)) (setq denote-directory org-directory)
(setq denote-title-history nil) (setq denote-org-store-link-to-heading 'context
(setq denote-signature-history denote-prompts '(title signature keywords))
'("note" "project" "fun" "wisdom" "article" "data" "metanote" "agenda" "journal" "archive")) (setq denote-title-history nil
(setq denote-known-keywords denote-signature-history
'("emacs")) '("note" "project" "fun" "wisdom" "article" "data" "metanote" "agenda" "journal" "archive")
(setq denote-title-history nil)) denote-known-keywords
'("emacs")
denote-title-history nil))
;; denote-org ;; denote-org
(use-package denote-org) (use-package denote-org)
;; denote-lint
(use-package denote-lint
:straight '(denote-lint :type git
:host github
:repo "Andsy10/denote-lint")
:config
(setq org-link-elisp-confirm-function nil))
;; denote-journal ;; denote-journal
(use-package denote-journal (use-package denote-journal
:hook :hook
@@ -108,16 +116,12 @@
;; denote-explore ;; denote-explore
(use-package denote-explore) (use-package denote-explore)
;; consult-notes ;; consult-denote
(use-package consult-notes (use-package consult-denote
:straight
'(consult-notes :fork (:host github :repo "Andsy10/consult-notes"))
:hook :hook
(after-init . consult-notes-denote-mode) (after-init . consult-denote-mode)
:config :init
(setq consult-notes-denote-display-keywords-indicator "_") (setq consult-denote-grep-command 'consult-ripgrep))
(setq consult-notes-denote-display-id-format 'date)
(setq consult-notes-denote-display-signature t))
;; org-download ;; org-download
(use-package org-download (use-package org-download
@@ -127,12 +131,12 @@
(org-mode . org-link-preview-region) (org-mode . org-link-preview-region)
:config :config
(setq-default org-download-image-dir "./images/" (setq-default org-download-image-dir "./images/"
org-download-heading-lvl nil) org-download-heading-lvl nil)
(setq org-download-dragndrop t (setq org-download-dragndrop t
org-download-method 'directory org-download-method 'directory
org-image-actual-width nil org-image-actual-width nil
org-download-image-html-width 600 org-download-image-html-width 600
org-return-follows-link t)) org-return-follows-link t))
;; org-ql ;; org-ql
(use-package org-ql) (use-package org-ql)
@@ -149,38 +153,22 @@
(org-agenda-finalize . disable-truncate-lines) (org-agenda-finalize . disable-truncate-lines)
:config :config
(setq org-agenda-custom-commands (setq org-agenda-custom-commands
'(("pa" "priority >= A" '(("qd" "TODO entries sort by closed time"
((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"
((org-ql-block '(closed) ((org-ql-block '(closed)
((org-ql-block-header "Closed TODOs") ((org-ql-block-header "Closed TODOs")
(org-super-agenda-groups (org-super-agenda-groups
'((:auto-ts t))))))) '((:auto-ts t)))))))
("qs" "SOMEDAYs" ("qs" "SOMEDAYs"
((org-ql-block '(todo "SOMEDAY") ((org-ql-block '(todo "SOMEDAY")
((org-ql-block-header "SOMEDAYs") ((org-ql-block-header "SOMEDAYs")
(org-super-agenda-groups (org-super-agenda-groups
'((:auto-ts t))))))) '((:auto-ts t)))))))
("qS" "STARTEDs" ("qS" "STARTEDs"
((org-ql-block '(todo "STARTED") ((org-ql-block '(todo "STARTED")
((org-ql-block-header "STARTEDs") ((org-ql-block-header "STARTEDs")
(org-super-agenda-groups (org-super-agenda-groups
'((:auto-ts t))))))) '((:auto-ts t)))))))
("qt" "TODOs sort by start time" ("qt" "TODOs sort by start time"
((org-ql-block '(todo) ((org-ql-block '(todo)
((org-ql-block-header "TODOs") ((org-ql-block-header "TODOs")
(org-super-agenda-groups (org-super-agenda-groups
@@ -190,57 +178,43 @@
((org-ql-block-header "all TODOs") ((org-ql-block-header "all TODOs")
(org-super-agenda-groups (org-super-agenda-groups
'((:name "started" :todo "STARTED") '((:name "started" :todo "STARTED")
(:name "waiting" :todo "WAITING")
(:name "priority = A" :priority "A") (:name "priority = A" :priority "A")
(:name "priority = B" :priority "B") (:name "priority = B" :priority "B")
(:name "priority = C" :priority "C") (:name "priority = C" :priority "C")
(:name "other priority" :priority< "C") (:name "other priority" :priority< "C")
(:name "someday" :todo "SOMEDAY") (:name "someday" :todo "SOMEDAY")
(:name "I dont know yet" :todo "IDKY")))))))))) (:name "I dont know yet" :todo "IDKY"))))))))))
;; capture ;; capture
(use-package org-capture (use-package org-capture
:straight nil :straight nil
:config :config
(setq my-org-capture-file (concat org-directory "/20260509T232442==agenda--all-my-todos__org.org"))
(setq org-capture-templates (setq org-capture-templates
(cond `(("t" "TODO" entry
((or *is-linux* *is-mac*) (file+headline ,my-org-capture-file "Something to do")
'(("t" "TODO" entry "* TODO %<%m-%d> %?\n%T" :empty-lines 1)
(file+headline "~/org/my-org-note/20260509T232442==agenda--all-my-todos__org.org" "Something to do") ("s" "STARTED" entry
"* TODO %<%m-%d> %?\n%T" (file+headline ,my-org-capture-file "Something to do")
:empty-lines 1) "* STARTED %<%m-%d> %?\n%T" :empty-lines 1)
("s" "SOMEDAY" entry ("S" "SOMEDAY" entry
(file+headline "~/org/my-org-note/20260509T232442==agenda--all-my-todos__org.org" "Something to do") (file+headline ,my-org-capture-file "Something to do")
"* SOMEDAY %<%m-%d> %?\n%T" "* SOMEDAY %<%m-%d> %?\n%T" :empty-lines 1)
:empty-lines 1) ("i" "IDKY" entry
("i" "IDKY" entry (file+headline ,my-org-capture-file "Something to know")
(file+headline "~/org/my-org-note/20260509T232442==agenda--all-my-todos__org.org" "Something to do") "* IDKY %<%m-%d> %?\n%T" :empty-lines 1))))
"* 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))))
;; hugo ;; hugo
(use-package ox-hugo (use-package ox-hugo
:config :init
(with-eval-after-load 'org-capture (with-eval-after-load 'org-capture
(defun org-hugo-new-subtree-post-capture-template () (defun org-hugo-new-subtree-post-capture-template ()
"Returns `org-capture' template string for new Hugo post. "Returns `org-capture' template string for new Hugo post.
See `org-capture-templates' for more information." See `org-capture-templates' for more information."
(let* ((title (read-from-minibuffer "Post Title: ")) ;Prompt to enter the post title (let* ((title (read-from-minibuffer "Post Title: ")) ;Prompt to enter the post title
(fname (org-hugo-slug title))) (fname (org-hugo-slug title)))
(mapconcat #'identity (mapconcat #'identity
`( `(
,(concat "* TODO " title) ,(concat "* TODO " title)
":PROPERTIES:" ":PROPERTIES:"
@@ -248,25 +222,18 @@ See `org-capture-templates' for more information."
":END:" ":END:"
"\n\n") ;Place the cursor here finally "\n\n") ;Place the cursor here finally
"\n"))) "\n")))
(if *is-windows* (add-to-list 'org-capture-templates
(add-to-list 'org-capture-templates `("h" ;`org-capture' binding + h
'("h" ;`org-capture' binding + h "Hugo post"
"Hugo post" entry
entry ;; It is assumed that below file is present in `org-directory'
;; It is assumed that below file is present in `org-directory' ;; and that it has a "Blog Ideas" heading. It can even be a
;; and that it has a "Blog Ideas" heading. It can even be a ;; symlink pointing to the actual location of all-posts.org!
;; symlink pointing to the actual location of all-posts.org! (file+headline ,(if *is-windows*
(file+headline "h:/emacs/hugo/this-is-my-blog/all-blog.org" "Blog Ideas") "h:/emacs/hugo/this-is-my-blog/all-blog.org"
(function org-hugo-new-subtree-post-capture-template))) "~/org/hugo/this-is-my-blog/all-blog.org")
(add-to-list 'org-capture-templates "Blog Ideas")
'("h" ;`org-capture' binding + h (function org-hugo-new-subtree-post-capture-template)))))
"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))))))
;; presentation ;; presentation
(use-package org-tree-slide) (use-package org-tree-slide)
@@ -290,7 +257,7 @@ See `org-capture-templates' for more information."
holiday-other-holidays '((holiday-fixed 2 14 "情人节") holiday-other-holidays '((holiday-fixed 2 14 "情人节")
(holiday-fixed 4 1 "愚人节") (holiday-fixed 4 1 "愚人节")
(holiday-fixed 12 25 "圣诞节") (holiday-fixed 12 25 "圣诞节")
(holiday-fixed 6 7 "高考") (holiday-fixed 6 7 "高考")
(holiday-float 5 0 2 "母亲节") (holiday-float 5 0 2 "母亲节")
(holiday-float 6 0 3 "父亲节") (holiday-float 6 0 3 "父亲节")
(holiday-float 11 4 4 "感恩节")) (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: ;;; Commentary:
@@ -6,7 +6,7 @@
;; keycast按键广播 ;; keycast按键广播
(if use-package-always-defer (if use-package-always-defer
(use-package keycast)) (use-package keycast))
;; anzu显示isearch匹配数字 ;; anzu显示isearch匹配数字
(use-package anzu (use-package anzu
@@ -68,30 +68,33 @@ _a_ : all dwim
(#x3000 . #x303F) (#x3000 . #x303F)
(#xFF00 . #xFFEF) (#xFF00 . #xFFEF)
(#x20000 . #x2A6DF))) (#x20000 . #x2A6DF)))
(let ((start (car range)) (let ((start (car range))
(end (cdr range))) (end (cdr range)))
(dotimes (i (- end start)) (dotimes (i (- end start))
(modify-syntax-entry (+ start i) "_" jinx--syntax-table)))))) (modify-syntax-entry (+ start i) "_" jinx--syntax-table))))))
(use-package consult-jinx (use-package consult-jinx
:straight :straight
(:host github :repo "Andsy10/consult-jinx"))) (consult-jinx
:type git
:host github
:repo "Andsy10/consult-jinx")))
;; eat终端 ;; eat终端
(unless *is-windows* (unless *is-windows*
(use-package eat (use-package eat
:straight :straight
(eat :type git (eat :type git
:host codeberg :host codeberg
:repo "akib/emacs-eat" :repo "akib/emacs-eat"
:files ("*.el" :files ("*.el"
("term" "term/*.el") ("term" "term/*.el")
"*.texi" "*.texi"
"*.ti" "*.ti"
("terminfo/e" "terminfo/e/*") ("terminfo/e" "terminfo/e/*")
("terminfo/65" "terminfo/65/*") ("terminfo/65" "terminfo/65/*")
("integration" "integration/*") ("integration" "integration/*")
(:exclude ".dir-locals.el" "*-tests.el"))) (:exclude ".dir-locals.el" "*-tests.el")))
:hook :hook
(eshell-load . eat-eshell-mode) (eshell-load . eat-eshell-mode)
(eshell-load . eat-eshell-visual-command-mode) (eshell-load . eat-eshell-visual-command-mode)
@@ -113,7 +116,7 @@ _a_ : all dwim
(consult-customize consult-source-buffer :hidden t :default nil) (consult-customize consult-source-buffer :hidden t :default nil)
(add-to-list 'consult-buffer-sources persp-consult-source)) (add-to-list 'consult-buffer-sources persp-consult-source))
(setq switch-to-prev-buffer-skip (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)) (or (not (persp-is-current-buffer buff))
(cl-some (lambda (re) (string-match-p re (buffer-name buff))) (cl-some (lambda (re) (string-match-p re (buffer-name buff)))
consult-buffer-filter)))) consult-buffer-filter))))
@@ -133,7 +136,7 @@ _a_ : all dwim
(use-package ediff (use-package ediff
:config :config
(setq ediff-window-setup-function 'ediff-setup-windows-plain (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 ;; diff-hl
(use-package diff-hl (use-package diff-hl
@@ -147,13 +150,19 @@ _a_ : all dwim
:config :config
(setq project-switch-commands (assq-delete-all 'project-vc-dir project-switch-commands)) (setq project-switch-commands (assq-delete-all 'project-vc-dir project-switch-commands))
(setq project-switch-commands (setq project-switch-commands
(seq-uniq (append project-switch-commands (seq-uniq (append project-switch-commands
'((magit-project-status "Magit" ?v) '((magit-project-status "Magit" ?v)
(eat-project "Eat" ?E) (eat-project "Eat" ?E)
(project-query-replace-regexp "Query Replace" ?R) (project-query-replace-regexp "Query Replace" ?R)
(consult-ripgrep "Ripgrep" ?r)))))) (consult-ripgrep "Ripgrep" ?r)
(consult-project-buffer "Buffers" ?b)
(project-ibuffer "Ibuffer" ?i))))))
(use-package ibuffer-projectile) (use-package project-ibuffer
:straight
(project-ibuffer :type git
:host github
:repo "Andsy10/project-ibuffer"))
;; emms ;; emms
(use-package emms (use-package emms
@@ -162,7 +171,7 @@ _a_ : all dwim
:config :config
(emms-all) (emms-all)
(setq emms-player-list '(emms-player-vlc) (setq emms-player-list '(emms-player-vlc)
emms-info-functions '(emms-info-native)) emms-info-functions '(emms-info-native))
(emms-history-load)) (emms-history-load))
;; tokei ;; tokei
@@ -208,7 +217,7 @@ _a_ : all dwim
'proced-format-alist 'proced-format-alist
'(custom user pid ppid sess tree pcpu pmem rss start time state (args comm))) '(custom user pid ppid sess tree pcpu pmem rss start time state (args comm)))
(setq proced-low-memory-usage-threshold 0.025 (setq proced-low-memory-usage-threshold 0.025
proced-medium-memory-usage-threshold 0.125)) proced-medium-memory-usage-threshold 0.125))
;; syncthing ;; syncthing
(use-package 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: ;;; Commentary:
@@ -59,14 +59,18 @@
(:map markdown-mode-map (:map markdown-mode-map
("C-c C-e" . markdown-do)) ("C-c C-e" . markdown-do))
:hook :hook
(markdown-mode . toggle-truncate-lines) (markdown-mode . visual-line-mode)
:init :init
(setq markdown-command "multimarkdown" (setq markdown-command "multimarkdown"
markdown-fontify-code-blocks-natively t)) markdown-fontify-code-blocks-natively t))
(use-package edit-indirect) (use-package edit-indirect)
;; html ;; html
(use-package shr
:config
(setq shr-inhibit-images nil))
(use-package htmlize) (use-package htmlize)
(provide 'init-prog) (provide 'init-prog)

View File

@@ -14,17 +14,17 @@
(cond (cond
(*is-windows* (*is-windows*
(add-to-list 'load-path "h:/emacs/emacs-chinese-word-segmentation/") ;设置为进程调用方式 (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-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-dict-directory "h:/emacs/emacs-chinese-word-segmentation/cppjieba/dict") ;直接设置进程命令,绕过 Windows shell 检测
(setq cns-process-shell-command (setq cns-process-shell-command
(format "%s %s %s %s %s %s" (format "%s %s %s %s %s %s"
cns-prog cns-prog
(concat (file-name-as-directory cns-dict-directory) "jieba.dict.utf8") (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) "hmm_model.utf8")
(concat (file-name-as-directory cns-dict-directory) "user.dict.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) "idf.utf8")
(concat (file-name-as-directory cns-dict-directory) "stop_words.utf8")))) (concat (file-name-as-directory cns-dict-directory) "stop_words.utf8"))))
(t (t
(add-to-list 'load-path "~/emacs-stuff/emacs-chinese-word-segmentation/") (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: ;;; Commentary:
@@ -89,6 +89,9 @@
;; 优化换行规则 ;; 优化换行规则
(setq word-wrap-by-category t) (setq word-wrap-by-category t)
;; 禁用制表符
(setq-default indent-tabs-mode nil)
;; 修改mac键位 ;; 修改mac键位
(when *is-mac* (when *is-mac*
(setq mac-command-modifier 'meta) (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: ;;; Commentary:

View File

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

View File

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

View File

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

View File

@@ -16,7 +16,7 @@
popper-group-by-directory popper-group-by-directory
:hook :hook
(after-init . popper-mode) (after-init . popper-mode)
:init :init
(setq popper-reference-buffers (setq popper-reference-buffers
'("\\*Messages\\*" '("\\*Messages\\*"
@@ -38,17 +38,17 @@
"\\*Edit Annotation.*\\*" "\\*Edit Annotation.*\\*"
"\\*Flutter\\*" "\\*Flutter\\*"
"\\*Ibuffer\\*" "\\*Ibuffer\\*"
"^\\*Finder-" "^\\*Finder-"
"Buffers\\*$" "Buffers\\*$"
"^\\*Geiser" "^\\*Geiser"
"\\*gptel-Kimi-Code\\*" "\\*gptel-Kimi-Code\\*"
"^\\*sly" "^\\*sly"
"\\*gptel-agent:.*\\*" "\\*gptel-agent:.*\\*"
"^magit" "^magit"
"\\*discomfort\\*" "\\*discomfort\\*"
"\\*eww bookmarks\\*" "\\*eww bookmarks\\*"
"\\*eww history\\*" "\\*eww history\\*"
"\\*Proced\\*" "\\*Proced\\*"
bookmark-bmenu-mode bookmark-bmenu-mode
lsp-bridge-ref-mode lsp-bridge-ref-mode
comint-mode comint-mode
@@ -63,10 +63,10 @@
process-menu-mode list-environment-mode cargo-process-mode process-menu-mode list-environment-mode cargo-process-mode
youdao-dictionary-mode osx-dictionary-mode fanyi-mode youdao-dictionary-mode osx-dictionary-mode fanyi-mode
gptel-mode gptel-mode
ibuffer-mode ibuffer-mode
"^\\*eshell.*\\*.*$" eshell-mode "^\\*eshell.*\\*.*$" eshell-mode
".*eshell\\*$" ".*eshell\\*$"
"^\\*shell.*\\*.*$" shell-mode "^\\*shell.*\\*.*$" shell-mode
"^\\*terminal.*\\*.*$" term-mode "^\\*terminal.*\\*.*$" term-mode
"^\\*vterm.*\\*.*$" vterm-mode "^\\*vterm.*\\*.*$" vterm-mode
@@ -94,7 +94,7 @@
"\\*rustfmt\\*$" rustic-compilation-mode rustic-cargo-clippy-mode "\\*rustfmt\\*$" rustic-compilation-mode rustic-cargo-clippy-mode
rustic-cargo-outdated-mode rustic-cargo-test-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) (when (display-grayscale-p)
(setq popper-mode-line (setq popper-mode-line

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: ;;; Commentary:
;; A green dark theme base on solarized-theme ;; 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: ;;; Commentary:
;; A green light theme base on solarized-theme ;; A green light theme base on solarized-theme