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:
@@ -31,6 +31,13 @@
|
||||
;; 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,快捷键提示
|
||||
(use-package which-key
|
||||
:delight
|
||||
@@ -183,22 +190,21 @@ targets."
|
||||
undo-outer-limit 12000000))
|
||||
|
||||
;; expand-region,快速展开选中
|
||||
(use-package expand-region)
|
||||
|
||||
;; projectile,项目管理
|
||||
(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))
|
||||
(use-package expand-region
|
||||
:commands
|
||||
(er/mark-symbol er/mark-word)
|
||||
:config
|
||||
(setq projectile-enable-caching 'persistent)
|
||||
(setq projectile-auto-discover t)
|
||||
(setq projectile-auto-cleanup-known-projects t))
|
||||
(setq expand-region-smart-cursor 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
|
||||
(use-package ibuffer
|
||||
@@ -336,7 +342,18 @@ targets."
|
||||
(if *is-android* (god-mode-all))
|
||||
:config
|
||||
(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 ()
|
||||
(let ((desired (if (bound-and-true-p god-local-mode)
|
||||
@@ -344,10 +361,10 @@ targets."
|
||||
t)))
|
||||
(unless (or (eq display-line-numbers desired) (bound-and-true-p olivetti-mode))
|
||||
(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
|
||||
(delete-dups (append '(diff-mode exwm-mode) god-exempt-major-modes))))
|
||||
;; keycast,按键广播
|
||||
(use-package keycast)
|
||||
|
||||
;; perspective,工作区管理
|
||||
(use-package perspective
|
||||
@@ -368,7 +385,15 @@ targets."
|
||||
(setq persp-initial-frame-name "main"))
|
||||
|
||||
;; 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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user