Skip to content

Instantly share code, notes, and snippets.

@zmitry
Created November 30, 2021 22:10
Show Gist options
  • Select an option

  • Save zmitry/d080a19c1af65fdbbef29f51cc8012ba to your computer and use it in GitHub Desktop.

Select an option

Save zmitry/d080a19c1af65fdbbef29f51cc8012ba to your computer and use it in GitHub Desktop.
/* Copyright 2020 Jordan Egstad
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A P ARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include QMK_KEYBOARD_H
#include "g/keymap_combo.h"
/* ==========================================================================
LAYERS
========================================================================== */
// qwerty
#define _QW 0
// functions
#define _FN 1
// numbers
#define NUMBERS 2
/* ==========================================================================
CUSTOM KEYS
========================================================================== */
// Layers
#define FN_SPC LT(_FN, KC_SPC) // Tap for space, hold for _FN
// Modifiers
#define LG_ZMIN LGUI(KC_EQUAL) // Command + plus (zoom in)
#define LG_ZMOT LGUI(KC_MINUS) // Command + minus (zoom out)
#define MT_SHFT MT(MOD_RSFT, KC_ENT) // Tap for enter, hold for shift
#define MT_ESC MT(KC_ESC, KC_LCTL) // Tap for enter, hold for shift
// navigation shortcuts
#define TABL G(S(KC_LBRC))
#define TABR G(S(KC_RBRC))
#define FWD G(KC_RBRC)
#define BACK G(KC_LBRC)
#define _n_ KC_NO
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_QW] = LAYOUT_ortho_5x15( /* QWERTY */
KC_TAB, LT(5, KC_Q), LT(4, KC_W), KC_E, KC_R, KC_T, _______, _______, _______, KC_Y, KC_U, KC_I, LT(NUMBERS, KC_O), KC_P, KC_LBRC, \
KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, _______, _______, _______, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \
_______, MT(MOD_RALT, KC_Z), KC_X, KC_C, KC_V, KC_B, _______, _______,_______, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_BSLS, \
_______, _______, _______, KC_LGUI, KC_SPC , MO(_FN), _______, _______, _______, OSL(5), KC_RSFT, KC_BSPC, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
),
[_FN] = LAYOUT_ortho_5x15( /* FUNCTION */
KC_PSCR, _n_, C(KC_SPC), TABL, TABR, BACK, _n_, _n_, _n_, KC_PGUP, KC_HOME, KC_UP, KC_END, _n_, _n_, \
KC_CAPS, KC_LCTL ,KC_LSFT, OSM(MOD_LALT), KC_LGUI, FWD, _______, _______, _n_, KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, _______,_______, \
_n_, _n_, _n_, _n_, _n_, _n_, _n_, _n_, _n_, _n_, KC_MS_LEFT, KC_MS_UP, KC_MS_DOWN, KC_MS_RIGHT, _______, \
_n_, _______, _______, _______, _______, _______, _______,_______, _______, KC_MS_BTN1, KC_ENT, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
),
[NUMBERS] = LAYOUT_ortho_5x15( /* FUNCTION */
_______, KC_SLSH, KC_1, KC_2, KC_3, KC_EQL, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, KC_0, KC_4, KC_5, KC_6 , S(KC_EQL), _______, _______, _______, _______, S(KC_5),_______, _______, _______, _______, \
_______, S(KC_8) ,KC_7, KC_8, KC_9,KC_MINS, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______,_______, _______, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
),
[3] = LAYOUT_ortho_5x15(
_______, KC_Q, KC_W, KC_F, KC_P, KC_G, _______, _______, _______, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, _______, \
_______, KC_A, KC_R, KC_S, KC_T, KC_D, _______, _______, _______, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \
_______, KC_Z, KC_X, KC_C, KC_V, KC_B, _______, _______, _______, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, _______, \
_______, _______, _______, _______, _______, _______, _______,_______, _______, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
),
[4] = LAYOUT_ortho_5x15( /* FUNCTION */
_______, _______, _______, _______, _______, _______, _______, _______, _______, S(KC_LBRC), S(KC_RBRC), S(KC_3), S(KC_4), S(KC_GRV), _______, \
_______, _______, _______, S(KC_5), S(KC_MINS), KC_EXLM, _______, _______, _______, KC_LBRC, KC_RBRC, S(KC_2), KC_QUOT, S(KC_QUOT), _______, \
_______, _______ ,_______, _______, _______,_______, _______, _______, _______, KC_LPRN, KC_RPRN, S(KC_6), S(KC_7), KC_BSLS, _______, \
_______, _______, _______, _______, _______, _______, _______,_______, _______, S(KC_BSLS), KC_GRV, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
),
[5] = LAYOUT_ortho_5x15( /* FUNCTION */
_______, _______, _______, _______, KC_ESC, _______, _______, _______, _______, _______, KC_RBRC, KC_BSLS, KC_QUOT, KC_LBRC, _n_, \
_______, _______, _______, KC_ESC, KC_ENT, _______, _______, _______, _______, _______, KC_LGUI, KC_LALT, KC_LSFT, OSM(MOD_LCTL), _n_, \
_______, _______ ,_______, _______, _______,_______, _______, _______, _______, _______, _______, _______, _______, _______, _n_, \
_______, _______, _______, _______, C(KC_SPC), KC_TAB, _______,_______, _______, _______, _______, _______, _______, _______, _n_, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _n_ \
),
};
uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case LM(4, MOD_LGUI):
return 50;
default:
return TAPPING_TERM;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment