style: Convert tabs to spaces across Emacs config

This commit is contained in:
User
2026-07-02 17:36:06 +08:00
parent abe00aa936
commit ddd2ba4905
24 changed files with 384 additions and 379 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,13 +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-autosave-interval 300)) savehist-autosave-interval 300))
;; saveplace保存光标位置 ;; saveplace保存光标位置
(use-package saveplace (use-package saveplace
@@ -107,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
@@ -213,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*
@@ -224,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))))))

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,9 +26,9 @@
(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"))
@@ -40,18 +40,18 @@
;; 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
@@ -127,7 +127,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))))))
@@ -137,7 +137,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)
@@ -147,10 +147,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)
@@ -165,7 +165,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: ")))
@@ -137,7 +137,7 @@ explanations, no quotes, no punctuation, no file extension."
: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))))
@@ -134,9 +134,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...")
@@ -146,15 +146,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")
@@ -172,8 +172,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)
@@ -258,17 +258,17 @@ argument)."
(consult-ripgrep (project-root proj)))) (consult-ripgrep (project-root proj))))
(defun consult-colors-emacs (color) (defun consult-colors-emacs (color)
"Show a list of all supported colors for a particular frame. "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 You can insert the name (default), or insert or kill the hexadecimal or RGB
value of the selected COLOR." value of the selected COLOR."
(interactive (interactive
(list (consult--read (list-colors-duplicates (defined-colors)) (list (consult--read (list-colors-duplicates (defined-colors))
:prompt "Emacs color: " :prompt "Emacs color: "
:require-match t :require-match t
:category 'color :category 'color
:history '(:input consult-colors-history)))) :history '(:input consult-colors-history))))
(insert color)) (insert color))
(defun fix-theme-colors () (defun fix-theme-colors ()
"Fix invalid color name in theme files." "Fix invalid color name in theme files."
@@ -303,9 +303,9 @@ value of the selected COLOR."
"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

@@ -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)

View File

@@ -13,11 +13,11 @@
:init :init
(setq org-directory (setq org-directory
(cond (cond
(*is-windows* "h:/emacs/my-org-note") (*is-windows* "h:/emacs/my-org-note")
(*is-mac* "~/org/my-org-note") (*is-mac* "~/org/my-org-note")
(*is-linux* "~/org/my-org-note") (*is-linux* "~/org/my-org-note")
(*is-android* "~/storage/shared/my-org-note"))) (*is-android* "~/storage/shared/my-org-note")))
:config :config
(defvar org-hide-space-keywords (defvar org-hide-space-keywords
@@ -35,28 +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)" "SOMEDAY(S)" "STARTED(s)" "WAITING(w)" "|" "DONE(d!/!)" "CANCELLED(c@/!)") (quote ((sequence "TODO(t)" "SOMEDAY(S)" "STARTED(s)" "WAITING(w)" "|" "DONE(d!/!)" "CANCELLED(c@/!)")
(sequence "IDKY(i)" "|" "KNOWN(k)" "CANCELLED(c@/!)")))) (sequence "IDKY(i)" "|" "KNOWN(k)" "CANCELLED(c@/!)"))))
;; agenda相关 ;; agenda相关
(setq org-agenda-files `(,(concat org-directory "/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-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
@@ -84,13 +84,13 @@
:init :init
(setq denote-directory org-directory) (setq denote-directory org-directory)
(setq denote-org-store-link-to-heading 'context (setq denote-org-store-link-to-heading 'context
denote-prompts '(title signature keywords)) denote-prompts '(title signature keywords))
(setq denote-title-history nil (setq denote-title-history nil
denote-signature-history denote-signature-history
'("note" "project" "fun" "wisdom" "article" "data" "metanote" "agenda" "journal" "archive") '("note" "project" "fun" "wisdom" "article" "data" "metanote" "agenda" "journal" "archive")
denote-known-keywords denote-known-keywords
'("emacs") '("emacs")
denote-title-history nil)) denote-title-history nil))
;; denote-org ;; denote-org
(use-package denote-org) (use-package denote-org)
@@ -98,8 +98,8 @@
;; denote-lint ;; denote-lint
(use-package denote-lint (use-package denote-lint
:straight '(denote-lint :type git :straight '(denote-lint :type git
:host github :host github
:repo "Andsy10/denote-lint") :repo "Andsy10/denote-lint")
:config :config
(setq org-link-elisp-confirm-function nil)) (setq org-link-elisp-confirm-function nil))
@@ -131,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)
@@ -153,22 +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
'(("qd" "TODO entries sort by closed time" '(("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
@@ -178,13 +178,13 @@
((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 "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
@@ -192,18 +192,18 @@
:config :config
(setq my-org-capture-file (concat org-directory "/20260509T232442==agenda--all-my-todos__org.org")) (setq my-org-capture-file (concat org-directory "/20260509T232442==agenda--all-my-todos__org.org"))
(setq org-capture-templates (setq org-capture-templates
`(("t" "TODO" entry `(("t" "TODO" entry
(file+headline ,my-org-capture-file "Something to do") (file+headline ,my-org-capture-file "Something to do")
"* TODO %<%m-%d> %?\n%T" :empty-lines 1) "* TODO %<%m-%d> %?\n%T" :empty-lines 1)
("s" "STARTED" entry ("s" "STARTED" entry
(file+headline ,my-org-capture-file "Something to do") (file+headline ,my-org-capture-file "Something to do")
"* STARTED %<%m-%d> %?\n%T" :empty-lines 1) "* STARTED %<%m-%d> %?\n%T" :empty-lines 1)
("S" "SOMEDAY" entry ("S" "SOMEDAY" entry
(file+headline ,my-org-capture-file "Something to do") (file+headline ,my-org-capture-file "Something to do")
"* SOMEDAY %<%m-%d> %?\n%T" :empty-lines 1) "* SOMEDAY %<%m-%d> %?\n%T" :empty-lines 1)
("i" "IDKY" entry ("i" "IDKY" entry
(file+headline ,my-org-capture-file "Something to know") (file+headline ,my-org-capture-file "Something to know")
"* IDKY %<%m-%d> %?\n%T" :empty-lines 1)))) "* IDKY %<%m-%d> %?\n%T" :empty-lines 1))))
;; hugo ;; hugo
(use-package ox-hugo (use-package ox-hugo
@@ -214,7 +214,7 @@
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:"
@@ -230,9 +230,9 @@ See `org-capture-templates' for more information."
;; 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 ,(if *is-windows*
"h:/emacs/hugo/this-is-my-blog/all-blog.org" "h:/emacs/hugo/this-is-my-blog/all-blog.org"
"~/org/hugo/this-is-my-blog/all-blog.org") "~/org/hugo/this-is-my-blog/all-blog.org")
"Blog Ideas") "Blog Ideas")
(function org-hugo-new-subtree-post-capture-template))))) (function org-hugo-new-subtree-post-capture-template)))))
;; presentation ;; presentation
@@ -257,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

