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:
@@ -4,13 +4,6 @@
|
|||||||
|
|
||||||
;;; Code:
|
;;; 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
|
;; god-mode
|
||||||
(general-def god-local-mode-map
|
(general-def god-local-mode-map
|
||||||
"i" 'god-mode-all
|
"i" 'god-mode-all
|
||||||
@@ -401,35 +394,6 @@
|
|||||||
(lambda (buffer) (diff-buffer-with-file (buffer-file-name buffer)))
|
(lambda (buffer) (diff-buffer-with-file (buffer-file-name buffer)))
|
||||||
"show diff between the buffer and its file"))
|
"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)
|
(provide 'init-kbd)
|
||||||
|
|
||||||
;;; init-kbd.el ends here
|
;;; init-kbd.el ends here
|
||||||
|
|||||||
@@ -22,18 +22,35 @@
|
|||||||
|
|
||||||
;; hydra
|
;; hydra
|
||||||
(use-package hydra
|
(use-package hydra
|
||||||
:defines
|
:config
|
||||||
(consult-imenu-config)
|
;; multiple-cursors hydra
|
||||||
:init
|
(defhydra hydra-multiple-cursors ()
|
||||||
(with-eval-after-load 'consult-imenu
|
"
|
||||||
(setq consult-imenu-config
|
^Mark^ ^Unmark^ ^Other^
|
||||||
'((emacs-lisp-mode :toplevel "Functions"
|
------------------------------------------------------------------
|
||||||
:types ((?f "Functions" font-lock-function-name-face)
|
_p_ : prev line _P_ : previous _c_ : edit lines
|
||||||
(?h "Hydras" font-lock-constant-face)
|
_n_ : next line _N_ : next _._ : pop
|
||||||
(?m "Macros" font-lock-function-name-face)
|
_b_ : prev word _q_ : quit
|
||||||
(?p "Packages" font-lock-constant-face)
|
_f_ : next word _i_ : insert numbers
|
||||||
(?t "Types" font-lock-type-face)
|
_B_ : prev symbol
|
||||||
(?v "Variables" font-lock-variable-name-face)))))))
|
_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,拼写检查
|
;; jinx,拼写检查
|
||||||
(unless *is-windows*
|
(unless *is-windows*
|
||||||
|
|||||||
@@ -89,6 +89,13 @@
|
|||||||
;; 优化换行规则
|
;; 优化换行规则
|
||||||
(setq word-wrap-by-category t)
|
(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)
|
(provide 'init-startup)
|
||||||
|
|
||||||
;;; init-startup.el ends here
|
;;; init-startup.el ends here
|
||||||
|
|||||||
Reference in New Issue
Block a user