summaryrefslogtreecommitdiff
path: root/home/dots/.emacs.d/elisp
diff options
context:
space:
mode:
authorMarc Coquand <marc@mccd.space>2024-10-22 12:21:31 +0300
committerMarc Coquand <marc@mccd.space>2024-10-22 12:21:31 +0300
commitba51d8509f78361f3049900861f492e100116a8c (patch)
tree1e408ed789ecd8f3761ab9b4aa88b42e1af507f1 /home/dots/.emacs.d/elisp
parent9fa6862f443b66c01895c3199502e4f628e4f69b (diff)
downloadguix-ba51d8509f78361f3049900861f492e100116a8c.tar.gz
guix-ba51d8509f78361f3049900861f492e100116a8c.tar.bz2
guix-ba51d8509f78361f3049900861f492e100116a8c.zip
.
Diffstat (limited to 'home/dots/.emacs.d/elisp')
-rw-r--r--home/dots/.emacs.d/elisp/keymaps.el28
1 files changed, 28 insertions, 0 deletions
diff --git a/home/dots/.emacs.d/elisp/keymaps.el b/home/dots/.emacs.d/elisp/keymaps.el
new file mode 100644
index 0000000..7c6d614
--- /dev/null
+++ b/home/dots/.emacs.d/elisp/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)