@@ -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,9 +68,9 @@ _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
@@ -85,16 +85,16 @@ _a_ : all dwim
(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)
@@ -116,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))))
@@ -136,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
@@ -150,19 +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) (consult-project-buffer "Buffers" ?b)
(project-ibuffer "Ibuffer" ?i)))))) (project-ibuffer "Ibuffer" ?i))))))
(use-package project-ibuffer (use-package project-ibuffer
:straight :straight
(project-ibuffer :type git (project-ibuffer :type git
:host github :host github
:repo "Andsy10/project-ibuffer")) :repo "Andsy10/project-ibuffer"))
;; emms ;; emms
(use-package emms (use-package emms
@@ -171,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
@@ -217,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:
@@ -62,7 +62,7 @@
(markdown-mode . visual-line-mode) (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)

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,13 +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-autosave-interval 300)) savehist-autosave-interval 300))
(use-package saveplace (use-package saveplace
:hook :hook
@@ -74,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

@@ -18,11 +18,11 @@
;; 把主题加载延迟到frame创建之后防止daemon模式下宏不能正常展开 ;; 把主题加载延迟到frame创建之后防止daemon模式下宏不能正常展开
(if (and (daemonp) (not *is-android*)) (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))))
(if *is-android* (if *is-android*
(load-theme 'my-light t) (load-theme 'my-light t)
(load-theme 'my-dark t)))) (load-theme 'my-dark t))))
;; 行号 ;; 行号
@@ -31,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
@@ -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