Skip to content

Commit

Permalink
Add macroses to type parens/brackets/braces with/without spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
vlad-psh committed Oct 7, 2024
1 parent 479907a commit a8e1794
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 10 deletions.
8 changes: 4 additions & 4 deletions config/adv360.keymap
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
&kp N1 &kp Q &kp W &kp F &kp P &kp B &none &kp C_VOL_UP &kp J &kp M &kp U &kp Y &kp SEMI &kp EQUAL
&kp TAB &kp A &kp R &kp S &kp T &kp G &none &none &kp LALT &kp RS(TAB) &kp TAB &kp C_VOL_DN &kp H &kp N &kp E &kp I &kp O &kp SQT
&mo 2 &kp Z &kp X &kp C &kp D &kp V &kp LCTRL &kp RCTRL &kp K &kp L &kp COMMA &kp DOT &kp FSLH &kp MINUS
&kp LG(LC(LA(E))) &none &kp ESC &arr_left &arr_right &mt LGUI ENTER &kp SPACE &kp LGUI &kp RGUI &kp RCTRL &mt RSHFT ENTER &kp BSPC &kp DEL &kp UNDER &none &kp LG(LC(LA(R)))
&kp LG(LC(LA(E))) &none &kp ESC &arr_left &arr_right &mt LGUI ENTER &kp SPACE &mo 2 &kp RGUI &kp RCTRL &mt RSHFT ENTER &kp BSPC &kp DEL &kp UNDER &none &kp LG(LC(LA(R)))
>;
};

Expand All @@ -44,9 +44,9 @@
layer_2 { // Movements+etc layer (to enable, press LEFT SHIFT button or Right-Thumb-2 key)
bindings = <
&to 0 &none &none &none &none &none &none &none &none &none &none &none &none &none
&none &BRCPAIR &none &none &none &none &kp LG(LS(N3)) &none &none &none &none &none &none &trans
&trans &PARENPAIR &none &none &none &none &kp LG(LS(N4)) &trans &trans &trans &trans &none &arr_left &arr_down &arr_up &arr_right &none &trans
&trans &BKTPAIR &none &none &none &none &trans &trans &none &none &trans &trans &trans &trans
&none &none &kp LBRC &BRCPAIR &kp RBRC &none &kp LG(LS(N3)) &none &none &none &none &none &none &trans
&trans &none &kp LPAR &PARENPAIR &kp RPAR &none &kp LG(LS(N4)) &trans &trans &trans &trans &none &arr_left &arr_down &arr_up &arr_right &none &kp GRAVE
&trans &none &kp LBKT &BKTPAIR &kp RBKT &none &trans &trans &none &none &trans &trans &trans &kp PIPE
&trans &none &trans &none &none &trans &trans &trans &kp LC(Q) &kp F10 &kp LC(S) &trans &trans &none &trans &kp LSHFT
>;
};
Expand Down
55 changes: 49 additions & 6 deletions config/macros.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,64 @@ VIMQ: vim_quit {
#binding-cells = <0>;
bindings = <&kp ESC>, <&kp LS(SEMI)>, <&kp Q>, <&kp ENTER>;
};
PARENPAIR: parentheses_pair {


PARENPAIR_NOSPACE: parentheses_pair_nospace {
compatible = "zmk,behavior-macro";
label = "parentheses_pair";
label = "parentheses_pair_nospace";
#binding-cells = <0>;
bindings = <&kp LPAR>, <&kp RPAR>, <&kp LEFT>;
};
BKTPAIR: brackets_pair {
BKTPAIR_NOSPACE: brackets_pair_nospace {
compatible = "zmk,behavior-macro";
label = "brackets_pair";
label = "brackets_pair_nospace";
#binding-cells = <0>;
bindings = <&kp LBKT>, <&kp RBKT>, <&kp LEFT>;
};
BRCPAIR: braces_pair {
BRCPAIR_NOSPACE: braces_pair_nospace {
compatible = "zmk,behavior-macro";
label = "braces_pair";
label = "braces_pair_nospace";
#binding-cells = <0>;
bindings = <&kp LBRC>, <&kp RBRC>, <&kp LEFT>;
};

PARENPAIR_SPACE: parentheses_pair_space {
compatible = "zmk,behavior-macro";
label = "parentheses_pair_space";
#binding-cells = <0>;
bindings = <&kp LPAR>, <&kp RPAR>, <&kp LEFT>, <&kp SPACE>, <&kp SPACE>, <&kp LEFT>;
};
BKTPAIR_SPACE: brackets_pair_space {
compatible = "zmk,behavior-macro";
label = "brackets_pair_space";
#binding-cells = <0>;
bindings = <&kp LBKT>, <&kp RBKT>, <&kp LEFT>, <&kp SPACE>, <&kp SPACE>, <&kp LEFT>;
};
BRCPAIR_SPACE: braces_pair_space {
compatible = "zmk,behavior-macro";
label = "braces_pair_space";
#binding-cells = <0>;
bindings = <&kp LBRC>, <&kp RBRC>, <&kp LEFT>, <&kp SPACE>, <&kp SPACE>, <&kp LEFT>;
};

PARENPAIR: parintheses_pair {
compatible = "zmk,behavior-mod-morph";
label = "parentheses_pair";
#binding-cells = <0>;
bindings = <&PARENPAIR_NOSPACE>, <&PARENPAIR_SPACE>;
mods = <(MOD_LGUI|MOD_RGUI)>;
};
BKTPAIR: brackets_pair {
compatible = "zmk,behavior-mod-morph";
label = "brackets_pair";
#binding-cells = <0>;
bindings = <&BKTPAIR_NOSPACE>, <&BKTPAIR_SPACE>;
mods = <(MOD_LGUI|MOD_RGUI)>;
};
BRCPAIR: braces_pair {
compatible = "zmk,behavior-mod-morph";
label = "braces_pair";
#binding-cells = <0>;
bindings = <&BRCPAIR_NOSPACE>, <&BRCPAIR_SPACE>;
mods = <(MOD_LGUI|MOD_RGUI)>;
};

0 comments on commit a8e1794

Please sign in to comment.