aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Rodrigues Lordello <[email protected]>2024-11-21 22:45:27 +0100
committerNicholas Rodrigues Lordello <[email protected]>2024-11-21 22:45:27 +0100
commit08ae423371b8abcf0a4b66bed4ba56d51a93a8bf (patch)
tree0235e89768b9f87f16164a9ebf79c7f34bbf5de0
parent51f825745589045d8b9df3549e60e4c9caa2171c (diff)
Setup Meow Modal Editing
So far so good...
-rw-r--r--config/emacs/init.el24
-rw-r--r--config/emacs/meow.el86
2 files changed, 101 insertions, 9 deletions
diff --git a/config/emacs/init.el b/config/emacs/init.el
index b628ae8..9b7bd47 100644
--- a/config/emacs/init.el
+++ b/config/emacs/init.el
@@ -1,24 +1,30 @@
(load "~/.config/emacs/sanemacs.el" nil t)
+(load "~/.config/emacs/meow.el" nil t)
;;(load "~/.config/emacs/gtd.el" nil t)
;;(load "~/.config/emacs/ligatures.el" nil t)
+(use-package magit
+ :ensure t)
+
+(use-package meow
+ :ensure t
+ :config
+ (meow-setup)
+ (meow-global-mode 1))
+
(use-package which-key
:ensure t
:config
(which-key-mode))
-(use-package magit
- :ensure t)
-
;;; TODO(nlordell):
-;;; 1. Try out `meow` modal editing mode
-;;; 2. Use built-in tree-sitter support (v29)
-;;; 3. Simplify GTD.el to match what I do in Journal.md
-;;; 4. Emacs over devcontainers/docker with TRAMP
+;;; 1. Use built-in tree-sitter support (v29)
+;;; 2. Simplify GTD.el to match what I do in Journal.md
+;;; 3. Emacs over devcontainers/docker with TRAMP
;;; <https://happihacking.com/blog/posts/2023/dev-containers-emacs/>
-;;; 5. Investigate other potential sane Emacs defaults
+;;; 4. Investigate other potential sane Emacs defaults
;;; <https://idiomdrottning.org/bad-emacs-defaults>
-;;; 6. Matering Emacs <https://www.masteringemacs.org/>
+;;; 5. Matering Emacs <https://www.masteringemacs.org/>
;;; Enable ligatures on macOS
(if (fboundp 'mac-auto-operator-composition-mode)
diff --git a/config/emacs/meow.el b/config/emacs/meow.el
new file mode 100644
index 0000000..1235ea2
--- /dev/null
+++ b/config/emacs/meow.el
@@ -0,0 +1,86 @@
+(defun meow-setup ()
+ "Default QWERTY Meow setup."
+ (setq meow-cheatsheet-layout meow-cheatsheet-layout-qwerty)
+ (meow-motion-overwrite-define-key
+ '("j" . meow-next)
+ '("k" . meow-prev)
+ '("<escape>" . ignore))
+ (meow-leader-define-key
+ ;; SPC j/k will run the original command in MOTION state.
+ '("j" . "H-j")
+ '("k" . "H-k")
+ ;; Use SPC (0-9) for digit arguments.
+ '("1" . meow-digit-argument)
+ '("2" . meow-digit-argument)
+ '("3" . meow-digit-argument)
+ '("4" . meow-digit-argument)
+ '("5" . meow-digit-argument)
+ '("6" . meow-digit-argument)
+ '("7" . meow-digit-argument)
+ '("8" . meow-digit-argument)
+ '("9" . meow-digit-argument)
+ '("0" . meow-digit-argument)
+ '("/" . meow-keypad-describe-key)
+ '("?" . meow-cheatsheet))
+ (meow-normal-define-key
+ '("0" . meow-expand-0)
+ '("9" . meow-expand-9)
+ '("8" . meow-expand-8)
+ '("7" . meow-expand-7)
+ '("6" . meow-expand-6)
+ '("5" . meow-expand-5)
+ '("4" . meow-expand-4)
+ '("3" . meow-expand-3)
+ '("2" . meow-expand-2)
+ '("1" . meow-expand-1)
+ '("-" . negative-argument)
+ '(";" . meow-reverse)
+ '("," . meow-inner-of-thing)
+ '("." . meow-bounds-of-thing)
+ '("[" . meow-beginning-of-thing)
+ '("]" . meow-end-of-thing)
+ '("a" . meow-append)
+ '("A" . meow-open-below)
+ '("b" . meow-back-word)
+ '("B" . meow-back-symbol)
+ '("c" . meow-change)
+ '("d" . meow-delete)
+ '("D" . meow-backward-delete)
+ '("e" . meow-next-word)
+ '("E" . meow-next-symbol)
+ '("f" . meow-find)
+ '("g" . meow-cancel-selection)
+ '("G" . meow-grab)
+ '("h" . meow-left)
+ '("H" . meow-left-expand)
+ '("i" . meow-insert)
+ '("I" . meow-open-above)
+ '("j" . meow-next)
+ '("J" . meow-next-expand)
+ '("k" . meow-prev)
+ '("K" . meow-prev-expand)
+ '("l" . meow-right)
+ '("L" . meow-right-expand)
+ '("m" . meow-join)
+ '("n" . meow-search)
+ '("o" . meow-block)
+ '("O" . meow-to-block)
+ '("p" . meow-yank)
+ '("q" . meow-quit)
+ '("Q" . meow-goto-line)
+ '("r" . meow-replace)
+ '("R" . meow-swap-grab)
+ '("s" . meow-kill)
+ '("t" . meow-till)
+ '("u" . meow-undo)
+ '("U" . meow-undo-in-selection)
+ '("v" . meow-visit)
+ '("w" . meow-mark-word)
+ '("W" . meow-mark-symbol)
+ '("x" . meow-line)
+ '("X" . meow-goto-line)
+ '("y" . meow-save)
+ '("Y" . meow-sync-grab)
+ '("z" . meow-pop-selection)
+ '("'" . repeat)
+ '("<escape>" . ignore)))