/* * Copyright (c) 2022 The ZMK Contributors * * SPDX-License-Identifier: MIT */ #include #include #define DEF_L 0 #define NUM_L 1 #define SYM_L 2 #define TMUX_L 3 // Using layer taps on thumbs, having quick tap as well helps w/ repeating space/backspace < { quick_tap_ms = <200>; }; / { behaviors { hm: homerow_mods { compatible = "zmk,behavior-hold-tap"; label = "homerow mods"; #binding-cells = <2>; tapping_term_ms = <225>; flavor = "tap-preferred"; bindings = <&kp>, <&kp>; }; }; combos { compatible = "zmk,combos"; combo_backtick { timeout-ms = <50>; key-positions = <0 1>; bindings = <&kp GRAVE>; }; combo_esc { timeout-ms = <50>; key-positions = <1 11>; bindings = <&kp ESC>; }; combo_backspace { timeout-ms = <50>; key-positions = <11 12>; bindings = <&kp BSPC>; }; combo_tab { timeout-ms = <50>; key-positions = <12 13>; bindings = <&kp TAB>; }; combo_enter { timeout-ms = <50>; key-positions = <22 23>; bindings = <&kp ENTER>; }; combo_minus { timeout-ms = <50>; key-positions = <7 8>; bindings = <&kp MINUS>; }; combo_backslash { timeout-ms = <50>; key-positions = <8 9>; bindings = <&kp BACKSLASH>; }; combo_less_than { timeout-ms = <50>; key-positions = <15 16>; bindings = <&kp LT>; }; combo_greater_than { timeout-ms = <50>; key-positions = <17 18>; bindings = <&kp GT>; }; combo_colon { timeout-ms = <50>; key-positions = <16 17>; bindings = <&kp COLON>; }; combo_quote { timeout-ms = <50>; key-positions = <25 26>; bindings = <&kp APOSTROPHE>; }; combo_underscore { timeout-ms = <50>; key-positions = <26 27>; bindings = <&kp UNDER>; }; }; macros { tmux_new: tmux_new { label = "ZM_tmux_new"; compatible = "zmk,behavior-macro"; #binding-cells = <0>; bindings = <¯o_tap &kp LC(B)> , <¯o_tap &kp C> ; }; tmux_zoom: tmux_zoom { label = "ZM_tmux_zoom"; compatible = "zmk,behavior-macro"; #binding-cells = <0>; bindings = <¯o_tap &kp LC(B)> , <¯o_tap &kp Z> ; }; tmux_scroll: tmux_scroll { label = "ZM_tmux_scroll"; compatible = "zmk,behavior-macro"; #binding-cells = <0>; bindings = <¯o_tap &kp LC(B)> , <¯o_tap &kp LEFT_BRACKET> ; }; tmux_pn_lt: tmux_pn_lt { label = "ZM_tmux_pn_lt"; compatible = "zmk,behavior-macro"; #binding-cells = <0>; bindings = <¯o_tap &kp LC(B)> , <¯o_tap &kp LEFT> ; }; tmux_pn_dn: tmux_pn_dn { label = "ZM_tmux_pn_dn"; compatible = "zmk,behavior-macro"; #binding-cells = <0>; bindings = <¯o_tap &kp LC(B)> , <¯o_tap &kp DOWN> ; }; tmux_pn_up: tmux_pn_up { label = "ZM_tmux_pn_up"; compatible = "zmk,behavior-macro"; #binding-cells = <0>; bindings = <¯o_tap &kp LC(B)> , <¯o_tap &kp UP> ; }; tmux_pn_rt: tmux_pn_rt { label = "ZM_tmux_pn_rt"; compatible = "zmk,behavior-macro"; #binding-cells = <0>; bindings = <¯o_tap &kp LC(B)> , <¯o_tap &kp RIGHT> ; }; tmux_wn_next: tmux_wn_next { label = "ZM_tmux_wn_next"; compatible = "zmk,behavior-macro"; #binding-cells = <0>; bindings = <¯o_tap &kp LC(B)> , <¯o_tap &kp N> ; }; tmux_wn_prev: tmux_wn_prev { label = "ZM_tmux_wn_prev"; compatible = "zmk,behavior-macro"; #binding-cells = <0>; bindings = <¯o_tap &kp LC(B)> , <¯o_tap &kp P> ; }; tmux_sp_v: tmux_sp_v { label = "ZM_tmux_sp_v"; compatible = "zmk,behavior-macro"; #binding-cells = <0>; bindings = <¯o_tap &kp LC(B)> , <¯o_tap &kp PERCENT> ; }; tmux_sp_h: tmux_sp_h { label = "ZM_tmux_sp_h"; compatible = "zmk,behavior-macro"; #binding-cells = <0>; bindings = <¯o_tap &kp LC(B)> , <¯o_tap &kp DOUBLE_QUOTES> ; }; vi_clip_cp: vi_clip_cp { label = "ZM_vi_clip_cp"; compatible = "zmk,behavior-macro"; #binding-cells = <0>; bindings = <¯o_tap &kp DOUBLE_QUOTES> , <¯o_tap &kp PLUS> , <¯o_tap &kp Y> ; }; vi_clip_pst: vi_clip_pst { label = "ZM_vi_clip_pst"; compatible = "zmk,behavior-macro"; #binding-cells = <0>; bindings = <¯o_tap &kp DOUBLE_QUOTES> , <¯o_tap &kp PLUS> , <¯o_tap &kp P> ; }; vi_macro: vi_macro { label = "ZM_vi_macro"; compatible = "zmk,behavior-macro"; #binding-cells = <0>; bindings = <¯o_tap &kp AT> , <¯o_tap &kp Q> ; }; vi_save: vi_save { label = "ZM_vi_save"; compatible = "zmk,behavior-macro"; #binding-cells = <0>; bindings = <¯o_tap &kp ESC> , <¯o_tap &kp COLON &kp W &kp ENTER> , <¯o_tap &kp LC(T)> ; }; term_full: term_full { label = "ZM_term_full"; compatible = "zmk,behavior-macro"; #binding-cells = <0>; bindings = <¯o_tap &kp LC(TILDE)> ; }; desk_left: desk_left { label = "ZM_desk_left"; compatible = "zmk,behavior-macro"; #binding-cells = <0>; bindings = <¯o_tap &kp LC(LG(LEFT))> ; }; desk_right: desk_right { label = "ZM_desk_right"; compatible = "zmk,behavior-macro"; #binding-cells = <0>; bindings = <¯o_tap &kp LC(LG(RIGHT))> ; }; }; keymap { compatible = "zmk,keymap"; // 0 // 10 // 20 default_layer { bindings = < &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &hm LCTL A &kp S &kp D &kp F &kp G &kp H &hm LGUI J &kp K &kp L &hm RCTL SEMI &hm LALT Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp SLASH &mo NUM_L &kp LSHIFT &kp ESC &mo TMUX_L &kp SPACE &mo SYM_L >; }; num_layer { label = "Num"; bindings = < &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &trans &desk_left &kp LG(E) &kp LG(R) &desk_right &trans &kp N4 &kp N5 &kp N6 &kp COLON &kp F1 &kp F2 &kp F12 &kp F4 &kp F5 &trans &kp N1 &kp N2 &kp N3 &kp DOT &none &none &none &none &none &kp N0 >; }; sym_layer { label = "Sym"; bindings = < &kp EXCL &kp AT &kp HASH &kp DLLR &kp PRCNT &kp CARET &kp AMPS &kp ASTRK &kp PLUS &kp EQUAL &kp COLON &none &kp LPAR &kp RPAR &none &kp LEFT &kp DOWN &kp UP &kp RIGHT &trans &none &kp LBRC &kp LBKT &kp RBKT &kp RBRC &kp HOME &kp PG_DN &kp PG_UP &kp END &trans &none &none &none &none &none &none >; }; tmux_layer { label = "Tmux"; bindings = < &vi_macro &vi_save &none &none &tmux_sp_v &vi_clip_cp &none &none &none &vi_clip_pst &none &tmux_scroll &none &term_full &none &tmux_pn_lt &tmux_pn_dn &tmux_pn_up &tmux_pn_rt &tmux_sp_h &tmux_zoom &none &tmux_new &none &none &tmux_wn_prev &none &none &tmux_wn_next &none &none &kp DEL &none &none &none &none >; }; }; };