refactor(default): move +*-bindings.el loaders into config.el

No need for the extra indirection.
This commit is contained in:
Henrik Lissner 2024-09-01 23:25:51 -04:00
parent 70fd17ebfd
commit 86ee153786
No known key found for this signature in database
GPG key ID: B60957CA074D39A3
3 changed files with 31 additions and 50 deletions

View file

@ -1,26 +0,0 @@
;;; config/default/+emacs.el -*- lexical-binding: t; -*-
(require 'projectile) ; we need its keybinds immediately
;;
;;; Reasonable defaults
(setq shift-select-mode t)
(delete-selection-mode +1)
(use-package! expand-region
:commands (er/contract-region er/mark-symbol er/mark-word)
:config
(defadvice! doom--quit-expand-region-a (&rest _)
"Properly abort an expand-region region."
:before '(evil-escape doom/escape)
(when (memq last-command '(er/expand-region er/contract-region))
(er/contract-region 0))))
;;
;;; Keybinds
(when (modulep! +bindings)
(load! "+emacs-bindings"))

View file

@ -1,21 +0,0 @@
;;; config/default/+evil.el -*- lexical-binding: t; -*-
(defun +default-disable-delete-selection-mode-h ()
(delete-selection-mode -1))
(add-hook 'evil-insert-state-entry-hook #'delete-selection-mode)
(add-hook 'evil-insert-state-exit-hook #'+default-disable-delete-selection-mode-h)
;;
;;; Keybindings
;; This section is dedicated to "fixing" certain keys so that they behave
;; sensibly (and consistently with similar contexts).
;; Make SPC u SPC u [...] possible (#747)
(map! :map universal-argument-map
:prefix doom-leader-key "u" #'universal-argument-more
:prefix doom-leader-alt-key "u" #'universal-argument-more)
(when (modulep! +bindings)
(load! "+evil-bindings"))

View file

@ -565,6 +565,34 @@ Continues comments if executed from a commented line."
;;
;;; Bootstrap configs
(if (featurep 'evil)
(load! "+evil")
(load! "+emacs"))
(cond
((modulep! :editor evil)
(defun +default-disable-delete-selection-mode-h ()
(delete-selection-mode -1))
(add-hook 'evil-insert-state-entry-hook #'delete-selection-mode)
(add-hook 'evil-insert-state-exit-hook #'+default-disable-delete-selection-mode-h)
;; Make SPC u SPC u [...] possible (#747)
(map! :map universal-argument-map
:prefix doom-leader-key "u" #'universal-argument-more
:prefix doom-leader-alt-key "u" #'universal-argument-more)
(when (modulep! +bindings)
(load! "+evil-bindings")))
(t
(add-hook 'doom-first-buffer-hook #'delete-selection-mode)
(setq shift-select-mode t)
(use-package! expand-region
:commands (er/contract-region er/mark-symbol er/mark-word)
:config
(defadvice! doom--quit-expand-region-a (&rest _)
"Properly abort an expand-region region."
:before '(evil-escape doom/escape)
(when (memq last-command '(er/expand-region er/contract-region))
(er/contract-region 0))))
(when (modulep! +bindings)
(require 'projectile nil t) ; we need its keybinds immediately
(load! "+emacs-bindings"))))