From a8099235be613dbec3f16c036c8c9921eac53ba4 Mon Sep 17 00:00:00 2001
From: "keymap-editor[bot]"
 <91849743+keymap-editor[bot]@users.noreply.github.com>
Date: Wed, 18 Oct 2023 09:54:52 +0000
Subject: [PATCH] Trial 1

---
 config/sofle.keymap | 178 +++++++++++++++++++++++++-------------------
 1 file changed, 103 insertions(+), 75 deletions(-)

diff --git a/config/sofle.keymap b/config/sofle.keymap
index 569b1d3..aaf0804 100644
--- a/config/sofle.keymap
+++ b/config/sofle.keymap
@@ -21,20 +21,37 @@
     conditional_layers {
         compatible = "zmk,conditional-layers";
 
-        adjust_layer {
-            if-layers = <2 4>;
-            then-layer = <5>;
+        both-mod {
+            if-layers = <1 3>;
+            then-layer = <3>;
         };
     };
 
     behaviors {
-        htog: htog {
-            compatible = "zmk,behavior-hold-tap";
-            label = "HTOG";
-            bindings = <&mo>, <&tog>;
+        macro_mirror: macro_mirror {
+            compatible = "zmk,behavior-tap-dance";
+            label = "MACRO_MIRROR";
+            #binding-cells = <0>;
+            bindings = <&sl 5>, <&tog 8>;
+        };
+    };
 
-            #binding-cells = <2>;
-            tapping-term-ms = <300>;
+    combos {
+        compatible = "zmk,combos";
+
+        macro {
+            bindings = <&macro_mirror>;
+            key-positions = <50 51 52>;
+        };
+
+        qwerty {
+            bindings = <&tog 6>;
+            key-positions = <57 58 59>;
+        };
+
+        left-space {
+            bindings = <&kp SPACE>;
+            key-positions = <39 40>;
         };
     };
 
@@ -52,32 +69,20 @@
             //               | GUI | ALT  | CTRL | LOWER|  ENTER |  | SPACE | RAISE| CTRL  | ALT   | GUI  |
 
             bindings = <
-&kp GRAVE  &kp N1  &kp N2     &kp N3        &kp N4    &kp N5                            &kp N6  &kp N7    &kp N8         &kp N9     &kp N0    &none
-&kp ESC    &kp Q   &kp W      &kp F         &kp P     &kp G                             &kp J   &kp L     &kp U          &kp Y      &kp SEMI  &none
-&kp BSPC   &kp A   &kp R      &kp S         &kp T     &kp D                             &kp H   &kp N     &kp E          &kp I      &kp O     &kp DEL
-&kp LSHFT  &kp Z   &kp X      &kp C         &kp V     &kp B      &trans     &kp K_MUTE  &kp K   &kp M     &kp COMMA      &kp DOT    &kp FSLH  &kp RSHFT
-                   &kp LCTRL  &kp LEFT_WIN  &kp LALT  &htog 1 2  &kp RET    &kp SPACE   &mo 4   &kp RALT  &kp RIGHT_WIN  &kp RCTRL
+&kp GRAVE  &kp N1  &kp N2     &kp N3        &kp N4    &kp N5                        &kp N6  &kp N7    &kp N8         &kp N9             &kp N0    &none
+&kp ESC    &kp Q   &kp W      &kp F         &kp P     &kp G                         &kp J   &kp L     &kp U          &kp Y              &kp SEMI  &none
+&kp BSPC   &kp A   &kp R      &kp S         &kp T     &kp D                         &kp H   &kp N     &kp E          &kp I              &kp O     &kp DEL
+&kp LSHFT  &kp Z   &kp X      &kp C         &kp V     &kp B   &tog 4     &tog 4     &kp K   &kp M     &kp COMMA      &kp DOT            &kp FSLH  &kp RSHFT
+                   &kp LCTRL  &kp LEFT_WIN  &kp LALT  &mo 1   &kp RET    &kp SPACE  &mo 2   &kp RALT  &kp RIGHT_WIN  &kp RIGHT_CONTROL
             >;
 
             sensor-bindings =
-                <&inc_dec_kp C_AC_SCROLL_UP C_AC_SCROLL_DOWN>,
-                <&inc_dec_kp C_VOLUME_UP C_VOL_DN>;
+                <&inc_dec_kp UP_ARROW DOWN_ARROW>,
+                <&inc_dec_kp K_SCROLL_UP K_SCROLL_DOWN>;
         };
 
-        mirror {
-            bindings = <
-&trans   &kp N0    &kp N9   &kp N8     &kp N7  &kp N6                    &trans  &trans  &trans  &trans  &trans  &trans
-&trans   &kp SEMI  &kp Y    &kp U      &kp L   &kp J                     &trans  &trans  &trans  &trans  &trans  &trans
-&kp DEL  &kp O     &kp I    &kp E      &kp N   &kp H                     &trans  &trans  &trans  &trans  &trans  &trans
-&trans   &kp FSLH  &kp DOT  &kp COMMA  &kp M   &kp K   &trans    &trans  &trans  &trans  &trans  &trans  &trans  &trans
-                   &trans   &trans     &trans  &trans  &trans    &trans  &trans  &trans  &trans  &trans
-            >;
-
-            label = "mirror";
-        };
-
-        left-keypad {
-            label = "left-keypad";
+        left-mod {
+            label = "left-mod";
 
             // TODO: Some binds are waiting for shifted keycode support.
             // ------------------------------------------------------------------------------------------------------------
@@ -88,49 +93,24 @@
             //               |     |      |      |      |        |  |       |      |       |       |      |
 
             bindings = <
-&kp F1        &kp F2           &kp F3     &kp F4           &kp F5     &kp F6                             &kp F7  &kp F8     &kp F9    &kp F10               &kp F11                &kp F12
-&kp GRAVE     &kp KP_DIVIDE    &kp KP_N7  &kp KP_N8        &kp KP_N9  &kp KP_MULTIPLY                    &none   &none      &none     &kp LEFT_PARENTHESIS  &kp RIGHT_PARENTHESIS  &none
-&kp DELETE    &kp KP_SUBTRACT  &kp KP_N4  &kp KP_N5        &kp KP_N6  &kp KP_PLUS                        &none   &none      &none     &kp LEFT_BRACKET      &kp RIGHT_BRACKET      &kp BACKSPACE
-&lt 6 LSHIFT  &kp KP_N0        &kp KP_N1  &kp KP_NUMBER_2  &kp KP_N3  &kp KP_DOT       &tog 3    &none   &none   &kp PG_DN  &kp UP    &kp PG_UP             &kp BSLH               &none
-                               &none      &none            &none      &tog 2           &trans    &trans  &none   &kp LEFT   &kp DOWN  &kp RIGHT
+&trans      &trans           &trans     &trans           &trans     &trans                             &kp F1     &kp F2    &kp F3    &kp F4     &kp F5   &kp F6
+&trans      &kp KP_DIVIDE    &kp KP_N7  &kp KP_N8        &kp KP_N9  &kp KP_MULTIPLY                    &kp F7     &kp F8    &kp F9    &kp F10    &kp F11  &kp F12
+&kp DELETE  &kp KP_SUBTRACT  &kp KP_N4  &kp KP_N5        &kp KP_N6  &kp KP_PLUS                        &kp PG_UP  &kp HOME  &kp UP    &kp END    &trans   &kp BACKSPACE
+&trans      &kp KP_N0        &kp KP_N1  &kp KP_NUMBER_2  &kp KP_N3  &kp KP_DOT       &trans    &trans  &kp PG_DN  &kp LEFT  &kp DOWN  &kp RIGHT  &trans   &trans
+                             &trans     &trans           &trans     &tog 1           &trans    &trans  &trans     &trans    &trans    &trans
             >;
-
-            sensor-bindings =
-                <&inc_dec_kp RIGHT LEFT>,
-                <&inc_dec_kp PG_UP PG_DN>;
-        };
-
-        alt-encoder-nav {
-            bindings = <
-&trans  &trans  &trans  &trans  &trans  &trans                    &trans  &trans  &trans  &trans  &trans  &trans
-&trans  &trans  &trans  &trans  &trans  &trans                    &trans  &trans  &trans  &trans  &trans  &trans
-&trans  &trans  &trans  &trans  &trans  &trans                    &trans  &trans  &trans  &trans  &trans  &trans
-&trans  &trans  &trans  &trans  &trans  &trans  &trans    &trans  &trans  &trans  &trans  &trans  &trans  &trans
-                &trans  &trans  &trans  &trans  &trans    &trans  &trans  &trans  &trans  &trans
-            >;
-
-            sensor-bindings = <&inc_dec_kp UP_ARROW DOWN>;
         };
 
         right-mod {
-            label = "right-mod";
-
-            // ------------------------------------------------------------------------------------------------------------
-            // | BTCLR | BT1  | BT2  |  BT3  |  BT4  |  BT5 |                |      |      |       |      |       |       |
-            // |       | INS  | PSCR | GUI   |       |      |                | PGUP |      |   ^   |      |       |       |
-            // |       | ALT  | CTRL | SHIFT |       | CAPS |                | PGDN |   <- |   v   |  ->  |  DEL  | BKSPC |
-            // |       | UNDO | CUT  | COPY  | PASTE |      |      |  |      |      |      |       |      |       |       |
-            //                |      |       |       |      |      |  |      |      |      |       |      |
-
             bindings = <
-&bt BT_CLR  &bt BT_SEL 0  &bt BT_SEL 1  &bt BT_SEL 2  &bt BT_SEL 3  &bt BT_SEL 4                  &none  &none  &none  &none  &none  &none
-&none       &kp INS       &kp PSCRN     &kp K_CMENU   &none         &none                         &none  &none  &none  &none  &none  &none
-&kp DELETE  &kp LALT      &kp LCTRL     &kp LSHFT     &none         &kp CLCK                      &none  &none  &none  &none  &none  &kp BSPC
-&none       &kp K_UNDO    &kp K_CUT     &kp K_COPY    &kp K_PASTE   &none         &none    &none  &none  &none  &none  &none  &none  &none
-                          &none         &none         &none         &none         &none    &none  &none  &none  &none  &none
+&trans   &trans  &trans  &trans  &trans  &trans                    &trans  &trans                &trans                 &trans     &trans                &trans
+&trans   &trans  &trans  &trans  &trans  &trans                    &trans  &kp LBKT              &kp RBKT               &kp MINUS  &kp EQUAL             &trans
+&kp DEL  &trans  &trans  &trans  &trans  &trans                    &trans  &kp LEFT_PARENTHESIS  &kp RIGHT_PARENTHESIS  &kp SQT    &kp NON_US_HASH       &kp BSPC
+&trans   &trans  &trans  &trans  &trans  &trans  &trans    &trans  &trans  &kp LBRC              &kp RIGHT_BRACE        &kp PIPE   &kp NON_US_BACKSLASH  &trans
+                 &trans  &trans  &trans  &trans  &trans    &trans  &trans  &trans                &trans                 &trans
             >;
 
-            sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN &inc_dec_kp PG_UP PG_DN>;
+            label = "right-mod";
         };
 
         both-mod {
@@ -149,20 +129,68 @@
 &none              &none            &none            &none            &none            &none            &rgb_ug RGB_TOG    &none  &none  &none  &none  &none  &none  &none
                                     &none            &none            &none            &none            &none              &none  &none  &none  &none  &none
             >;
-
-            sensor-bindings = <&inc_dec_kp 0 0>;
         };
 
-        layer_4 {
+        encoder-alt {
             bindings = <
-&none  &none     &none      &none         &none      &none                    &none  &none  &none  &none  &none  &none
-&none  &none     &kp PG_UP  &kp UP_ARROW  &kp PG_DN  &none                    &none  &none  &none  &none  &none  &none
-&none  &kp HOME  &kp UP     &kp DOWN      &kp RIGHT  &kp END                  &none  &none  &none  &none  &none  &none
-&none  &none     &none      &none         &none      &none    &none    &none  &none  &none  &none  &none  &none  &none
-                 &none      &none         &none      &none    &none    &none  &none  &none  &none  &none
+&trans  &trans  &trans  &trans  &trans  &trans                    &trans  &trans  &trans  &trans  &trans  &trans
+&trans  &trans  &trans  &trans  &trans  &trans                    &trans  &trans  &trans  &trans  &trans  &trans
+&trans  &trans  &trans  &trans  &trans  &trans                    &trans  &trans  &trans  &trans  &trans  &trans
+&trans  &trans  &trans  &trans  &trans  &trans  &trans    &trans  &trans  &trans  &trans  &trans  &trans  &trans
+                &trans  &trans  &trans  &trans  &trans    &trans  &trans  &trans  &trans  &trans
             >;
 
-            sensor-bindings = <&inc_dec_kp UP_ARROW DOWN>;
+            sensor-bindings =
+                <&inc_dec_kp UP_ARROW DOWN>,
+                <&inc_dec_kp PAGE_UP PAGE_DOWN>;
+
+            label = "encoder-alt";
+        };
+
+        macro {
+            bindings = <
+&trans  &trans  &trans  &trans  &trans  &trans                    &trans  &trans  &trans  &trans  &trans  &trans
+&trans  &trans  &trans  &trans  &trans  &trans                    &trans  &trans  &trans  &trans  &trans  &trans
+&trans  &trans  &trans  &trans  &trans  &trans                    &trans  &trans  &trans  &trans  &trans  &trans
+&trans  &trans  &trans  &trans  &trans  &trans  &trans    &trans  &trans  &trans  &trans  &trans  &trans  &trans
+                &trans  &trans  &trans  &trans  &trans    &trans  &trans  &trans  &trans  &trans
+            >;
+
+            label = "macro";
+        };
+
+        qwerty {
+            bindings = <
+&trans  &trans  &trans  &trans  &trans  &trans                    &trans  &trans  &trans     &trans   &trans    &trans
+&trans  &kp Q   &kp W   &kp E   &kp R   &kp T                     &kp Y   &kp U   &kp I      &kp O    &kp P     &trans
+&trans  &kp A   &kp S   &kp D   &kp F   &kp G                     &kp H   &kp J   &kp K      &kp L    &kp SEMI  &trans
+&trans  &kp Z   &kp X   &kp C   &kp V   &kp B   &trans    &trans  &kp N   &kp M   &kp COMMA  &kp DOT  &kp FSLH  &trans
+                &trans  &trans  &trans  &trans  &trans    &trans  &trans  &trans  &trans     &trans
+            >;
+
+            label = "qwerty";
+        };
+
+        mirror-mod {
+            bindings = <
+&trans  &trans  &trans  &trans  &trans  &trans                    &trans  &trans  &trans  &trans  &trans  &trans
+&trans  &trans  &trans  &trans  &trans  &trans                    &trans  &trans  &trans  &trans  &trans  &trans
+&trans  &trans  &trans  &trans  &trans  &trans                    &trans  &trans  &trans  &trans  &trans  &trans
+&trans  &trans  &trans  &trans  &trans  &trans  &trans    &trans  &trans  &trans  &trans  &trans  &trans  &trans
+                &trans  &trans  &trans  &mo 8   &trans    &trans  &trans  &trans  &trans  &trans
+            >;
+
+            label = "mirror-mod";
+        };
+
+        mirror {
+            bindings = <
+&trans   &trans    &trans   &trans     &trans  &trans                    &trans  &trans  &trans  &trans  &trans  &trans
+&trans   &kp SEMI  &kp Y    &kp U      &kp L   &kp J                     &trans  &trans  &trans  &trans  &trans  &trans
+&kp DEL  &kp O     &kp I    &kp E      &kp N   &kp H                     &trans  &trans  &trans  &trans  &trans  &trans
+&trans   &kp FSLH  &kp DOT  &kp COMMA  &kp M   &kp K   &trans    &trans  &trans  &trans  &trans  &trans  &trans  &trans
+                   &trans   &trans     &trans  &trans  &trans    &trans  &trans  &trans  &trans  &trans
+            >;
         };
     };
 };