refactor: Reorganize configuration locations

- Move mac key bindings from init-kbd.el to init-startup.el
- Move multiple-cursors hydra from init-kbd.el to init-package.el
- Remove unused consult-imenu hydra config from init-package.el
This commit is contained in:
2026-06-27 08:59:11 +08:00
parent be2a3ba607
commit 33ced00fc4
3 changed files with 36 additions and 48 deletions

View File

@@ -4,13 +4,6 @@
;;; Code:
;; 修改mac键位
(when *is-mac*
(setq mac-command-modifier 'meta)
(setq mac-option-modifier 'super)
(setq mac-pass-control-to-system nil)
(setq mac-pass-command-to-system nil))
;; god-mode
(general-def god-local-mode-map
"i" 'god-mode-all
@@ -401,35 +394,6 @@
(lambda (buffer) (diff-buffer-with-file (buffer-file-name buffer)))
"show diff between the buffer and its file"))
;; multiple-cursors hydra
(defhydra hydra-multiple-cursors ()
"
^Mark^ ^Unmark^ ^Other^
------------------------------------------------------------------
_p_ : prev line _P_ : previous _c_ : edit lines
_n_ : next line _N_ : next _._ : pop
_b_ : prev word _q_ : quit
_f_ : next word _i_ : insert numbers
_B_ : prev symbol
_F_ : next symbol
_s_ : in region
_a_ : all dwim
"
("p" mc/mark-previous-like-this)
("n" mc/mark-next-like-this)
("b" mc/mark-previous-like-this-word)
("f" mc/mark-next-like-this-word)
("B" mc/mark-previous-like-this-symbol)
("F" mc/mark-next-like-this-symbol)
("P" mc/unmark-previous-like-this)
("N" mc/unmark-next-like-this)
("a" mc/mark-all-dwim)
("s" mc/mark-all-in-region)
("c" mc/edit-lines)
("i" mc/insert-numbers)
("." mc/mark-pop)
("q" nil))
(provide 'init-kbd)
;;; init-kbd.el ends here

View File

@@ -22,18 +22,35 @@
;; hydra
(use-package hydra
:defines
(consult-imenu-config)
:init
(with-eval-after-load 'consult-imenu
(setq consult-imenu-config
'((emacs-lisp-mode :toplevel "Functions"
:types ((?f "Functions" font-lock-function-name-face)
(?h "Hydras" font-lock-constant-face)
(?m "Macros" font-lock-function-name-face)
(?p "Packages" font-lock-constant-face)
(?t "Types" font-lock-type-face)
(?v "Variables" font-lock-variable-name-face)))))))
:config
;; multiple-cursors hydra
(defhydra hydra-multiple-cursors ()
"
^Mark^ ^Unmark^ ^Other^
------------------------------------------------------------------
_p_ : prev line _P_ : previous _c_ : edit lines
_n_ : next line _N_ : next _._ : pop
_b_ : prev word _q_ : quit
_f_ : next word _i_ : insert numbers
_B_ : prev symbol
_F_ : next symbol
_s_ : in region
_a_ : all dwim
"
("p" mc/mark-previous-like-this)
("n" mc/mark-next-like-this)
("b" mc/mark-previous-like-this-word)
("f" mc/mark-next-like-this-word)
("B" mc/mark-previous-like-this-symbol)
("F" mc/mark-next-like-this-symbol)
("P" mc/unmark-previous-like-this)
("N" mc/unmark-next-like-this)
("a" mc/mark-all-dwim)
("s" mc/mark-all-in-region)
("c" mc/edit-lines)
("i" mc/insert-numbers)
("." mc/mark-pop)
("q" nil)))
;; jinx拼写检查
(unless *is-windows*

View File

@@ -89,6 +89,13 @@
;; 优化换行规则
(setq word-wrap-by-category t)
;; 修改mac键位
(when *is-mac*
(setq mac-command-modifier 'meta)
(setq mac-option-modifier 'super)
(setq mac-pass-control-to-system nil)
(setq mac-pass-command-to-system nil))
(provide 'init-startup)
;;; init-startup.el ends here