This commit is contained in:
Glen 2022-04-01 22:33:47 -04:00
parent 0c28a3586a
commit f59457cf87
20 changed files with 409 additions and 39 deletions

171
config/base.keymap Normal file
View file

@ -0,0 +1,171 @@
/*
* Copyright (c) 2020 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
#include <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h>
/* Layers */
#define DEF_L 0
#define NAV_L 1
#define UPP_L 2
#define SYM_L 3
#define NUM_L 4
/* Behavior Settings */
&caps_word {
continue-list = <UNDERSCORE MINUS BACKSPACE>;
};
&sk {
release-after-ms = <60000>;
};
/ {
ZMK_MACRO(mo_nav,
wait-ms = <0>;
tap-ms = <0>;
bindings
= <&macro_tap &kp K_CANCEL>
, <&macro_press &mo NAV_L>
, <&macro_pause_for_release>
, <&macro_release &mo NAV_L>;)
ZMK_MACRO(mo_upp,
wait-ms = <0>;
tap-ms = <0>;
bindings
= <&macro_tap &kp K_CANCEL>
, <&macro_press &mo UPP_L>
, <&macro_pause_for_release>
, <&macro_release &mo UPP_L>;)
ZMK_MACRO(mo_sym,
wait-ms = <0>;
tap-ms = <0>;
bindings
= <&macro_tap &kp K_CANCEL>
, <&macro_press &mo SYM_L>
, <&macro_pause_for_release>
, <&macro_release &mo SYM_L>;)
combos {
compatible = "zmk,combos";
#define COMBO(NAME, BINDINGS, KEYPOS, LAYERS) \
combo_##NAME { \
bindings = <BINDINGS>; \
key-positions = <KEYPOS>; \
layers = <LAYERS>; \
};
/* 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 ╭───────────╯
╰────────╯ ╰────────╯ */
/* Letters */
COMBO(lower_v, &kp V, 1 2, DEF_L)
COMBO(lower_q, &kp Q, 1 3, DEF_L)
COMBO(lower_z, &kp Z, 20 21, DEF_L)
COMBO(upper_v, &kp LS(V), 1 2, UPP_L)
COMBO(upper_q, &kp LS(Q), 1 3, UPP_L)
COMBO(upper_z, &kp LS(Z), 20 21, UPP_L)
/* Brackets */
COMBO(left_bracket, &kp LBKT, 1 11, DEF_L UPP_L SYM_L NUM_L)
COMBO(right_bracket, &kp RBKT, 8 18, DEF_L UPP_L SYM_L NUM_L)
COMBO(left_parenthesis, &kp LPAR, 2 12, DEF_L UPP_L SYM_L NUM_L)
COMBO(right_parenthesis, &kp RPAR, 7 17, DEF_L UPP_L SYM_L NUM_L)
COMBO(left_brace, &kp LBRC, 3 13, DEF_L UPP_L SYM_L NUM_L)
COMBO(right_brace, &kp RBRC, 6 16, DEF_L UPP_L SYM_L NUM_L)
/* Convenience */
COMBO(esc, &kp ESC, 3 4, DEF_L)
COMBO(del, &kp DEL, 13 14, DEF_L)
COMBO(select_all, &kp LC(A), 20 21, NAV_L)
};
conditional_layers {
compatible = "zmk,conditional-layers";
tri_layer {
if-layers = <UPP_L SYM_L>;
then-layer = <NUM_L>;
};
};
keymap {
compatible = "zmk,keymap";
default_layer {
bindings = <
// ╭─────────────┬─────────────┬─────────────┬─────────────┬─────────────╮ ╭─────────────┬─────────────┬─────────────┬─────────────┬─────────────╮
&kp J &kp P &kp U &kp O &kp K &kp B &kp D &kp R &kp F &kp Q
&kp W &kp I &kp E &kp A &kp DOT &kp G &kp T &kp N &kp S &kp H
&kp Y &kp QUOT &kp COMMA &kp M &kp L &kp C
// ╰─────────────┴─────────────┴─────────────╮ ╭─────────────┴─────────────┴─────────────╯
&mo_nav &kp SPACE &mo_upp &mo_sym
// ╰─────────────┴─────────────╯ ╰─────────────┴─────────────╯
>;
};
nav_layer {
label = "Nav";
bindings = <
// ╭─────────────┬─────────────┬─────────────┬─────────────┬─────────────╮ ╭─────────────┬─────────────┬─────────────┬─────────────┬─────────────╮
&kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp PG_UP &kp HOME &kp UARW &kp END &caps_word
&sk LGUI &sk LALT &sk LSHFT &sk LCTRL &kp LC(Z) &kp PG_DN &kp LARW &kp ENTER &kp RARW &kp ESC
&kp LC(X) &kp LC(C) &kp LC(V) &kp TAB &kp DARW &key_repeat
// ╰─────────────┴─────────────┴─────────────╮ ╭─────────────┴─────────────┴─────────────╯
&trans &trans &kp BSPC &kp DEL
// ╰─────────────┴─────────────╯ ╰─────────────┴─────────────╯
>;
};
upper_layer {
label = "Upp";
bindings = <
// ╭─────────────┬─────────────┬─────────────┬─────────────┬─────────────╮ ╭─────────────┬─────────────┬─────────────┬─────────────┬─────────────╮
&kp LS(J) &kp LS(P) &kp LS(U) &kp LS(O) &kp LS(K) &kp LS(B) &kp LS(D) &kp LS(R) &kp LS(F) &kp LS(Q)
&kp LS(W) &kp LS(I) &kp LS(E) &kp LS(A) &kp LS(GT) &kp LS(G) &kp LS(T) &kp LS(N) &kp LS(S) &kp LS(H)
&kp LS(Y) &kp DQT &kp LT &kp LS(M) &kp LS(L) &kp LS(C)
// ╰─────────────┴─────────────┴─────────────╮ ╭─────────────┴─────────────┴─────────────╯
&trans &kp LS(SPACE) &trans &trans
// ╰─────────────┴─────────────╯ ╰─────────────┴─────────────╯
>;
};
sym_layer {
label = "Sym";
bindings = <
// ╭─────────────┬─────────────┬─────────────┬─────────────┬─────────────╮ ╭─────────────┬─────────────┬─────────────┬─────────────┬─────────────╮
&kp EXCL &kp AT &kp POUND &kp DLLR &kp PRCNT &kp CARET &kp AMPS &kp SEMI &kp COLON &kp DQT
&kp MINUS &kp PLUS &kp EQUAL &kp ASTRK &kp FSLH &kp BSLH &sk LCTRL &sk LSHFT &sk LALT &sk LGUI
&kp TILDE &kp GRAVE &kp QMARK &kp PIPE &kp LT &kp GT
// ╰─────────────┴─────────────┴─────────────╮ ╭─────────────┴─────────────┴─────────────╯
&trans &kp UNDER &trans &trans
// ╰─────────────┴─────────────╯ ╰─────────────┴─────────────╯
>;
};
num_layer {
label = "Num";
bindings = <
// ╭─────────────┬─────────────┬─────────────┬─────────────┬─────────────╮ ╭─────────────┬─────────────┬─────────────┬─────────────┬─────────────╮
&none &kp N7 &kp N4 &kp N3 &none &kp F6 &kp F7 &kp F8 &kp F9 &kp F10
&kp MINUS &kp N2 &kp N1 &kp N0 &kp SLASH &kp F11 &sk LCTRL &sk LSHFT &sk LALT &sk LGUI
&kp N8 &kp N6 &kp N5 &kp F12 &kp COMMA &kp DOT
// ╰─────────────┴─────────────┴─────────────╮ ╭─────────────┴─────────────┴─────────────╯
&trans &kp N9 &trans &trans
// ╰─────────────┴─────────────╯ ╰─────────────┴─────────────╯
>;
};
};
};