/* * Copyright (c) 2021 The ZMK Contributors * * SPDX-License-Identifier: MIT */ #include #include #include &sk { release-after-ms = <750>; quick-release; }; &caps_word { continue-list = ; }; #define RSTHD_L 0 #define NUM_L 1 #define SYM_L 2 #define NAV_L 3 #define FUN_L 4 #define MY_PSCRN LS(LC(PSCRN)) #define MY_COPY LC(INSERT) #define MY_PASTE LS(INSERT) #define VI_U LC(Z) #define VI_W LC(RIGHT) #define VI_B LC(LEFT) / { combos { compatible = "zmk,combos"; // shortcut #define COMBO(NAME, BINDINGS, KEYPOS, TIMEOUT) \ combo_##NAME { \ timeout-ms = ; \ bindings = ; \ key-positions = ; \ }; /* KEY POSITIONS ╭────────────────────╮ ╭────────────────────╮ │ 0 1 2 3 4 │ │ 5 6 7 8 9 │ │ 10 11 12 13 14 │ │ 15 16 17 18 19 │ │ 20 21 22 23 24 │ │ 25 26 27 28 29 │ ╰───────╮ 30 31 32 │ │ 33 34 35 ╭───────╯ ╰────────────╯ ╰────────────╯ */ COMBO(caps_word_right, &caps_word, 26 27, 60) COMBO(caps_word_left, &caps_word, 22 23, 60) COMBO(colon, &kp COLON, 6 7, 60) COMBO(semicolon, &kp SEMI, 7 8, 60) COMBO(slash, &kp FSLH, 1 2, 60) COMBO(underscore, &kp UNDER, 31 32, 100) COMBO(minus, &kp MINUS, 33 34, 100) COMBO(equal, &kp EQUAL, 12 23, 100) COMBO(enter, &kp ENTER, 17 26, 60) }; behaviors { lhm: left_hand_positional_hold_tap { compatible = "zmk,behavior-hold-tap"; label = "LEFT_POSITIONAL_HOLD_TAP"; #binding-cells = <2>; flavor = "tap-preferred"; tapping-term-ms = <200>; quick-tap-ms = <200>; bindings = <&kp>, <&kp>; // hold-trigger-key-positions = <18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35>; }; rhm: right_hand_positional_hold_tap { compatible = "zmk,behavior-hold-tap"; label = "RIGHT_POSITIONAL_HOLD_TAP"; #binding-cells = <2>; flavor = "tap-preferred"; tapping-term-ms = <200>; quick-tap-ms = <300>; bindings = <&kp>, <&kp>; // hold-trigger-key-positions = <0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17>; }; base_lt: base_layer_hold_tap { compatible = "zmk,behavior-hold-tap"; label = "BASE_LAYER_HOLD_TAP"; #binding-cells = <2>; flavor = "tap-preferred"; tapping-term-ms = <200>; quick-tap-ms = <300>; bindings = <&mo>, <&kp>; }; // rpt_lt: repeat_hold_tap { // compatible = "zmk,behavior-hold-tap"; // label = "REPEAT_HOLD_TAP"; // #binding-cells = <2>; // flavor = "tap-preferred"; // tapping-term-ms = <200>; // quick-tap-ms = <300>; // bindings = <&mo>, <&key_repeat>; // }; }; keymap { compatible = "zmk,keymap"; // RSTHD rsthd_layer { bindings = < &kp Z &kp C &kp Y &kp F &kp P &kp X &kp M &kp APOS &kp U &kp Q &lhm LALT R &lhm LSHFT S &lhm LCTRL T &lhm LGUI H &kp D &kp L &rhm LGUI N &rhm LCTRL A &rhm LSHFT I &rhm LALT O &sk LSHIFT &kp V &kp G &kp K &kp B &kp W &kp J &key_repeat &kp COMMA &sk LSHIFT /*& &*/ &kp ESC &base_lt NAV_L SPC &base_lt SYM_L TAB &base_lt SYM_L BSPC &base_lt NUM_L E &base_lt FUN_L DOT /* & &*/ >; }; num_layer { bindings = < &trans &kp LT &kp MINUS &kp GT &trans &trans &trans &kp EQUAL &trans &trans &lhm LALT N3 &lhm LSHFT N2 &lhm LCTRL N1 &lhm LGUI N0 &kp N4 &kp N5 &rhm LGUI N6 &rhm LCTRL N7 &rhm LSHFT N8 &rhm LALT N9 &kp FSLH &kp PLUS &kp CARET &kp STAR &trans &trans &trans &kp COMMA &kp DOT &trans /*& &*/ &trans &trans &trans &trans &trans &trans /* & &*/ >; }; sym_layer { bindings = < &trans &kp EXCL &kp AT &kp DLLR &trans &trans &kp TILDE &kp EQUAL &kp BSLH &trans &kp HASH &kp LT &kp MINUS &kp GT &kp GRAVE &kp AMPS &kp LBRC &kp LPAR &kp RPAR &kp PIPE &kp FSLH &kp PLUS &kp CARET &kp STAR &kp UNDER &kp PRCNT &kp RBRC &kp LBKT &kp RBKT &trans /*& &*/ &trans &trans &trans &trans &trans &trans /* & &*/ >; }; nav_layer { bindings = < &trans &kp PSCRN &kp MY_COPY &kp MY_PSCRN &kp MY_PASTE &trans &kp C_BRI_DEC &kp C_BRI_INC &kp VI_U &trans &kp END &kp C_NEXT &kp C_PP &kp C_VOL_UP &kp DEL &kp LEFT &kp DOWN &kp UP &kp RIGHT &kp HOME &trans &kp C_PREV &kp C_MUTE &kp C_VOL_DN &kp UNDER &kp VI_B &kp PG_DN &kp PG_UP &kp VI_W &trans /*& &*/ &trans &trans &trans &bt BT_PRV &bt BT_NXT &bt BT_CLR /* & &*/ >; }; function_layer { bindings = < &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &kp F3 &kp F2 &kp F1 &kp F10 &kp F4 &kp F5 &kp F6 &kp F7 &kp F8 &kp F9 &trans &trans &trans &kp F11 &trans &trans &kp F12 &trans &trans &trans /*& &*/ &trans &trans &trans &trans &trans &trans /* & &*/ >; }; }; };