forked from qmk/qmk_firmware
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
df78593
commit 10767f5
Showing
2 changed files
with
173 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* Copyright 2017 Balz Guenat | ||
* | ||
* 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 PARTICULAR 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/>. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#define PERMISSIVE_HOLD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,154 @@ | ||
#include QMK_KEYBOARD_H | ||
|
||
// mod tap functions | ||
#define ESC_FN1 LT(1, KC_ESC) | ||
#define ENT_CMD MT(MOD_LGUI, KC_ENT) | ||
|
||
// vim navigation | ||
#define cD LCTL(KC_D) | ||
#define cE LCTL(KC_E) | ||
#define cU LCTL(KC_U) | ||
#define cY LCTL(KC_Y) | ||
|
||
// clion commands | ||
#define BUILD LCMD(KC_F9) | ||
#define BACK LCMD(LALT(KC_LEFT)) | ||
#define FWD LCMD(LALT(KC_RIGHT)) | ||
#define MVUP LCMD(LSFT(KC_UP)) | ||
#define MVDOWN LCMD(LSFT(KC_DOWN)) | ||
#define REFACTOR LSFT(KC_F6) | ||
#define HDRSRC LCMD(LCTL(KC_UP)) | ||
#define LIST LCMD(KC_F12) | ||
#define WHERE LCMD(LALT(KC_F7)) | ||
#define GOTO LCMD(KC_B) | ||
#define ESC LSFT(KC_ESC) | ||
#define OPEN LCMD(KC_E) | ||
#define TABL LCMD(LSFT(KC_LBRC)) | ||
#define TABR LCMD(LSFT(KC_RBRC)) | ||
#define BEAUTIFY LCMD(LCTL(LALT(KC_B))) // custom command | ||
#define FLASH LCMD(LCTL(LALT(KC_F))) // custom command | ||
|
||
enum custom_keycodes { | ||
tmuxL = SAFE_RANGE, | ||
tmuxR, | ||
tmuxNew, | ||
tmuxKil, | ||
appSwitch, | ||
}; | ||
|
||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
/* BASE layer: Default Layer | ||
* ,--------------------------------------------------------------------------------------------------. | ||
* | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Backspace | | Grv | | ||
* |-----------------------------------------------------------------------------------------+ +-----+ | ||
* | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | Bksp | | Del | | ||
* |-----------------------------------------------------------------------------------------+ +-----+ | ||
* | TabFn1 | A | S | D | F | G | H | J | K | L | ; | ' | EnterCmd | | ||
* |--------------------------------------------------------------------------------------------+ | ||
* | Shift | Z | X | C | V | B | N | M | , | . | / | Shift | Up | | ||
* +--------------------------------------------------------------------------------------------+-----+ | ||
* | Ctrl | Alt | Cmd | Space | Cmd | Alt | Fn | Left| Down|Right| | ||
* `--------------------------------------------------------------------------------------------------´ | ||
*/ | ||
[0] = LAYOUT( | ||
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,KC_EQL, KC_BSPC, KC_GRV, | ||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,KC_RBRC,KC_BSLS, KC_DEL, | ||
ESC_FN1,KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_ENT, | ||
KC_LSFT,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH,KC_RSFT, KC_UP, | ||
KC_LCTL,KC_LALT,KC_LGUI, KC_SPC, KC_RCMD,KC_RALT,MO(3), KC_LEFT,KC_DOWN,KC_RGHT | ||
), | ||
/* Fn1 layer | ||
* ,--------------------------------------------------------------------------------------------------. | ||
* | | ! | @ | # | $ | % | ^ | & | * | ( | ) | _ | + | | | | | ||
* |-----------------------------------------------------------------------------------------+ +-----+ | ||
* | | | | cE | | | cY | cU | | | | { | } | | | | | | ||
* |-----------------------------------------------------------------------------------------+ +-----+ | ||
* | | | | cD | Fn2 | | Left | Down | Up | Right | : | " | | | ||
* |--------------------------------------------------------------------------------------------+ | ||
* | | | | | | | | | < | > | ? | | | | ||
* +--------------------------------------------------------------------------------------------+-----+ | ||
* | | | | | | | | | | | | ||
* `--------------------------------------------------------------------------------------------------´ | ||
*/ | ||
[1] = LAYOUT( | ||
_______,KC_EXLM,KC_AT ,KC_HASH,KC_DLR ,KC_PERC,KC_CIRC,KC_AMPR,KC_ASTR,KC_LPRN,KC_RPRN,KC_UNDS,KC_PLUS,_______, _______, | ||
_______,_______,_______,cE ,_______,_______,cY ,cU ,_______,_______,_______,KC_LCBR,KC_RCBR,KC_PIPE, _______, | ||
_______,_______,_______,cD ,MO(2) ,_______,KC_LEFT,KC_DOWN,KC_UP ,KC_RGHT,KC_COLN,KC_DQT , _______, | ||
_______,_______,tmuxKil,tmuxNew,_______,tmuxL ,tmuxR ,_______,KC_LT ,KC_GT ,KC_QUES,_______, _______, | ||
_______,_______,_______, appSwitch, _______,_______,_______, _______,_______,_______ | ||
), | ||
/* Fn2 layer | ||
* ,--------------------------------------------------------------------------------------------------. | ||
* | | | | | | | | | | | | | | ESC | |BEAUT| | ||
* |-----------------------------------------------------------------------------------------+ +-----+ | ||
* | | | | | | | |WHERE |HDRSRC| LIST | P | | | REF | |FLASH| | ||
* |-----------------------------------------------------------------------------------------+ +-----+ | ||
* | | | | | | | BACK | TABL | TABR | FWD | GOTO | | OPEN | | ||
* |--------------------------------------------------------------------------------------------+ | ||
* | | | | | | | | | | | | | | | ||
* +--------------------------------------------------------------------------------------------+-----+ | ||
* | | | | BUILD | | | | | | | | ||
* `--------------------------------------------------------------------------------------------------´ | ||
*/ | ||
[2] = LAYOUT( | ||
_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,ESC , BUILD, | ||
_______,_______,_______,_______,_______,_______,_______,WHERE ,HDRSRC ,LIST ,_______,_______,_______,REFACTOR, FLASH, | ||
_______,_______,_______,_______,_______,_______,BACK ,TABL ,TABR ,FWD ,GOTO ,_______,OPEN , | ||
_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, | ||
_______,_______,_______, _______, _______,_______,_______, _______,_______,_______ | ||
), | ||
/* Fn3 layer | ||
* ,--------------------------------------------------------------------------------------------------. | ||
* | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | | | | | ||
* |-----------------------------------------------------------------------------------------+ +-----+ | ||
* | | | | | | | | | | | | | | | | | | ||
* |-----------------------------------------------------------------------------------------+ +-----+ | ||
* | | | | | | | | | | | | | | | ||
* |--------------------------------------------------------------------------------------------+ | ||
* | | | | | | | | | | | | | | | ||
* +--------------------------------------------------------------------------------------------+-----+ | ||
* | | | | | | | | | | | | ||
* `--------------------------------------------------------------------------------------------------´ | ||
*/ | ||
[3] = LAYOUT( | ||
_______,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 ,KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,KC_F11 ,KC_F12 ,_______, _______, | ||
_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, | ||
_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, | ||
_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, | ||
_______,_______,_______, _______, _______,_______,_______, _______,_______,_______ | ||
) | ||
}; | ||
|
||
bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
switch(keycode) { | ||
case tmuxL: | ||
if (record->event.pressed) { | ||
SEND_STRING(SS_LCTRL("a")"p"); | ||
} | ||
break; | ||
case tmuxR: | ||
if (record->event.pressed) { | ||
SEND_STRING(SS_LCTRL("a")"n"); | ||
} | ||
break; | ||
case tmuxNew: | ||
if (record->event.pressed) { | ||
SEND_STRING(SS_LCTRL("a")"c"SS_LCTRL("a")","); | ||
} | ||
break; | ||
case tmuxKil: | ||
if (record->event.pressed) { | ||
SEND_STRING(SS_LCTRL("a")"x"); | ||
} | ||
break; | ||
case appSwitch: | ||
if (record->event.pressed) { | ||
SEND_STRING(SS_DOWN(X_LGUI)SS_TAP(X_TAB)); | ||
} else { | ||
SEND_STRING(SS_UP(X_LGUI)); | ||
} | ||
break; | ||
} | ||
return true; | ||
} | ||
|