From abe17b042ca23eb3fb4c759cc62214440691fb1f Mon Sep 17 00:00:00 2001 From: Marc Coquand Date: Thu, 24 Oct 2024 08:13:54 +0300 Subject: . --- home/dots/.emacs.d/elisp/custom-keymaps.el | 28 ++++++++++++++++++++++++++++ home/dots/.emacs.d/elisp/keymaps.el | 28 ---------------------------- 2 files changed, 28 insertions(+), 28 deletions(-) create mode 100644 home/dots/.emacs.d/elisp/custom-keymaps.el delete mode 100644 home/dots/.emacs.d/elisp/keymaps.el (limited to 'home/dots/.emacs.d/elisp') diff --git a/home/dots/.emacs.d/elisp/custom-keymaps.el b/home/dots/.emacs.d/elisp/custom-keymaps.el new file mode 100644 index 0000000..7c6d614 --- /dev/null +++ b/home/dots/.emacs.d/elisp/custom-keymaps.el @@ -0,0 +1,28 @@ +(defvar keymaps-mode-map (make-sparse-keymap) + "Keymap for `keymaps-mode'") + +;;;###autoload +(define-minor-mode keymaps-mode + "A minor mode so that my key settings override annoying major modes." + ;; If init-value is not set to t, this mode does not get enabled in + ;; `fundamental-mode' buffers even after doing \"(global-my-mode 1)\". + ;; More info: http://emacs.stackexchange.com/q/16693/115 + :init-value t + :lighter " keymaps" + :keymap keymaps-mode-map) + +;;;###autoload +(define-globalized-minor-mode global-keymaps-mode keymaps-mode keymaps-mode) + +;; https://github.com/jwiegley/use-package/blob/master/bind-key.el +;; The keymaps in `emulation-mode-map-alists' take precedence over +;; `minor-mode-map-alist' +(add-to-list 'emulation-mode-map-alists `((keymaps-mode . ,keymaps-mode-map))) + +;; Turn off the minor mode in the minibuffer +(defun turn-off-keymaps-mode () + "Turn off keymaps-mode." + (keymaps-mode -1)) +(add-hook 'minibuffer-setup-hook #'turn-off-keymaps-mode) + +(provide 'custom-keymaps) diff --git a/home/dots/.emacs.d/elisp/keymaps.el b/home/dots/.emacs.d/elisp/keymaps.el deleted file mode 100644 index 7c6d614..0000000 --- a/home/dots/.emacs.d/elisp/keymaps.el +++ /dev/null @@ -1,28 +0,0 @@ -(defvar keymaps-mode-map (make-sparse-keymap) - "Keymap for `keymaps-mode'") - -;;;###autoload -(define-minor-mode keymaps-mode - "A minor mode so that my key settings override annoying major modes." - ;; If init-value is not set to t, this mode does not get enabled in - ;; `fundamental-mode' buffers even after doing \"(global-my-mode 1)\". - ;; More info: http://emacs.stackexchange.com/q/16693/115 - :init-value t - :lighter " keymaps" - :keymap keymaps-mode-map) - -;;;###autoload -(define-globalized-minor-mode global-keymaps-mode keymaps-mode keymaps-mode) - -;; https://github.com/jwiegley/use-package/blob/master/bind-key.el -;; The keymaps in `emulation-mode-map-alists' take precedence over -;; `minor-mode-map-alist' -(add-to-list 'emulation-mode-map-alists `((keymaps-mode . ,keymaps-mode-map))) - -;; Turn off the minor mode in the minibuffer -(defun turn-off-keymaps-mode () - "Turn off keymaps-mode." - (keymaps-mode -1)) -(add-hook 'minibuffer-setup-hook #'turn-off-keymaps-mode) - -(provide 'custom-keymaps) -- cgit v1.2.3