chore(config): Refactor Emacs configuration with multiple improvements
- Replace projectile with built-in project.el - Add cal-china-x for Chinese lunar calendar support - Add dired-gitignore integration with dirvish - Add mwim for smarter line navigation - Add keycast mode for key display - Add ef-themes theme collection - Improve corfu terminal handling for Emacs 31+ - Add gptel-agent-project and consult-ripgrep-project helpers - Remove custom.el from repo, support init-local.el for local config - Update theme faces for transient, keycast, and calendar holidays - Various keybinding additions and cleanup
This commit is contained in:
5
.gitignore
vendored
5
.gitignore
vendored
@@ -6,6 +6,7 @@
|
|||||||
!lisp/**/
|
!lisp/**/
|
||||||
!lisp/**/*.el
|
!lisp/**/*.el
|
||||||
|
|
||||||
lisp/init-proxy.el
|
|
||||||
|
|
||||||
!.gitignore
|
!.gitignore
|
||||||
|
|
||||||
|
/lisp/init-proxy.el
|
||||||
|
/lisp/init-local.el
|
||||||
|
|||||||
13
custom.el
13
custom.el
@@ -1,13 +0,0 @@
|
|||||||
;;; -*- lexical-binding: t -*-
|
|
||||||
(custom-set-variables
|
|
||||||
;; custom-set-variables was added by Custom.
|
|
||||||
;; If you edit it by hand, you could mess it up, so be careful.
|
|
||||||
;; Your init file should contain only one such instance.
|
|
||||||
;; If there is more than one, they won't work right.
|
|
||||||
'(safe-local-variable-values '((org-use-tag-inheritance))))
|
|
||||||
(custom-set-faces
|
|
||||||
;; custom-set-faces was added by Custom.
|
|
||||||
;; If you edit it by hand, you could mess it up, so be careful.
|
|
||||||
;; Your init file should contain only one such instance.
|
|
||||||
;; If there is more than one, they won't work right.
|
|
||||||
)
|
|
||||||
7
init.el
7
init.el
@@ -9,9 +9,7 @@
|
|||||||
(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)
|
||||||
(when (file-exists-p custom-file)
|
|
||||||
(load-file custom-file))
|
|
||||||
|
|
||||||
(require 'init-const)
|
(require 'init-const)
|
||||||
|
|
||||||
@@ -32,7 +30,8 @@
|
|||||||
(require 'init-ui)
|
(require 'init-ui)
|
||||||
(require 'init-kbd-func)
|
(require 'init-kbd-func)
|
||||||
(require 'init-kbd)
|
(require 'init-kbd)
|
||||||
(require 'init-segmentation))
|
(require 'init-segmentation)
|
||||||
|
(load "init-local" t))
|
||||||
(progn
|
(progn
|
||||||
(require 'init-terminal-startup)
|
(require 'init-terminal-startup)
|
||||||
(load "init-proxy" t)
|
(load "init-proxy" t)
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
;;; 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:
|
||||||
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
;; Fix video-mtn preview issue on Windows
|
;; Fix video-mtn preview issue on Windows
|
||||||
;; The problem: mtn generates thumbnails with filename like "video.mp4.jpg",
|
;; The problem: mtn generates thumbnails with filename like "video.mp4.jpg",
|
||||||
;; but dirvish expects MD5-based filename like "a1b2c3d4.jpg"
|
;; but dirvish expects MD5-based filename like "a1b2c3d4.jpg"
|
||||||
|
|
||||||
|
;;; Code:
|
||||||
|
|
||||||
(with-eval-after-load 'dirvish
|
(with-eval-after-load 'dirvish
|
||||||
;; Function to find mtn output file for a given video file in cache directory
|
;; Function to find mtn output file for a given video file in cache directory
|
||||||
(defun my/dirvish-find-mtn-output (video-file cache-dir ext)
|
(defun my/dirvish-find-mtn-output (video-file cache-dir ext)
|
||||||
|
|||||||
@@ -55,10 +55,11 @@
|
|||||||
(:map corfu-map
|
(:map corfu-map
|
||||||
("RET" . nil)))
|
("RET" . nil)))
|
||||||
|
|
||||||
(unless (display-graphic-p)
|
(use-package corfu-terminal
|
||||||
(use-package corfu-terminal
|
:if (not (and (display-graphic-p)
|
||||||
|
(>= emacs-major-version 31)))
|
||||||
:init
|
:init
|
||||||
(add-hook 'global-corfu-mode-hook 'corfu-terminal-mode)))
|
(corfu-terminal-mode))
|
||||||
|
|
||||||
;; 在eshell中使用tab打开补全
|
;; 在eshell中使用tab打开补全
|
||||||
(add-hook 'eshell-mode-hook
|
(add-hook 'eshell-mode-hook
|
||||||
|
|||||||
@@ -7,8 +7,7 @@
|
|||||||
;; 识别操作系统
|
;; 识别操作系统
|
||||||
(defconst *is-mac* (eq system-type 'darwin))
|
(defconst *is-mac* (eq system-type 'darwin))
|
||||||
(defconst *is-linux* (eq system-type 'gnu/linux))
|
(defconst *is-linux* (eq system-type 'gnu/linux))
|
||||||
(defconst *is-windows* (or (eq system-type 'ms-dos)
|
(defconst *is-windows* (or (eq system-type 'ms-dos) (eq system-type 'windows-nt)))
|
||||||
(eq system-type 'windows-nt)))
|
|
||||||
(defconst *is-android* (if (getenv "TERMUX_VERSION") t nil))
|
(defconst *is-android* (if (getenv "TERMUX_VERSION") t nil))
|
||||||
|
|
||||||
(if *is-windows*
|
(if *is-windows*
|
||||||
|
|||||||
@@ -5,19 +5,20 @@
|
|||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
(use-package dashboard
|
(use-package dashboard
|
||||||
:demand t
|
:autoload dashboard-setup-startup-hook
|
||||||
:config
|
:init
|
||||||
(dashboard-setup-startup-hook)
|
(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 ##### # # ##### ####### # # # # ##### ##### "
|
||||||
(setq dashboard-banner-ascii " ##### # # # # ####### # # # ##### ##### \n# # ## # # # # ## ## # # # # # # \n# # # # # # # # # # # # # # # \n# #### # # # # # ##### # # # # # # ##### \n# # # # # # # # # # ####### # # \n# # # ## # # # # # # # # # # # \n ##### # # ##### ####### # # # # ##### ##### ")
|
dashboard-startup-banner 'ascii
|
||||||
(setq dashboard-startup-banner 'ascii)
|
dashboard-footer-messages '("hello")
|
||||||
(setq dashboard-footer-messages '("hello"))
|
dashboard-center-content t
|
||||||
(setq dashboard-center-content t)
|
dashboard-navigation-cycle t
|
||||||
(setq dashboard-navigation-cycle t)
|
dashboard-items '((recents . 8)
|
||||||
(setq dashboard-items '((recents . 15)
|
|
||||||
(bookmarks . 5)
|
(bookmarks . 5)
|
||||||
(projects . 5)))
|
(projects . 5))
|
||||||
(setq dashboard-item-shortcuts '((recents . "r") (bookmarks . "b") (projects . "p") (agenda . "a") (registers . "e"))))
|
dashboard-item-shortcuts '((recents . "r") (bookmarks . "b") (projects . "p") (agenda . "a") (registers . "e")))
|
||||||
|
(dashboard-setup-startup-hook))
|
||||||
|
|
||||||
(provide 'init-dashboard)
|
(provide 'init-dashboard)
|
||||||
|
|
||||||
;;; init-dashboard.el ends here
|
;;; init-dashboard.el ends here
|
||||||
|
|||||||
@@ -4,30 +4,35 @@
|
|||||||
|
|
||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
(setq dired-dwim-target t)
|
|
||||||
|
|
||||||
(use-package dired
|
(use-package dired
|
||||||
:straight nil
|
:straight nil
|
||||||
:config
|
:config
|
||||||
(when *is-mac*
|
(when *is-mac*
|
||||||
(setq insert-directory-program "gls")
|
(setq insert-directory-program "gls"
|
||||||
(setq dired-use-ls-dired t)))
|
dired-use-ls-dired t))
|
||||||
|
(setq dired-dwim-target t
|
||||||
|
dired-listing-switches
|
||||||
|
"-l --almost-all --human-readable --group-directories-first --no-group"
|
||||||
|
dired-recursive-deletes 'always
|
||||||
|
dired-recursive-copies 'always)
|
||||||
|
(put 'dired-find-alternate-file 'disabled nil))
|
||||||
|
|
||||||
;; dirvish
|
;; dirvish
|
||||||
(use-package dirvish
|
(use-package dirvish
|
||||||
:hook
|
:hook
|
||||||
(dired-mode-hook . denote-dired-mode)
|
(dired-mode-hook . denote-dired-mode)
|
||||||
|
|
||||||
:init
|
:init
|
||||||
(dirvish-override-dired-mode)
|
(dirvish-override-dired-mode)
|
||||||
|
|
||||||
:config
|
:config
|
||||||
|
(require 'vc)
|
||||||
(if *is-windows* (require 'fix-dirvish-preview))
|
(if *is-windows* (require 'fix-dirvish-preview))
|
||||||
|
|
||||||
(if (or *is-mac* *is-android*)
|
(if (or *is-mac* *is-android*)
|
||||||
(setq dirvish-hide-details t)
|
(setq dirvish-hide-details t)
|
||||||
(setq dirvish-hide-details '(dirvish-side)))
|
(setq dirvish-hide-details '(dirvish-side)))
|
||||||
(setq dirvish-use-mode-line 'global)
|
(setq dirvish-use-mode-line t)
|
||||||
|
|
||||||
(unless *is-windows*
|
(unless *is-windows*
|
||||||
(setq dirvish-attributes '(file-time file-size)))
|
(setq dirvish-attributes '(file-time file-size)))
|
||||||
@@ -75,18 +80,36 @@
|
|||||||
("g" "~/gptel/" "gptel sessions")))
|
("g" "~/gptel/" "gptel sessions")))
|
||||||
(t nil))))
|
(t nil))))
|
||||||
|
|
||||||
|
;; gitignore
|
||||||
|
(use-package dired-gitignore
|
||||||
|
:after
|
||||||
|
(dirvish dirvish-vc transient)
|
||||||
|
:demand t
|
||||||
|
:config
|
||||||
|
(transient-define-suffix dirvish-toggle-gitignore ()
|
||||||
|
"Toggle `dired-gitignore-mode' in current Dirvish buffer."
|
||||||
|
:description
|
||||||
|
(lambda ()
|
||||||
|
(format "Gitignore filter (%s)"
|
||||||
|
(if dired-gitignore-mode
|
||||||
|
(propertize "+" 'face 'transient-value)
|
||||||
|
(propertize "-" 'face 'transient-inactive-value))))
|
||||||
|
:transient t
|
||||||
|
(interactive)
|
||||||
|
(dired-gitignore-mode 'toggle))
|
||||||
|
|
||||||
|
(transient-append-suffix 'dirvish-vc-menu "v"
|
||||||
|
'("i" dirvish-toggle-gitignore)))
|
||||||
|
|
||||||
|
;; trashed
|
||||||
(use-package trashed
|
(use-package trashed
|
||||||
:commands
|
:commands
|
||||||
(trashed)
|
(trashed)
|
||||||
:config
|
:config
|
||||||
(setq trashed-action-confirmer 'y-or-n-p)
|
(setq trashed-action-confirmer 'y-or-n-p
|
||||||
(setq trashed-use-header-line t)
|
trashed-use-header-line t
|
||||||
(setq trashed-sort-key '("Date deleted" . t))
|
trashed-sort-key '("Date deleted" . t)
|
||||||
(setq trashed-date-format "%Y-%m-%d %H:%M:%S"))
|
trashed-date-format "%Y-%m-%d %H:%M:%S"))
|
||||||
|
|
||||||
(setq dired-listing-switches
|
|
||||||
"-l --almost-all --human-readable --group-directories-first --no-group")
|
|
||||||
(put 'dired-find-alternate-file 'disabled nil)
|
|
||||||
|
|
||||||
(provide 'init-dired)
|
(provide 'init-dired)
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
(eval-print-last-sexp)))
|
(eval-print-last-sexp)))
|
||||||
(load bootstrap-file nil 'nomessage))
|
(load bootstrap-file nil 'nomessage))
|
||||||
|
|
||||||
;; 安装el-patch
|
;; el-patch
|
||||||
(use-package el-patch
|
(use-package el-patch
|
||||||
:straight t)
|
:straight t)
|
||||||
|
|
||||||
@@ -45,10 +45,9 @@
|
|||||||
(org-indent-mode nil org-indent)
|
(org-indent-mode nil org-indent)
|
||||||
(desktop-environment-mode nil desktop-environment)
|
(desktop-environment-mode nil desktop-environment)
|
||||||
(hs-minor-mode nil hideshow)
|
(hs-minor-mode nil hideshow)
|
||||||
(god-local-mode ,(propertize " THANK-GOD-MODE" 'face 'god-mode-lighter) god-mode)
|
|
||||||
(rainbow-delimiters-mode ,(propertize " Rdelimiters" 'face 'rainbow-delimiters-depth-1-face) rainbow-delimiters))))
|
(rainbow-delimiters-mode ,(propertize " Rdelimiters" 'face 'rainbow-delimiters-depth-1-face) rainbow-delimiters))))
|
||||||
|
|
||||||
;; 安装gcmh用于管理内存回收
|
;; gcmh,管理垃圾回收
|
||||||
(use-package gcmh
|
(use-package gcmh
|
||||||
:delight
|
:delight
|
||||||
:demand t
|
:demand t
|
||||||
@@ -59,7 +58,7 @@
|
|||||||
:config
|
:config
|
||||||
(gcmh-mode 1))
|
(gcmh-mode 1))
|
||||||
|
|
||||||
;; 安装benchmark-init
|
;; benchmark-init
|
||||||
(use-package benchmark-init
|
(use-package benchmark-init
|
||||||
:init
|
:init
|
||||||
(benchmark-init/activate)
|
(benchmark-init/activate)
|
||||||
|
|||||||
@@ -11,18 +11,8 @@
|
|||||||
:config
|
:config
|
||||||
(setq gptel-log-level t)
|
(setq gptel-log-level t)
|
||||||
(setq gptel-default-mode 'org-mode)
|
(setq gptel-default-mode 'org-mode)
|
||||||
|
|
||||||
(defun my/org-auto-gptel ()
|
|
||||||
(when (derived-mode-p 'org-mode)
|
|
||||||
(save-excursion
|
|
||||||
(goto-char (point-min))
|
|
||||||
(when (re-search-forward "^#\\+GPTEL_MODEL:" nil t)
|
|
||||||
(gptel-mode)))))
|
|
||||||
(add-hook 'org-mode-hook #'my/org-auto-gptel)
|
|
||||||
|
|
||||||
(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: ")))
|
||||||
|
|
||||||
(gptel-make-tool
|
(gptel-make-tool
|
||||||
|
|||||||
@@ -154,6 +154,17 @@ Disable jinx-mode if it's enable and global-jinx-mode is disable , otherwise tog
|
|||||||
(dolist (buf buffers)
|
(dolist (buf buffers)
|
||||||
(persp-set-buffer buf))))
|
(persp-set-buffer buf))))
|
||||||
|
|
||||||
|
(defun gptel-agent-project ()
|
||||||
|
"Run `gptel-agent' in current project's root (by run it with prefix argument)."
|
||||||
|
(interactive)
|
||||||
|
(let ((current-prefix-arg '-))
|
||||||
|
(call-interactively 'gptel-agent)))
|
||||||
|
|
||||||
|
(defun consult-ripgrep-project ()
|
||||||
|
"Run `consult-ripgrep' in current project's root."
|
||||||
|
(interactive)
|
||||||
|
(when-let* ((proj (project-current t)))
|
||||||
|
(consult-ripgrep (project-root proj))))
|
||||||
|
|
||||||
(provide 'init-kbd-func)
|
(provide 'init-kbd-func)
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
"o" 'gptel
|
"o" 'gptel
|
||||||
"m" 'gptel-menu
|
"m" 'gptel-menu
|
||||||
"s" 'gptel-send
|
"s" 'gptel-send
|
||||||
"a" 'gptel-agent
|
"a" 'gptel-agent-project
|
||||||
"t" 'gptel-tools)
|
"t" 'gptel-tools)
|
||||||
|
|
||||||
(general-def gptel-mode-map
|
(general-def gptel-mode-map
|
||||||
@@ -45,14 +45,15 @@
|
|||||||
"t" 'consult-theme
|
"t" 'consult-theme
|
||||||
"c" 'my-color-picker
|
"c" 'my-color-picker
|
||||||
"f" 'describe-face
|
"f" 'describe-face
|
||||||
"r" 'rainbow-delimiters-mode)
|
"r" 'rainbow-delimiters-mode
|
||||||
|
"k" 'keycast-header-line-mode)
|
||||||
|
|
||||||
;; f for find and consult command
|
;; f for find and consult command
|
||||||
(general-def
|
(general-def
|
||||||
:prefix "C-c f"
|
:prefix "C-c f"
|
||||||
"r" 'consult-recent-file
|
"r" 'consult-recent-file
|
||||||
"f" 'consult-fd
|
"f" 'consult-fd
|
||||||
"g" 'consult-ripgrep
|
"g" 'consult-ripgrep-project
|
||||||
"e" 'consult-flycheck
|
"e" 'consult-flycheck
|
||||||
"l" 'consult-locate
|
"l" 'consult-locate
|
||||||
"h" 'consult-fd-home
|
"h" 'consult-fd-home
|
||||||
@@ -60,7 +61,8 @@
|
|||||||
"d" 'my-open-current-directory
|
"d" 'my-open-current-directory
|
||||||
"j" 'consult-jinx
|
"j" 'consult-jinx
|
||||||
"k" 'consult-kmacro
|
"k" 'consult-kmacro
|
||||||
"o" 'consult-outline)
|
"o" 'consult-outline
|
||||||
|
"i" 'consult-info)
|
||||||
|
|
||||||
;; t for modes toggle
|
;; t for modes toggle
|
||||||
(general-def
|
(general-def
|
||||||
@@ -137,6 +139,15 @@
|
|||||||
"C-s" 'consult-line
|
"C-s" 'consult-line
|
||||||
"C-r" 'consult-line)
|
"C-r" 'consult-line)
|
||||||
|
|
||||||
|
(general-def (dired-mode-map dirvish-mode-map)
|
||||||
|
:prefix "C-c d"
|
||||||
|
"d" 'dirvish-setup-menu
|
||||||
|
"r" 'dirvish-renaming-menu
|
||||||
|
"v" 'dirvish-vc-menu
|
||||||
|
"m" 'dirvish-mark-menu
|
||||||
|
"i" 'dirvish-file-info-menu
|
||||||
|
"y" 'dirvish-yank-menu)
|
||||||
|
|
||||||
;; magit
|
;; magit
|
||||||
(general-def magit-mode-map
|
(general-def magit-mode-map
|
||||||
"C-<tab>" 'my-magit-toggle-parent-section
|
"C-<tab>" 'my-magit-toggle-parent-section
|
||||||
@@ -182,7 +193,8 @@
|
|||||||
"M-}" 'org-next-visible-heading
|
"M-}" 'org-next-visible-heading
|
||||||
"C-," 'duplicate-and-move-to-next-line
|
"C-," 'duplicate-and-move-to-next-line
|
||||||
"C-c o l" 'denote-link
|
"C-c o l" 'denote-link
|
||||||
"C-a" 'org-beginning-of-line)
|
"C-c o L" 'denote-org-link-to-heading
|
||||||
|
"C-c o b" 'denote-backlinks)
|
||||||
|
|
||||||
;; hs-hide-mode
|
;; hs-hide-mode
|
||||||
(general-def hs-minor-mode-map
|
(general-def hs-minor-mode-map
|
||||||
@@ -217,6 +229,10 @@
|
|||||||
"C-c p d" 'persp-kill
|
"C-c p d" 'persp-kill
|
||||||
"C-x M-b" 'persp-ibuffer)
|
"C-x M-b" 'persp-ibuffer)
|
||||||
|
|
||||||
|
;; visual-line
|
||||||
|
(general-def visual-line-mode-map
|
||||||
|
"C-k" 'kill-visual-line)
|
||||||
|
|
||||||
;; global map with C-c prefix
|
;; global map with C-c prefix
|
||||||
(general-def
|
(general-def
|
||||||
:prefix "C-c"
|
:prefix "C-c"
|
||||||
@@ -229,7 +245,7 @@
|
|||||||
"a" 'org-agenda
|
"a" 'org-agenda
|
||||||
"l" 'org-store-link
|
"l" 'org-store-link
|
||||||
"k" 'comment-line
|
"k" 'comment-line
|
||||||
;; "v" 'vterm
|
"K" 'comment-kill
|
||||||
"E" 'eshell
|
"E" 'eshell
|
||||||
"C-t" 'trashed
|
"C-t" 'trashed
|
||||||
"C-s" 'consult-focus-lines)
|
"C-s" 'consult-focus-lines)
|
||||||
@@ -261,13 +277,15 @@
|
|||||||
"C-," 'crux-duplicate-current-line-or-region
|
"C-," 'crux-duplicate-current-line-or-region
|
||||||
"C-k" 'crux-smart-kill-line
|
"C-k" 'crux-smart-kill-line
|
||||||
"C-<backspace>" 'crux-kill-line-backwards
|
"C-<backspace>" 'crux-kill-line-backwards
|
||||||
"C-a" 'crux-move-beginning-of-line
|
|
||||||
"M-y" 'consult-yank-from-kill-ring
|
"M-y" 'consult-yank-from-kill-ring
|
||||||
"C-c <backspace>" 'hungry-delete-backward
|
"C-c <backspace>" 'hungry-delete-backward
|
||||||
"C-c C-<backspace>" 'hungry-delete-forward
|
"C-c C-<backspace>" 'hungry-delete-forward
|
||||||
"M-P" 'drag-stuff-up
|
"M-P" 'drag-stuff-up
|
||||||
"M-N" 'drag-stuff-down
|
"M-N" 'drag-stuff-down
|
||||||
|
"M-F" 'drag-stuff-right
|
||||||
|
"M-B" 'drag-stuff-left
|
||||||
"C-M-SPC" 'er/mark-symbol
|
"C-M-SPC" 'er/mark-symbol
|
||||||
|
"M-@" 'er/mark-word
|
||||||
|
|
||||||
;; undo
|
;; undo
|
||||||
"C-/" 'undo-fu-only-undo
|
"C-/" 'undo-fu-only-undo
|
||||||
@@ -295,6 +313,8 @@
|
|||||||
|
|
||||||
;; other
|
;; other
|
||||||
"C-x r b" 'consult-bookmark
|
"C-x r b" 'consult-bookmark
|
||||||
|
"C-x p b" 'consult-project-buffer
|
||||||
|
"C-x p E" 'eat-project
|
||||||
"C-;" 'embark-act)
|
"C-;" 'embark-act)
|
||||||
|
|
||||||
(when *is-android*
|
(when *is-android*
|
||||||
|
|||||||
@@ -17,21 +17,6 @@
|
|||||||
(or (eq char ?<)
|
(or (eq char ?<)
|
||||||
(electric-pair-default-inhibit char))))))
|
(electric-pair-default-inhibit char))))))
|
||||||
|
|
||||||
;; 预加载,防止windows的org-mode加载卡顿
|
|
||||||
;; (if *is-windows*
|
|
||||||
;; (progn (run-with-idle-timer
|
|
||||||
;; 0.5 nil
|
|
||||||
;; (lambda ()
|
|
||||||
;; (with-temp-buffer
|
|
||||||
;; (org-mode)
|
|
||||||
;; (org-mode))
|
|
||||||
;; (message "Org preloaded")))))
|
|
||||||
|
|
||||||
;; 设置标题字体大小
|
|
||||||
;; (with-eval-after-load 'org
|
|
||||||
;; (dolist (face org-level-faces)
|
|
||||||
;; (set-face-attribute face nil :height 1)))
|
|
||||||
|
|
||||||
;; log默认放入drawer中
|
;; log默认放入drawer中
|
||||||
(setq org-log-done t)
|
(setq org-log-done t)
|
||||||
(setq org-log-into-drawer t)
|
(setq org-log-into-drawer t)
|
||||||
@@ -98,7 +83,8 @@
|
|||||||
:config
|
:config
|
||||||
(setq denote-journal-directory (expand-file-name "journal" denote-directory))
|
(setq denote-journal-directory (expand-file-name "journal" denote-directory))
|
||||||
(setq denote-journal-keyword nil)
|
(setq denote-journal-keyword nil)
|
||||||
(setq denote-journal-signature "journal"))
|
(setq denote-journal-signature "journal")
|
||||||
|
(setq denote-journal-keyword "daily"))
|
||||||
|
|
||||||
;; denote-explore
|
;; denote-explore
|
||||||
(use-package denote-explore)
|
(use-package denote-explore)
|
||||||
@@ -162,12 +148,12 @@
|
|||||||
((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
|
||||||
@@ -293,6 +279,33 @@ See `org-capture-templates' for more information."
|
|||||||
;; 自动打开浏览器
|
;; 自动打开浏览器
|
||||||
(browse-url "http://localhost:1313")))
|
(browse-url "http://localhost:1313")))
|
||||||
|
|
||||||
|
;; 农历日历
|
||||||
|
(use-package cal-china-x
|
||||||
|
:after calendar
|
||||||
|
:autoload cal-china-x-setup
|
||||||
|
:init
|
||||||
|
(cal-china-x-setup)
|
||||||
|
:config
|
||||||
|
(setq calendar-mark-holidays-flag t
|
||||||
|
cal-china-x-important-holidays cal-china-x-chinese-holidays
|
||||||
|
cal-china-x-general-holidays '((holiday-lunar 1 15 "元宵节")
|
||||||
|
(holiday-lunar 7 7 "七夕节")
|
||||||
|
(holiday-fixed 3 8 "妇女节")
|
||||||
|
(holiday-fixed 3 12 "植树节")
|
||||||
|
(holiday-fixed 5 4 "青年节")
|
||||||
|
(holiday-fixed 6 1 "儿童节")
|
||||||
|
(holiday-fixed 9 10 "教师节"))
|
||||||
|
holiday-other-holidays '((holiday-fixed 2 14 "情人节")
|
||||||
|
(holiday-fixed 4 1 "愚人节")
|
||||||
|
(holiday-fixed 12 25 "圣诞节")
|
||||||
|
(holiday-fixed 6 7 "高考")
|
||||||
|
(holiday-float 5 0 2 "母亲节")
|
||||||
|
(holiday-float 6 0 3 "父亲节")
|
||||||
|
(holiday-float 11 4 4 "感恩节"))
|
||||||
|
calendar-holidays (append cal-china-x-important-holidays
|
||||||
|
cal-china-x-general-holidays
|
||||||
|
holiday-other-holidays)))
|
||||||
|
|
||||||
(provide 'init-org)
|
(provide 'init-org)
|
||||||
|
|
||||||
;;; init-org.el ends here
|
;;; init-org.el ends here
|
||||||
|
|||||||
@@ -31,6 +31,13 @@
|
|||||||
;; drag-stuff,拖动字符
|
;; drag-stuff,拖动字符
|
||||||
(use-package drag-stuff)
|
(use-package drag-stuff)
|
||||||
|
|
||||||
|
;; mwim,更聪明的beginning/end of line
|
||||||
|
(use-package mwim
|
||||||
|
:bind (([remap move-beginning-of-line] . mwim-beginning)
|
||||||
|
([remap move-end-of-line] . mwim-end)
|
||||||
|
([remap org-beginning-of-line] . mwim-beginning)
|
||||||
|
([remap org-end-of-line] . mwim-end)))
|
||||||
|
|
||||||
;; which-key,快捷键提示
|
;; which-key,快捷键提示
|
||||||
(use-package which-key
|
(use-package which-key
|
||||||
:delight
|
:delight
|
||||||
@@ -183,22 +190,21 @@ targets."
|
|||||||
undo-outer-limit 12000000))
|
undo-outer-limit 12000000))
|
||||||
|
|
||||||
;; expand-region,快速展开选中
|
;; expand-region,快速展开选中
|
||||||
(use-package expand-region)
|
(use-package expand-region
|
||||||
|
:commands
|
||||||
;; projectile,项目管理
|
(er/mark-symbol er/mark-word)
|
||||||
(use-package projectile
|
|
||||||
:delight
|
|
||||||
:init
|
|
||||||
(projectile-mode)
|
|
||||||
(projectile-known-projects)
|
|
||||||
:bind
|
|
||||||
(:map projectile-mode-map
|
|
||||||
("C-x p" . projectile-command-map)
|
|
||||||
("C-x p b" . consult-project-buffer))
|
|
||||||
:config
|
:config
|
||||||
(setq projectile-enable-caching 'persistent)
|
(setq expand-region-smart-cursor t))
|
||||||
(setq projectile-auto-discover t)
|
|
||||||
(setq projectile-auto-cleanup-known-projects t))
|
;; project
|
||||||
|
(use-package project
|
||||||
|
:bind
|
||||||
|
([remap project-vc-dir] . magit-project-status)
|
||||||
|
:config
|
||||||
|
(setq project-switch-commands (assq-delete-all 'project-vc-dir project-switch-commands))
|
||||||
|
(add-to-list 'project-switch-commands '(magit-project-status "Magit" ?v))
|
||||||
|
(add-to-list 'project-switch-commands '(eat-project "Eat" ?E))
|
||||||
|
(add-to-list 'project-switch-commands '(consult-ripgrep-project "Ripgrep" ?r)))
|
||||||
|
|
||||||
;; ibuffer
|
;; ibuffer
|
||||||
(use-package ibuffer
|
(use-package ibuffer
|
||||||
@@ -336,7 +342,18 @@ targets."
|
|||||||
(if *is-android* (god-mode-all))
|
(if *is-android* (god-mode-all))
|
||||||
:config
|
:config
|
||||||
(unless *is-android* (which-key-enable-god-mode-support))
|
(unless *is-android* (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
|
||||||
|
(delete-dups (append '(diff-mode exwm-mode) god-exempt-major-modes))
|
||||||
|
god-mode-lighter-string "THANK-GOD-MODE")
|
||||||
|
|
||||||
|
(defun my-sync-god-mode-lighter-face (&rest _)
|
||||||
|
(set-face-attribute 'god-mode-lighter nil
|
||||||
|
:inherit 'isearch-fail
|
||||||
|
:background (face-attribute 'mode-line :background nil t)
|
||||||
|
:weight 'bold))
|
||||||
|
(my-sync-god-mode-lighter-face)
|
||||||
|
(add-hook 'enable-theme-functions #'my-sync-god-mode-lighter-face)
|
||||||
|
|
||||||
(defun my-sync-line-numbers-with-god-mode ()
|
(defun my-sync-line-numbers-with-god-mode ()
|
||||||
(let ((desired (if (bound-and-true-p god-local-mode)
|
(let ((desired (if (bound-and-true-p god-local-mode)
|
||||||
@@ -344,10 +361,10 @@ targets."
|
|||||||
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))
|
||||||
|
|
||||||
(setq god-exempt-major-modes
|
;; keycast,按键广播
|
||||||
(delete-dups (append '(diff-mode exwm-mode) god-exempt-major-modes))))
|
(use-package keycast)
|
||||||
|
|
||||||
;; perspective,工作区管理
|
;; perspective,工作区管理
|
||||||
(use-package perspective
|
(use-package perspective
|
||||||
@@ -368,7 +385,15 @@ targets."
|
|||||||
(setq persp-initial-frame-name "main"))
|
(setq persp-initial-frame-name "main"))
|
||||||
|
|
||||||
;; magit
|
;; magit
|
||||||
(use-package magit)
|
(use-package magit
|
||||||
|
:config
|
||||||
|
(setq magit-bind-magit-project-status nil))
|
||||||
|
|
||||||
|
;; ediff
|
||||||
|
(use-package ediff
|
||||||
|
:config
|
||||||
|
(setq ediff-window-setup-function 'ediff-setup-windows-plain)
|
||||||
|
(setq ediff-split-window-function 'split-window-horizontally))
|
||||||
|
|
||||||
(provide 'init-package)
|
(provide 'init-package)
|
||||||
|
|
||||||
|
|||||||
@@ -105,9 +105,12 @@
|
|||||||
|
|
||||||
(setq switch-to-buffer-obey-display-actions t)
|
(setq switch-to-buffer-obey-display-actions t)
|
||||||
|
|
||||||
;; 优化中文混排时的换行规则
|
;; 优化换行规则
|
||||||
(setq word-wrap-by-category t)
|
(setq word-wrap-by-category t)
|
||||||
|
|
||||||
|
;; kill-line删除换行符
|
||||||
|
(setq kill-whole-line t)
|
||||||
|
|
||||||
(provide 'init-startup)
|
(provide 'init-startup)
|
||||||
|
|
||||||
;;; init-startup.el ends here
|
;;; init-startup.el ends here
|
||||||
|
|||||||
@@ -77,6 +77,7 @@
|
|||||||
;; (use-package doom-themes)
|
;; (use-package doom-themes)
|
||||||
;; (use-package color-theme-modern)
|
;; (use-package color-theme-modern)
|
||||||
(use-package naysayer-theme)
|
(use-package naysayer-theme)
|
||||||
|
(use-package ef-themes)
|
||||||
|
|
||||||
(if *is-android*
|
(if *is-android*
|
||||||
(use-package simple-modeline
|
(use-package simple-modeline
|
||||||
@@ -95,8 +96,7 @@
|
|||||||
(add-to-list 'eshell-output-filter-functions 'eshell-handle-ansi-color t)
|
(add-to-list 'eshell-output-filter-functions 'eshell-handle-ansi-color t)
|
||||||
(setq-local eshell-prefer-lisp-functions nil)
|
(setq-local eshell-prefer-lisp-functions nil)
|
||||||
(setenv "LS_COLORS"
|
(setenv "LS_COLORS"
|
||||||
"di=34:ln=35:so=32:pi=33:ex=31:bd=34;46:cd=34;43:su=30;41:sg=30;46")
|
"di=34:ln=35:so=32:pi=33:ex=31:bd=34;46:cd=34;43:su=30;41:sg=30;46")))
|
||||||
(setenv "GIT_CONFIG_GLOBAL" (expand-file-name "~/.emacs.d/.gitconfig-eshell"))))
|
|
||||||
|
|
||||||
;; 缩进线
|
;; 缩进线
|
||||||
(use-package indent-bars
|
(use-package indent-bars
|
||||||
@@ -120,8 +120,14 @@
|
|||||||
(column-number-mode t)
|
(column-number-mode t)
|
||||||
|
|
||||||
;; 显示时间
|
;; 显示时间
|
||||||
(setq display-time-default-load-average nil)
|
(setq display-time-default-load-average nil
|
||||||
(display-time-mode t)
|
display-time-string-forms
|
||||||
|
'((propertize
|
||||||
|
(concat
|
||||||
|
(propertize (format-time-string " %H:%M") 'face 'display-time-date-and-time)
|
||||||
|
(propertize (format-time-string "-%p") 'face 'font-lock-comment-face))
|
||||||
|
'help-echo (format-time-string "%A, %B %d, %Y"))))
|
||||||
|
(display-time-mode)
|
||||||
|
|
||||||
;; 添加个人字体到 cnfonts
|
;; 添加个人字体到 cnfonts
|
||||||
(setq cnfonts-personal-fontnames
|
(setq cnfonts-personal-fontnames
|
||||||
|
|||||||
@@ -25,6 +25,7 @@
|
|||||||
"\\*Backtrace\\*"
|
"\\*Backtrace\\*"
|
||||||
"\\*prodigy\\*"
|
"\\*prodigy\\*"
|
||||||
"\\*Calendar\\*"
|
"\\*Calendar\\*"
|
||||||
|
"\\*Holidays\\*"
|
||||||
"\\*Embark Actions\\*"
|
"\\*Embark Actions\\*"
|
||||||
"\\*Finder\\*"
|
"\\*Finder\\*"
|
||||||
"\\*Kill Ring\\*"
|
"\\*Kill Ring\\*"
|
||||||
@@ -54,6 +55,7 @@
|
|||||||
ibuffer-mode
|
ibuffer-mode
|
||||||
|
|
||||||
"^\\*eshell.*\\*.*$" eshell-mode
|
"^\\*eshell.*\\*.*$" eshell-mode
|
||||||
|
".*eshell\\*$"
|
||||||
"^\\*shell.*\\*.*$" shell-mode
|
"^\\*shell.*\\*.*$" shell-mode
|
||||||
"^\\*terminal.*\\*.*$" term-mode
|
"^\\*terminal.*\\*.*$" term-mode
|
||||||
"^\\*vterm.*\\*.*$" vterm-mode
|
"^\\*vterm.*\\*.*$" vterm-mode
|
||||||
|
|||||||
@@ -29,11 +29,16 @@
|
|||||||
`(org-document-title ((,class (:foreground ,base0 :height 1.0 :weight bold))))
|
`(org-document-title ((,class (:foreground ,base0 :height 1.0 :weight bold))))
|
||||||
`(org-done ((,class (:foreground ,green :weight bold))))
|
`(org-done ((,class (:foreground ,green :weight bold))))
|
||||||
`(org-headline-done ((,class (:foreground ,green))))
|
`(org-headline-done ((,class (:foreground ,green))))
|
||||||
`(org-block-begin-line ((,class (:foreground ,base01 :underline t :slant italic :extend t))))
|
`(org-block-begin-line ((,class (:foreground ,base01 :slant italic))))
|
||||||
`(org-block-end-line ((,class (:foreground ,base01 :overline t :slant italic :extend t))))
|
`(org-block-end-line ((,class (:foreground ,base01 :slant italic))))
|
||||||
`(org-priority ((,class (:foreground ,green :weight bold))))
|
`(org-priority ((,class (:foreground ,green :weight bold))))
|
||||||
`(org-checkbox ((,class (:foreground ,base0 :weight bold))))
|
`(org-checkbox ((,class (:foreground ,base0 :weight bold))))
|
||||||
`(denote-journal-calendar ((,class (:foreground ,cyan :slant italic))))
|
`(denote-journal-calendar ((,class (:foreground ,cyan :slant italic))))
|
||||||
|
`(calendar-month-header ((,class (:foreground ,base0 :weight bold))))
|
||||||
|
`(holiday ((,class (:underline (:style line :color ,yellow)))))
|
||||||
|
`(cal-china-x-important-holiday-face ((,class (:underline (:style line :color ,red)))))
|
||||||
|
`(cal-china-x-general-holiday-face ((,class (:underline (:style line :color ,yellow)))))
|
||||||
|
`(holiday ((,class (:underline (:style line :color ,yellow)))))
|
||||||
`(font-lock-keyword-face ((,class (:foreground ,cyan :weight bold))))
|
`(font-lock-keyword-face ((,class (:foreground ,cyan :weight bold))))
|
||||||
`(font-lock-doc-face ((,class (:foreground ,green :slant normal))))
|
`(font-lock-doc-face ((,class (:foreground ,green :slant normal))))
|
||||||
`(font-lock-string-face ((,class (:foreground ,green))))
|
`(font-lock-string-face ((,class (:foreground ,green))))
|
||||||
@@ -62,7 +67,13 @@
|
|||||||
`(vundo-highlight ((,class (:foreground ,cyan :weight bold))))
|
`(vundo-highlight ((,class (:foreground ,cyan :weight bold))))
|
||||||
`(vundo-node ((,class (:foreground ,base01))))
|
`(vundo-node ((,class (:foreground ,base01))))
|
||||||
`(vundo-stem ((,class (:foreground ,base01))))
|
`(vundo-stem ((,class (:foreground ,base01))))
|
||||||
`(god-mode-lighter ((,class (:foreground ,red :weight bold)))))))
|
`(transient-key-stay ((,class (:foreground ,cyan :inherit transient-key))))
|
||||||
|
`(transient-key-return ((,class (:foreground ,violet :inherit transient-key))))
|
||||||
|
`(transient-key-exit ((,class (:foreground ,blue :inherit transient-key))))
|
||||||
|
`(transient-key-stack ((,class (:foreground ,magenta :inherit transient-key))))
|
||||||
|
`(transient-key-recurse ((,class (:foreground ,blue :inherit transient-key))))
|
||||||
|
`(transient-key-noop ((,class (:foreground ,base01 :inherit transient-key))))
|
||||||
|
`(keycast-key ((,class (:foreground ,green :weight bold)))))))
|
||||||
|
|
||||||
(provide-theme 'my-base16-dark)
|
(provide-theme 'my-base16-dark)
|
||||||
|
|
||||||
|
|||||||
@@ -29,11 +29,16 @@
|
|||||||
`(org-document-title ((,class (:foreground ,base0 :height 1.0 :weight bold))))
|
`(org-document-title ((,class (:foreground ,base0 :height 1.0 :weight bold))))
|
||||||
`(org-done ((,class (:foreground ,green :weight bold))))
|
`(org-done ((,class (:foreground ,green :weight bold))))
|
||||||
`(org-headline-done ((,class (:foreground ,green))))
|
`(org-headline-done ((,class (:foreground ,green))))
|
||||||
`(org-block-begin-line ((,class (:foreground ,base01 :underline t :slant italic :extend t))))
|
`(org-block-begin-line ((,class (:foreground ,base01 :slant italic))))
|
||||||
`(org-block-end-line ((,class (:foreground ,base01 :overline t :slant italic :extend t))))
|
`(org-block-end-line ((,class (:foreground ,base01 :slant italic))))
|
||||||
`(org-priority ((,class (:foreground ,green :weight bold))))
|
`(org-priority ((,class (:foreground ,green :weight bold))))
|
||||||
`(org-checkbox ((,class (:foreground ,base0 :weight bold))))
|
`(org-checkbox ((,class (:foreground ,base0 :weight bold))))
|
||||||
`(denote-journal-calendar ((,class (:foreground ,cyan :slant italic))))
|
`(denote-journal-calendar ((,class (:foreground ,cyan :slant italic))))
|
||||||
|
`(calendar-month-header ((,class (:foreground ,base0 :weight bold))))
|
||||||
|
`(holiday ((,class (:underline (:style line :color ,yellow)))))
|
||||||
|
`(cal-china-x-important-holiday-face ((,class (:underline (:style line :color ,red)))))
|
||||||
|
`(cal-china-x-general-holiday-face ((,class (:underline (:style line :color ,yellow)))))
|
||||||
|
`(holiday ((,class (:underline (:style line :color ,yellow)))))
|
||||||
`(font-lock-keyword-face ((,class (:foreground ,cyan :weight bold))))
|
`(font-lock-keyword-face ((,class (:foreground ,cyan :weight bold))))
|
||||||
`(font-lock-doc-face ((,class (:foreground ,green :slant normal))))
|
`(font-lock-doc-face ((,class (:foreground ,green :slant normal))))
|
||||||
`(font-lock-string-face ((,class (:foreground ,green))))
|
`(font-lock-string-face ((,class (:foreground ,green))))
|
||||||
@@ -62,7 +67,13 @@
|
|||||||
`(vundo-highlight ((,class (:foreground ,cyan :weight bold))))
|
`(vundo-highlight ((,class (:foreground ,cyan :weight bold))))
|
||||||
`(vundo-node ((,class (:foreground ,base01))))
|
`(vundo-node ((,class (:foreground ,base01))))
|
||||||
`(vundo-stem ((,class (:foreground ,base01))))
|
`(vundo-stem ((,class (:foreground ,base01))))
|
||||||
`(god-mode-lighter ((,class (:foreground ,red :weight bold)))))))
|
`(transient-key-stay ((,class (:foreground ,cyan :inherit transient-key))))
|
||||||
|
`(transient-key-return ((,class (:foreground ,violet :inherit transient-key))))
|
||||||
|
`(transient-key-exit ((,class (:foreground ,blue :inherit transient-key))))
|
||||||
|
`(transient-key-stack ((,class (:foreground ,magenta :inherit transient-key))))
|
||||||
|
`(transient-key-recurse ((,class (:foreground ,blue :inherit transient-key))))
|
||||||
|
`(transient-key-noop ((,class (:foreground ,base01 :inherit transient-key))))
|
||||||
|
`(keycast-key ((,class (:foreground ,green :weight bold)))))))
|
||||||
|
|
||||||
(provide-theme 'my-base16-light)
|
(provide-theme 'my-base16-light)
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
"#3A9C36")) ; green: 绿色
|
"#3A9C36")) ; green: 绿色
|
||||||
|
|
||||||
(defvar my-base16-light-core-palette
|
(defvar my-base16-light-core-palette
|
||||||
'("#062617" ; darkest-base: 最深背景
|
'("#062624" ; darkest-base: 最深背景
|
||||||
"#E3FFE6" ; brightest-base: 最亮前景
|
"#E3FFE6" ; brightest-base: 最亮前景
|
||||||
"#A87C04" ; yellow: 黄色
|
"#A87C04" ; yellow: 黄色
|
||||||
"#C24713" ; orange: 橙色
|
"#C24713" ; orange: 橙色
|
||||||
|
|||||||
Reference in New Issue
Block a user