Nicolas Graves: 3 rde: Add feature emacs-meow rde: Add scilab feature rde: Add feature emacs-meow jgart: 1 rde: features: Add feature-emacs-meow 5 files changed, 1058 insertions(+), 0 deletions(-)
Copy & paste the following snippet into your terminal to import this patchset into git:
curl -s https://lists.sr.ht/~abcdw/rde-devel/patches/55598/mbox | git am -3Learn more about email & git
--- Here is finally feature-emacs-meow ;() WDYT all best, jgart https://whereis.xn--q9jyb4c/ src/rde/features/emacs-xyz.scm | 45 +++ .../features/emacs/meow-keyboard-layouts.scm | 268 ++++++++++++++++++ 2 files changed, 313 insertions(+) create mode 100644 src/rde/features/emacs/meow-keyboard-layouts.scm diff --git a/src/rde/features/emacs-xyz.scm b/src/rde/features/emacs-xyz.scm index 1229ae2c..83e78850 100644 --- a/src/rde/features/emacs-xyz.scm +++ b/src/rde/features/emacs-xyz.scm @@ -26,6 +26,7 @@ #:use-module (rde features) #:use-module (rde features predicates) #:use-module (rde features emacs) + #:use-module (rde features emacs meow-keyboard-layouts) #:use-module (rde features fontutils) #:use-module (gnu home services) @@ -99,6 +100,9 @@ feature-emacs-xref feature-emacs-treebundel + ;; Editing + feature-emacs-meow + ;; Reading feature-emacs-pdf-tools feature-emacs-nov-el @@ -3600,6 +3604,47 @@ and references in your programs." (values `((,f-name . #t))) (home-services-getter get-home-services))) +;;; +;;; Editing. +;;; + +(define* (feature-emacs-meow + #:key + (emacs-meow emacs-meow) + (meow-keyboard-layout %meow-qwerty-layout) + (additional-meow-el '()) + (additional-elisp-packages '())) + "Configure Meow for Emacs." + (ensure-pred file-like? emacs-meow) + (ensure-pred elisp-config? meow-keyboard-layout) + (ensure-pred list-of-elisp-packages? additional-elisp-packages) + + (define emacs-f-name 'meow) + (define f-name (symbol-append 'emacs- emacs-f-name)) + + (define (get-home-services config) + (list + (rde-elisp-configuration-service + emacs-f-name + config + `(,@meow-keyboard-layout + (require 'meow) + (meow-setup) + (meow-global-mode 1) + ,@additional-meow-el) + + #:elisp-packages (cons emacs-meow additional-elisp-packages) + #:authors '("jgart <jgart@dismail.de>") + #:summary "\ +Yet another modal editing on Emacs." + #:commentary "\ +Meow configuration with support for various layouts."))) + + (feature + (name f-name) + (values `((,f-name . ,emacs-meow))) + (home-services-getter get-home-services))) + ;;; ;;; Reading. diff --git a/src/rde/features/emacs/meow-keyboard-layouts.scm b/src/rde/features/emacs/meow-keyboard-layouts.scm new file mode 100644 index 00000000..bdf9bb4c --- /dev/null +++ b/src/rde/features/emacs/meow-keyboard-layouts.scm @@ -0,0 +1,268 @@ +(define-module (rde features emacs meow-keyboard-layouts) + #:export (%meow-programmer-dvorak-layout + %meow-dvorak-simplified-layout + %meow-qwerty-layout + %meow-colemak-layout + %meow-colemak-dh-layout)) + +(define %meow-programmer-dvorak-layout + `((defun meow-setup () + (setq meow-cheatsheet-layout meow-cheatsheet-layout-dvp) + (meow-leader-define-key + '("?" . meow-cheatsheet)) + (meow-motion-overwrite-define-key + ;; custom keybinding for motion state + '("<escape>" . ignore)) + (meow-normal-define-key + '("?" . meow-cheatsheet) + '("*" . meow-expand-0) + '("=" . meow-expand-9) + '("!" . meow-expand-8) + '("[" . meow-expand-7) + '("]" . meow-expand-6) + '("{" . meow-expand-5) + '("+" . meow-expand-4) + '("}" . meow-expand-3) + '(")" . meow-expand-2) + '("(" . meow-expand-1) + '("1" . digit-argument) + '("2" . digit-argument) + '("3" . digit-argument) + '("4" . digit-argument) + '("5" . digit-argument) + '("6" . digit-argument) + '("7" . digit-argument) + '("8" . digit-argument) + '("9" . digit-argument) + '("0" . digit-argument) + '("-" . 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-line) + '("E" . meow-goto-line) + '("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-join) + '("k" . meow-kill) + '("l" . meow-till) + '("m" . meow-mark-word) + '("M" . meow-mark-symbol) + '("n" . meow-next) + '("N" . meow-next-expand) + '("o" . meow-block) + '("O" . meow-to-block) + '("p" . meow-prev) + '("P" . meow-prev-expand) + '("q" . meow-quit) + '("r" . meow-replace) + '("R" . meow-swap-grab) + '("s" . meow-search) + '("t" . meow-right) + '("T" . meow-right-expand) + '("u" . meow-undo) + '("U" . meow-undo-in-selection) + '("v" . meow-visit) + '("w" . meow-next-word) + '("W" . meow-next-symbol) + '("x" . meow-save) + '("X" . meow-sync-grab) + '("y" . meow-yank) + '("z" . meow-pop-selection) + '("'" . repeat) + '("<escape>" . ignore))))) + +(define* (make-colemak-layout + #:key + (use-mod-dh? #f)) + `((defun meow-setup () + (setq meow-cheatsheet-layout + ,@(if use-mod-dh? + '((setq meow-cheatsheet-layout 'meow-cheatsheet-layout-colemak-dh)) + '((setq meow-cheatsheet-layout 'meow-cheatsheet-layout-colemak-dh)))) + (meow-motion-overwrite-define-key + ;; Use e to move up, n to move down. + ;; Since special modes usually use n to move down, we only overwrite e here. + '("e" . meow-prev) + '("<escape>" . ignore)) + (meow-leader-define-key + '("?" . meow-cheatsheet) + ;; To execute the originally e in MOTION state, use SPC e. + '("e" . "H-e") + '("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-normal-define-key + '("0" . meow-expand-0) + '("1" . meow-expand-1) + '("2" . meow-expand-2) + '("3" . meow-expand-3) + '("4" . meow-expand-4) + '("5" . meow-expand-5) + '("6" . meow-expand-6) + '("7" . meow-expand-7) + '("8" . meow-expand-8) + '("9" . meow-expand-9) + '("-" . negative-argument) + '(";" . meow-reverse) + '("," . meow-inner-of-thing) + '("." . meow-bounds-of-thing) + '("[" . meow-beginning-of-thing) + '("]" . meow-end-of-thing) + '("/" . meow-visit) + '("a" . meow-append) + '("A" . meow-open-below) + '("b" . meow-back-word) + '("B" . meow-back-symbol) + '("c" . meow-change) + '("d" . meow-delete) + '("e" . meow-prev) + '("E" . meow-prev-expand) + '("f" . meow-find) + '("g" . meow-cancel-selection) + '("G" . meow-grab) + '("h" . meow-left) + '("H" . meow-left-expand) + '("i" . meow-right) + '("I" . meow-right-expand) + '("j" . meow-join) + '("k" . meow-kill) + '("l" . meow-line) + '("L" . meow-goto-line) + '("m" . meow-mark-word) + '("M" . meow-mark-symbol) + '("n" . meow-next) + '("N" . meow-next-expand) + '("o" . meow-block) + '("O" . meow-to-block) + '("p" . meow-yank) + '("q" . meow-quit) + '("r" . meow-replace) + '("s" . meow-insert) + '("S" . meow-open-above) + '("t" . meow-till) + '("u" . meow-undo) + '("U" . meow-undo-in-selection) + '("v" . meow-search) + '("w" . meow-next-word) + '("W" . meow-next-symbol) + '("x" . meow-delete) + '("X" . meow-backward-delete) + '("y" . meow-save) + '("z" . meow-pop-selection) + '("'" . repeat) + '("<escape>" . ignore))))) + +(define %meow-colemak-layout (make-colemak-layout)) + +;; https://colemakmods.github.io/mod-dh/ +(define %meow-colemak-dh-layout + (make-colemak-layout #:use-mod-dh? #t)) + +(define %meow-qwerty-layout + `((defun 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) + '("t" . meow-till) + '("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) + '("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))))) -- 2.46.0
--- src/rde/features/emacs-meow.scm | 342 ++++++++++++++++++++++++++++++++ 1 file changed, 342 insertions(+) create mode 100644 src/rde/features/emacs-meow.scm diff --git a/src/rde/features/emacs-meow.scm b/src/rde/features/emacs-meow.scm new file mode 100644 index 00000000..14ae24cc --- /dev/null +++ b/src/rde/features/emacs-meow.scm @@ -0,0 +1,342 @@ +;;; rde --- Reproducible development environment. +;;; +;;; Copyright © 2024 jgart <jgart@dismail.de> +;;; +;;; This file is part of rde. +;;; +;;; rde is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; rde is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with rde. If not, see <http://www.gnu.org/licenses/>. + +(define-module (rde features emacs-meow) + #:use-module (rde features) + #:use-module (rde features emacs) + #:use-module (rde features predicates) + #:use-module (rde home services emacs) + #:use-module (rde serializers elisp) + #:use-module (gnu packages emacs-xyz) + #:export (meow-programmer-dvorak-layout + meow-dvorak-simplified-layout + meow-qwerty-layout + meow-colemak-layout + meow-colemak-dh-layout + + feature-emacs-meow)) + + +(define meow-programmer-dvorak-layout + `((defun meow-setup () + (setq meow-cheatsheet-layout meow-cheatsheet-layout-dvp) + (meow-leader-define-key + '("?" . meow-cheatsheet)) + (meow-motion-overwrite-define-key + ;; custom keybinding for motion state + '("<escape>" . ignore)) + (meow-normal-define-key + '("?" . meow-cheatsheet) + '("*" . meow-expand-0) + '("=" . meow-expand-9) + '("!" . meow-expand-8) + '("[" . meow-expand-7) + '("]" . meow-expand-6) + '("{" . meow-expand-5) + '("+" . meow-expand-4) + '("}" . meow-expand-3) + '(")" . meow-expand-2) + '("(" . meow-expand-1) + '("1" . digit-argument) + '("2" . digit-argument) + '("3" . digit-argument) + '("4" . digit-argument) + '("5" . digit-argument) + '("6" . digit-argument) + '("7" . digit-argument) + '("8" . digit-argument) + '("9" . digit-argument) + '("0" . digit-argument) + '("-" . 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-line) + '("E" . meow-goto-line) + '("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-join) + '("k" . meow-kill) + '("l" . meow-till) + '("m" . meow-mark-word) + '("M" . meow-mark-symbol) + '("n" . meow-next) + '("N" . meow-next-expand) + '("o" . meow-block) + '("O" . meow-to-block) + '("p" . meow-prev) + '("P" . meow-prev-expand) + '("q" . meow-quit) + '("r" . meow-replace) + '("R" . meow-swap-grab) + '("s" . meow-search) + '("t" . meow-right) + '("T" . meow-right-expand) + '("u" . meow-undo) + '("U" . meow-undo-in-selection) + '("v" . meow-visit) + '("w" . meow-next-word) + '("W" . meow-next-symbol) + '("x" . meow-save) + '("X" . meow-sync-grab) + '("y" . meow-yank) + '("z" . meow-pop-selection) + '("'" . repeat) + '("<escape>" . ignore))))) + + +(define* (make-colemak-layout + #:key + (use-mod-dh? #f)) + `((defun meow-setup () + (setq meow-cheatsheet-layout + ,@(if use-mod-dh? + '((setq meow-cheatsheet-layout 'meow-cheatsheet-layout-colemak-dh)) + '((setq meow-cheatsheet-layout 'meow-cheatsheet-layout-colemak-dh)))) + (meow-motion-overwrite-define-key + ;; Use e to move up, n to move down. + ;; Since special modes usually use n to move down, we only overwrite e here. + '("e" . meow-prev) + '("<escape>" . ignore)) + (meow-leader-define-key + '("?" . meow-cheatsheet) + ;; To execute the originally e in MOTION state, use SPC e. + '("e" . "H-e") + '("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-normal-define-key + '("0" . meow-expand-0) + '("1" . meow-expand-1) + '("2" . meow-expand-2) + '("3" . meow-expand-3) + '("4" . meow-expand-4) + '("5" . meow-expand-5) + '("6" . meow-expand-6) + '("7" . meow-expand-7) + '("8" . meow-expand-8) + '("9" . meow-expand-9) + '("-" . negative-argument) + '(";" . meow-reverse) + '("," . meow-inner-of-thing) + '("." . meow-bounds-of-thing) + '("[" . meow-beginning-of-thing) + '("]" . meow-end-of-thing) + '("/" . meow-visit) + '("a" . meow-append) + '("A" . meow-open-below) + '("b" . meow-back-word) + '("B" . meow-back-symbol) + '("c" . meow-change) + '("d" . meow-delete) + '("e" . meow-prev) + '("E" . meow-prev-expand) + '("f" . meow-find) + '("g" . meow-cancel-selection) + '("G" . meow-grab) + '("h" . meow-left) + '("H" . meow-left-expand) + '("i" . meow-right) + '("I" . meow-right-expand) + '("j" . meow-join) + '("k" . meow-kill) + '("l" . meow-line) + '("L" . meow-goto-line) + '("m" . meow-mark-word) + '("M" . meow-mark-symbol) + '("n" . meow-next) + '("N" . meow-next-expand) + '("o" . meow-block) + '("O" . meow-to-block) + '("p" . meow-yank) + '("q" . meow-quit) + '("r" . meow-replace) + '("s" . meow-insert) + '("S" . meow-open-above) + '("t" . meow-till) + '("u" . meow-undo) + '("U" . meow-undo-in-selection) + '("v" . meow-search) + '("w" . meow-next-word) + '("W" . meow-next-symbol) + '("x" . meow-delete) + '("X" . meow-backward-delete) + '("y" . meow-save) + '("z" . meow-pop-selection) + '("'" . repeat) + '("<escape>" . ignore))))) + +(define meow-colemak-layout (make-colemak-layout)) + +;; https://colemakmods.github.io/mod-dh/ +(define meow-colemak-dh-layout + (make-colemak-layout #:use-mod-dh? #t)) + + +(define meow-qwerty-layout + `((defun 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) + '("t" . meow-till) + '("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) + '("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))))) + + +(define* (feature-emacs-meow + #:key + (emacs-meow emacs-meow) + (meow-keyboard-layout meow-qwerty-layout) + (additional-meow-el '()) + (additional-elisp-packages '())) + "Configure Meow for Emacs." + (ensure-pred file-like? emacs-meow) + (ensure-pred elisp-config? meow-keyboard-layout) + (ensure-pred list-of-elisp-packages? additional-elisp-packages) + + (define emacs-f-name 'meow) + (define f-name (symbol-append 'emacs- emacs-f-name)) + + (define (get-home-services config) + (list + (rde-elisp-configuration-service + emacs-f-name + config + `((eval-when-compile (require 'meow-core)) + (autoload 'meow-global-mode "meow-core") + (with-eval-after-load 'meow-core + (require 'meow) + ,@meow-keyboard-layout + (meow-setup)) + (if after-init-time + (meow-global-mode 1) + (add-hook 'after-init-hook (lambda () + (meow-global-mode 1)))) + ,@additional-meow-el) + + #:elisp-packages (cons emacs-meow additional-elisp-packages) + #:authors '("jgart <jgart@dismail.de>") + #:summary "\ +Yet another modal editing on Emacs." + #:commentary "\ +Meow configuration with support for various layouts."))) + + (feature + (name f-name) + (values `((,f-name . ,emacs-meow))) + (home-services-getter get-home-services))) -- 2.47.1
--- src/rde/features/scilab.scm | 65 +++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 src/rde/features/scilab.scm diff --git a/src/rde/features/scilab.scm b/src/rde/features/scilab.scm new file mode 100644 index 00000000..0ae4b8aa --- /dev/null +++ b/src/rde/features/scilab.scm @@ -0,0 +1,65 @@ +;;; rde --- Reproducible development environment. +;;; +;;; Copyright © 2025 Nicolas Graves <ngraves@ngraves.fr> +;;; +;;; This file is a part of rde. +;;; +;;; rde is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; rde is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with rde. If not, see <http://www.gnu.org/licenses/>. + +(define-module (rde features scilab) + #:use-module (rde features) + #:use-module (rde features emacs) + #:use-module (rde features predicates) + + #:use-module (rde packages scilab) + #:use-module (gnu packages maths) + + #:use-module (gnu services) + #:use-module (gnu home services) + + #:use-module (guix gexp) + + #:export (feature-scilab)) + +(define* (feature-scilab + #:key + (scilab scilab) + (tree-sitter-scilab tree-sitter-scilab) + (emacs-scilab-ts-mode emacs-scilab-ts-mode)) + "Setup and configure environment for Scilab." + (ensure-pred file-like? scilab) + (ensure-pred file-like? tree-sitter-scilab) + (ensure-pred file-like? emacs-scilab-ts-mode) + + (define emacs-f-name 'scilab) + (define f-name (symbol-append 'emacs- emacs-f-name)) + + (define (get-home-services config) + (list + (simple-service + 'add-scilab-home-packages + home-profile-service-type + (list scilab tree-sitter-scilab)) + (when (get-value 'emacs config #f) + (rde-elisp-configuration-service + f-name + config + '((add-to-list 'auto-mode-alist '("\\.sce\\'" . scilab-ts-mode)) + (add-to-list 'auto-mode-alist '("\\.sci\\'" . scilab-ts-mode)) + (autoload 'scilab-ts-mode "scilab-ts-mode")) + #:elisp-packages (list emacs-scilab-ts-mode))))) + (feature + (name f-name) + (values `((scilab . ,scilab))) + (home-services-getter get-home-services))) -- 2.47.1
--- src/rde/features/emacs-meow.scm | 338 ++++++++++++++++++++++++++++++++ 1 file changed, 338 insertions(+) create mode 100644 src/rde/features/emacs-meow.scm diff --git a/src/rde/features/emacs-meow.scm b/src/rde/features/emacs-meow.scm new file mode 100644 index 00000000..34f04bd0 --- /dev/null +++ b/src/rde/features/emacs-meow.scm @@ -0,0 +1,338 @@ +;;; rde --- Reproducible development environment. +;;; +;;; Copyright © 2024 jgart <jgart@dismail.de> +;;; +;;; This file is part of rde. +;;; +;;; rde is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; rde is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with rde. If not, see <http://www.gnu.org/licenses/>. + +(define-module (rde features emacs-meow) + #:use-module (rde features) + #:use-module (rde features emacs) + #:use-module (rde features predicates) + #:use-module (rde home services emacs) + #:use-module (rde serializers elisp) + #:use-module (gnu packages emacs-xyz) + #:export (meow-programmer-dvorak-layout + meow-dvorak-simplified-layout + meow-qwerty-layout + meow-colemak-layout + meow-colemak-dh-layout + + feature-emacs-meow)) + + +(define meow-programmer-dvorak-layout + `((defun meow-setup () + (setq meow-cheatsheet-layout meow-cheatsheet-layout-dvp) + (meow-leader-define-key + '("?" . meow-cheatsheet)) + (meow-motion-overwrite-define-key + ;; custom keybinding for motion state + '("<escape>" . ignore)) + (meow-normal-define-key + '("?" . meow-cheatsheet) + '("*" . meow-expand-0) + '("=" . meow-expand-9) + '("!" . meow-expand-8) + '("[" . meow-expand-7) + '("]" . meow-expand-6) + '("{" . meow-expand-5) + '("+" . meow-expand-4) + '("}" . meow-expand-3) + '(")" . meow-expand-2) + '("(" . meow-expand-1) + '("1" . digit-argument) + '("2" . digit-argument) + '("3" . digit-argument) + '("4" . digit-argument) + '("5" . digit-argument) + '("6" . digit-argument) + '("7" . digit-argument) + '("8" . digit-argument) + '("9" . digit-argument) + '("0" . digit-argument) + '("-" . 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-line) + '("E" . meow-goto-line) + '("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-join) + '("k" . meow-kill) + '("l" . meow-till) + '("m" . meow-mark-word) + '("M" . meow-mark-symbol) + '("n" . meow-next) + '("N" . meow-next-expand) + '("o" . meow-block) + '("O" . meow-to-block) + '("p" . meow-prev) + '("P" . meow-prev-expand) + '("q" . meow-quit) + '("r" . meow-replace) + '("R" . meow-swap-grab) + '("s" . meow-search) + '("t" . meow-right) + '("T" . meow-right-expand) + '("u" . meow-undo) + '("U" . meow-undo-in-selection) + '("v" . meow-visit) + '("w" . meow-next-word) + '("W" . meow-next-symbol) + '("x" . meow-save) + '("X" . meow-sync-grab) + '("y" . meow-yank) + '("z" . meow-pop-selection) + '("'" . repeat) + '("<escape>" . ignore))))) + + +(define* (make-colemak-layout + #:key + (use-mod-dh? #f)) + `((defun meow-setup () + (setq meow-cheatsheet-layout + ,@(if use-mod-dh? + '((setq meow-cheatsheet-layout 'meow-cheatsheet-layout-colemak-dh)) + '((setq meow-cheatsheet-layout 'meow-cheatsheet-layout-colemak-dh)))) + (meow-motion-overwrite-define-key + ;; Use e to move up, n to move down. + ;; Since special modes usually use n to move down, we only overwrite e here. + '("e" . meow-prev) + '("<escape>" . ignore)) + (meow-leader-define-key + '("?" . meow-cheatsheet) + ;; To execute the originally e in MOTION state, use SPC e. + '("e" . "H-e") + '("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-normal-define-key + '("0" . meow-expand-0) + '("1" . meow-expand-1) + '("2" . meow-expand-2) + '("3" . meow-expand-3) + '("4" . meow-expand-4) + '("5" . meow-expand-5) + '("6" . meow-expand-6) + '("7" . meow-expand-7) + '("8" . meow-expand-8) + '("9" . meow-expand-9) + '("-" . negative-argument) + '(";" . meow-reverse) + '("," . meow-inner-of-thing) + '("." . meow-bounds-of-thing) + '("[" . meow-beginning-of-thing) + '("]" . meow-end-of-thing) + '("/" . meow-visit) + '("a" . meow-append) + '("A" . meow-open-below) + '("b" . meow-back-word) + '("B" . meow-back-symbol) + '("c" . meow-change) + '("d" . meow-delete) + '("e" . meow-prev) + '("E" . meow-prev-expand) + '("f" . meow-find) + '("g" . meow-cancel-selection) + '("G" . meow-grab) + '("h" . meow-left) + '("H" . meow-left-expand) + '("i" . meow-right) + '("I" . meow-right-expand) + '("j" . meow-join) + '("k" . meow-kill) + '("l" . meow-line) + '("L" . meow-goto-line) + '("m" . meow-mark-word) + '("M" . meow-mark-symbol) + '("n" . meow-next) + '("N" . meow-next-expand) + '("o" . meow-block) + '("O" . meow-to-block) + '("p" . meow-yank) + '("q" . meow-quit) + '("r" . meow-replace) + '("s" . meow-insert) + '("S" . meow-open-above) + '("t" . meow-till) + '("u" . meow-undo) + '("U" . meow-undo-in-selection) + '("v" . meow-search) + '("w" . meow-next-word) + '("W" . meow-next-symbol) + '("x" . meow-delete) + '("X" . meow-backward-delete) + '("y" . meow-save) + '("z" . meow-pop-selection) + '("'" . repeat) + '("<escape>" . ignore))))) + +(define meow-colemak-layout (make-colemak-layout)) + +;; https://colemakmods.github.io/mod-dh/ +(define meow-colemak-dh-layout + (make-colemak-layout #:use-mod-dh? #t)) + + +(define meow-qwerty-layout + `((defun 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) + '("t" . meow-till) + '("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) + '("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))))) + + +(define* (feature-emacs-meow + #:key + (emacs-meow emacs-meow) + (meow-keyboard-layout meow-qwerty-layout)) + "Configure Meow for Emacs." + (ensure-pred file-like? emacs-meow) + (ensure-pred elisp-config? meow-keyboard-layout) + + (define emacs-f-name 'meow) + (define f-name (symbol-append 'emacs- emacs-f-name)) + + (define (get-home-services config) + (list + (rde-elisp-configuration-service + emacs-f-name + config + `((eval-when-compile (require 'meow-core)) + (autoload 'meow-global-mode "meow-core") + (with-eval-after-load 'meow-core + (require 'meow) + ,@meow-keyboard-layout + (meow-setup)) + (if after-init-time + (meow-global-mode 1) + (add-hook 'after-init-hook (lambda () + (meow-global-mode 1))))) + + #:elisp-packages (list emacs-meow) + #:authors '("jgart <jgart@dismail.de>") + #:summary "\ +Yet another modal editing on Emacs." + #:commentary "\ +Meow configuration with support for various layouts."))) + + (feature + (name f-name) + (values `((,f-name . ,emacs-meow))) + (home-services-getter get-home-services))) -- 2.47.1