Skip to content

Instantly share code, notes, and snippets.

@antler5
Last active August 29, 2023 03:42
Show Gist options
  • Save antler5/239b33be09932365a14b783f8e77e4b4 to your computer and use it in GitHub Desktop.
Save antler5/239b33be09932365a14b783f8e77e4b4 to your computer and use it in GitHub Desktop.
/* -*- mode: c -*- */
/*
* Copyright (c) 2020 The ZMK Contributors
* Copyright (c) 2020 antlers <antlers@illucid.net>
*
* SPDX-License-Identifier: MIT
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the “Software”), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* # My ZMK configuration, immediately after setting up Seniply.
*
* - This is a 34-key layout padded to fit a Lily58.
* - Alphas and base-layer symbols are Magic Sturdy:
* https://github.com/Ikcelaks/keyboard_layouts/blob/main/magic_sturdy/magic_sturdy.md
* - The `&repeat_key' has custom programming which is not included.
* - I've never used some keys like AltGr or Menu, and might have made mistakes with them.
* - What are Consumer vs Keyboard key-codes?
* - It's time for bed, and there might be other bugs or preferences that I haven't pointed out.
* - When I wake up I'm gonna switch to Vi-keys, swap the Ext/Sym layers and otherwise diverge--
* so while it's not perfect, this is as close to stock seniply as I'll ever be.
*/
#include <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h>
// #include <dt-bindings/zmk/bt.h>
// #include <dt-bindings/zmk/ext_power.h>
#define XXX &none
#define ___ &trans
#define BASE 0 // layer shortcuts, must match order in which they are defined below
#define EXT 1
#define FUN 2
#define SYM 3
#define NUM 4
#define QRT 5
/ {
keymap {
compatible = "zmk,keymap";
base_layer {
bindings = <
// ╭─────────────┬─────────────┬─────────────┬─────────────┬─────────────┬─────────────╮ ╭─────────────┬─────────────┬─────────────┬─────────────┬─────────────┬─────────────╮
XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX
// ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤ ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤
XXX &kp V &kp M &kp L &kp C &kp P &kp B &key_repeat &kp U &kp O &kp Q XXX
// ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤ ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤
XXX &kp S &kp T &kp R &kp D &kp Y &kp F &kp N &kp E &kp A &kp I XXX
// ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┬─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤
XXX &kp X &kp K &kp J &kp G &kp W XXX XXX &kp Z &kp H &kp COMMA &kp DOT &kp SEMI XXX
// └─────────────┴─────────────┴─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┴─────────────┴─────────────┘
XXX &td_num &td_ext &kp LSHIFT &kp SPC &td_sym &td_fun XXX
// ╰─────────────┴─────────────┴─────────────┴─────────────┴─────────────┴─────────────┴─────────────┴─────────────╯
>;
};
extend_layer {
bindings = <
// ╭─────────────┬─────────────┬─────────────┬─────────────┬─────────────┬─────────────╮ ╭─────────────┬─────────────┬─────────────┬─────────────┬─────────────┬─────────────╮
XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX
// ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤ ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤
XXX &kp ESC &kp LA(LEFT) &kp LC(F) &kp LA(RIGHT) &kp INS &kp PG_UP &kp HOME &kp UP &kp END &kp CAPS XXX
// ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤ ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤
XXX &sk LALT &sk LMETA &sk LSHIFT &sk LCTRL &kp RALT &kp PG_DN &kp LEFT &kp DOWN &kp RIGHT &kp DELETE XXX
// ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┬─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤
XXX &kp LC(Z) &kp LC(X) &kp LC(C) &kp LMETA &kp LC(V) XXX XXX &kp RET &kp BSPC &kp TAB &kp K_CMENU &kp PSCRN XXX
// └─────────────┴─────────────┴─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┴─────────────┴─────────────┘
XXX XXX ___ XXX &kp RET ___ XXX XXX
// ╰─────────────┴─────────────┴─────────────┴─────────────┴─────────────┴─────────────┴─────────────┴─────────────╯
>;
};
symbols_layer {
bindings = <
// ╭─────────────┬─────────────┬─────────────┬─────────────┬─────────────┬─────────────╮ ╭─────────────┬─────────────┬─────────────┬─────────────┬─────────────┬─────────────╮
XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX
// ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤ ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤
XXX &kp EXCL &kp AT &kp HASH &kp DOLLAR &kp PERCENT &kp EQUAL &kp GRAVE &kp COLON &kp SEMI &kp PLUS XXX
// ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤ ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤
XXX &sk LALT &sk LMETA &sk LSHIFT &sk LCTRL &kp CARET &kp STAR &kp LPAR &kp LBRC &kp LBKT &kp MINUS XXX
// ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤
XXX XXX XXX &kp BSLH &kp PIPE &kp AMPS XXX XXX &kp TILDE &kp RPAR &kp RBRC &kp RBKT &kp UNDER XXX
// └─────────────┴─────────────┴─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┴─────────────┴─────────────┘
XXX XXX ___ XXX XXX ___ XXX XXX
// ╰─────────────┴─────────────┴─────────────┴─────────────┴─────────────┴─────────────┴─────────────┴─────────────╯
>;
};
function_layer {
bindings = <
// ╭─────────────┬─────────────┬─────────────┬─────────────┬─────────────┬─────────────╮ ╭─────────────┬─────────────┬─────────────┬─────────────┬─────────────┬─────────────╮
XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX
// ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤ ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤
XXX &kp K_STOP2 &kp K_PREV &kp C_PLAY &kp K_NEXT &kp C_BRI_DN &kp F12 &kp F7 &kp F8 &kp F9 &kp SLCK XXX
// ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤ ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤
XXX &sk LALT &sk LMETA &sk LSHIFT &sk LCTRL &kp C_BRI_UP &kp F11 &kp F4 &kp F5 &kp F6 &to QRT XXX
// ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤
XXX &kp K_MUTE &kp K_VOL_DN &kp LS(LC(C)) &kp K_VOL_UP &kp LS(LC(V)) XXX XXX &kp F10 &kp F1 &kp F2 &kp F3 &to BASE XXX
// └─────────────┴─────────────┴─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┴─────────────┴─────────────┘
XXX XXX XXX XXX &kp RET XXX XXX XXX
// ╰─────────────┴─────────────┴─────────────┴─────────────┴─────────────┴─────────────┴─────────────┴─────────────╯
>;
};
numbers_layer {
bindings = <
// ╭─────────────┬─────────────┬─────────────┬─────────────┬─────────────┬─────────────╮ ╭─────────────┬─────────────┬─────────────┬─────────────┬─────────────┬─────────────╮
XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX
// ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤ ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤
XXX XXX XXX XXX XXX &kp LNLCK &kp EQUAL &kp N7 &kp N8 &kp N9 &kp PLUS XXX
// ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤ ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤
XXX &sk LALT &sk LMETA &sk LSHIFT &sk LCTRL &kp RALT &kp STAR &kp N4 &kp N5 &kp N6 &kp MINUS XXX
// ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤
XXX XXX &kp K_CMENU &kp INS &kp BSPC &kp RET XXX XXX &kp N0 &kp N1 &kp N2 &kp N3 &kp FSLH XXX
// └─────────────┴─────────────┴─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┴─────────────┴─────────────┘
XXX XXX XXX XXX XXX XXX XXX XXX
// ╰─────────────┴─────────────┴─────────────┴─────────────┴─────────────┴─────────────┴─────────────┴─────────────╯
>;
};
querty_layer {
bindings = <
// ╭─────────────┬─────────────┬─────────────┬─────────────┬─────────────┬─────────────╮ ╭─────────────┬─────────────┬─────────────┬─────────────┬─────────────┬─────────────╮
___ &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp MINUS
// ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤ ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤
___ &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp BSPC
// ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤ ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤
___ &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI &kp SQT
// ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┬─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤
___ &kp Z &kp X &kp C &kp V &kp B ___ ___ &kp N &kp M &kp COMMA &kp DOT &kp SLASH ___
// └─────────────┴─────────────┴─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┴─────────────┴─────────────┘
XXX &td_num &td_ext &kp LSHIFT &kp SPC &td_sym &td_fun XXX
// ╰─────────────┴─────────────┴─────────────┴─────────────┴─────────────┴─────────────┴─────────────┴─────────────╯
>;
};
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment