aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--keyboards/kc60/keymaps/noroadsleft/keymap.c83
-rw-r--r--keyboards/kc60/keymaps/noroadsleft/readme.md2
-rw-r--r--keyboards/kc60/keymaps/noroadsleft/readme_ch1.md2
-rw-r--r--keyboards/kc60/keymaps/noroadsleft/readme_ch2.md2
-rw-r--r--keyboards/kc60/keymaps/noroadsleft/readme_ch3.md6
-rw-r--r--keyboards/kc60/keymaps/noroadsleft/readme_ch4.md4
-rw-r--r--keyboards/kc60/keymaps/noroadsleft/readme_ch5.md84
-rw-r--r--keyboards/kc60/keymaps/noroadsleft/readme_git.md62
8 files changed, 147 insertions, 98 deletions
diff --git a/keyboards/kc60/keymaps/noroadsleft/keymap.c b/keyboards/kc60/keymaps/noroadsleft/keymap.c
index f28f2144f..ee1f69e91 100644
--- a/keyboards/kc60/keymaps/noroadsleft/keymap.c
+++ b/keyboards/kc60/keymaps/noroadsleft/keymap.c
@@ -1,4 +1,5 @@
1#include QMK_KEYBOARD_H 1#include QMK_KEYBOARD_H
2#include "version.h"
2#include <sendstring_dvorak.h> 3#include <sendstring_dvorak.h>
3//#include <sendstring_colemak.h> 4//#include <sendstring_colemak.h>
4#include <print.h> 5#include <print.h>
@@ -84,19 +85,19 @@ enum custom_keycodes {
84 Q2_ESC, 85 Q2_ESC,
85 Q2_GRV, 86 Q2_GRV,
86 MC_UNDO, 87 MC_UNDO,
87 MC_PSTE 88 MC_PSTE,
89 NUBS_Z,
90 VRSN
88}; 91};
89 92
90 93
91// define modifiers 94/*******************
92#define MODS_SHIFT_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) 95** MODIFIER MASKS **
93#define MODS_CTRL_MASK (MOD_BIT(KC_LCTL)|MOD_BIT(KC_RCTRL)) 96*******************/
94#define MODS_ALT_MASK (MOD_BIT(KC_LALT)|MOD_BIT(KC_RALT)) 97#define MOD_MASK_RALT (MOD_BIT(KC_RALT))
95#define MODS_GUI_MASK (MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI))
96 98
97 99
98bool process_record_user(uint16_t keycode, keyrecord_t *record) { 100bool process_record_user(uint16_t keycode, keyrecord_t *record) {
99 uint8_t modifiers = get_mods();
100 switch(keycode) { 101 switch(keycode) {
101 // these are our macros! 102 // these are our macros!
102 case F_CAPS: 103 case F_CAPS:
@@ -118,60 +119,49 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
118 } 119 }
119 }; 120 };
120 return false; 121 return false;
121 break;
122 case T_L3DED: 122 case T_L3DED:
123 if (record->event.pressed) { 123 if (record->event.pressed) {
124 SEND_STRING("lavak3DED "); 124 SEND_STRING("lavak3DED ");
125 }; 125 };
126 return false; 126 return false;
127 break;
128 case G_PUSH: 127 case G_PUSH:
129 if (record->event.pressed) { 128 if (record->event.pressed) {
130 SEND_STRING("git push origin "); 129 SEND_STRING("git push origin ");
131 }; 130 };
132 return false; 131 return false;
133 break;
134 case G_FTCH: 132 case G_FTCH:
135 if (record->event.pressed) { 133 if (record->event.pressed) {
136 SEND_STRING("git fetch upstream"); 134 if ( get_mods() & MOD_MASK_SHIFT ) {
135 clear_mods();
136 SEND_STRING("git pull upstream ");
137 } else {
138 SEND_STRING("git fetch upstream ");
139 }
137 }; 140 };
138 return false; 141 return false;
139 break;
140 case G_COMM: 142 case G_COMM:
141 if (record->event.pressed) { 143 if (record->event.pressed) {
142 SEND_STRING("git commit -m \"\"" SS_TAP(X_LEFT)); 144 SEND_STRING("git commit -m \"\"" SS_TAP(X_LEFT));
143 layer_off(_MACROS); 145 layer_off(_MACROS);
144 }; 146 };
145 return false; 147 return false;
146 break;
147 case G_RST:
148 if (record->event.pressed) {
149 SEND_STRING("git histt -n 10" SS_TAP(X_ENTER) "git reset --soft ");
150 layer_off(_MACROS);
151 };
152 return false;
153 break;
154 case G_C10R:
155 if (record->event.pressed) {
156 SEND_STRING("cf/");
157 layer_off(_MACROS);
158 };
159 return false;
160 break;
161 case G_BRCH: 148 case G_BRCH:
162 if (record->event.pressed) { 149 if (record->event.pressed) {
163 SEND_STRING("$(git branch-name)"); 150 if ( get_mods() & MOD_MASK_SHIFT ) {
151 clear_mods();
152 SEND_STRING("master");
153 } else {
154 SEND_STRING("$(git branch-name)");
155 }
164 layer_off(_MACROS); 156 layer_off(_MACROS);
165 }; 157 };
166 return false; 158 return false;
167 break;
168 case SIGNA: 159 case SIGNA:
169 if (record->event.pressed) { 160 if (record->event.pressed) {
170 SEND_STRING("\\- @noroadsleft" SS_TAP(X_ENTER)); 161 SEND_STRING("\\- @noroadsleft" SS_TAP(X_ENTER));
171 layer_off(_MACROS); 162 layer_off(_MACROS);
172 }; 163 };
173 return false; 164 return false;
174 break;
175 case GO_Q2: 165 case GO_Q2:
176 if (record->event.pressed) { 166 if (record->event.pressed) {
177 //default_layer_set(_QWERTY); 167 //default_layer_set(_QWERTY);
@@ -180,7 +170,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
180 //layer_off(_SYSTEM); 170 //layer_off(_SYSTEM);
181 }; 171 };
182 return false; 172 return false;
183 break;
184 case Q2_ON: 173 case Q2_ON:
185 if (record->event.pressed) { 174 if (record->event.pressed) {
186 SEND_STRING(SS_TAP(X_ENTER)); 175 SEND_STRING(SS_TAP(X_ENTER));
@@ -188,7 +177,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
188 layer_on(_QUAKE2_DVORAK); 177 layer_on(_QUAKE2_DVORAK);
189 }; 178 };
190 return false; 179 return false;
191 break;
192 case Q2_OFF: 180 case Q2_OFF:
193 if (record->event.pressed) { 181 if (record->event.pressed) {
194 SEND_STRING(SS_TAP(X_ENTER)); 182 SEND_STRING(SS_TAP(X_ENTER));
@@ -196,7 +184,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
196 layer_on(_QUAKE2); 184 layer_on(_QUAKE2);
197 }; 185 };
198 return false; 186 return false;
199 break;
200 case Q2_ESC: 187 case Q2_ESC:
201 if (record->event.pressed) { 188 if (record->event.pressed) {
202 SEND_STRING(SS_TAP(X_ESCAPE)); 189 SEND_STRING(SS_TAP(X_ESCAPE));
@@ -204,7 +191,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
204 layer_on(_QUAKE2); 191 layer_on(_QUAKE2);
205 }; 192 };
206 return false; 193 return false;
207 break;
208 case Q2_GRV: 194 case Q2_GRV:
209 if (record->event.pressed) { 195 if (record->event.pressed) {
210 SEND_STRING(SS_TAP(X_GRAVE)); 196 SEND_STRING(SS_TAP(X_GRAVE));
@@ -213,27 +199,38 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
213 layer_on(_QUAKE2_CONSOLE); 199 layer_on(_QUAKE2_CONSOLE);
214 }; 200 };
215 return false; 201 return false;
216 break;
217 case MC_UNDO: 202 case MC_UNDO:
218 if (record->event.pressed) { 203 if (record->event.pressed) {
219 if ( modifiers & MODS_SHIFT_MASK ) { 204 if ( get_mods() & MOD_MASK_SHIFT ) {
220 SEND_STRING( SS_DOWN(X_LSHIFT) SS_DOWN(X_LGUI) SS_TAP(X_Z) SS_UP(X_LGUI) SS_UP(X_LSHIFT) ); 205 SEND_STRING( SS_DOWN(X_LSHIFT) SS_DOWN(X_LGUI) SS_TAP(X_Z) SS_UP(X_LGUI) SS_UP(X_LSHIFT) );
221 } else { 206 } else {
222 SEND_STRING( SS_DOWN(X_LGUI) SS_TAP(X_Z) SS_UP(X_LGUI) ); 207 SEND_STRING( SS_DOWN(X_LGUI) SS_TAP(X_Z) SS_UP(X_LGUI) );
223 } 208 }
224 }; 209 };
225 return false; 210 return false;
226 break;
227 case MC_PSTE: 211 case MC_PSTE:
228 if (record->event.pressed) { 212 if (record->event.pressed) {
229 if ( modifiers & MODS_SHIFT_MASK ) { 213 if ( get_mods() & MOD_MASK_SHIFT ) {
230 SEND_STRING( SS_DOWN(X_LSHIFT) SS_DOWN(X_LGUI) SS_DOWN(X_LALT) SS_TAP(X_V) SS_UP(X_LALT) SS_UP(X_LGUI) SS_UP(X_LSHIFT) ); 214 SEND_STRING( SS_DOWN(X_LSHIFT) SS_DOWN(X_LGUI) SS_DOWN(X_LALT) SS_TAP(X_V) SS_UP(X_LALT) SS_UP(X_LGUI) SS_UP(X_LSHIFT) );
231 } else { 215 } else {
232 SEND_STRING( SS_DOWN(X_LGUI) SS_TAP(X_V) SS_UP(X_LGUI) ); 216 SEND_STRING( SS_DOWN(X_LGUI) SS_TAP(X_V) SS_UP(X_LGUI) );
233 } 217 }
234 }; 218 };
235 return false; 219 return false;
236 break; 220 case NUBS_Z:
221 if (record->event.pressed) {
222 if ( get_mods() & MOD_MASK_RALT ) {
223 SEND_STRING( SS_TAP(X_NONUS_BSLASH) );
224 } else {
225 SEND_STRING( SS_TAP(X_Z) );
226 }
227 };
228 return false;
229 case VRSN:
230 if (record->event.pressed) {
231 SEND_STRING( QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION );
232 }
233 return false;
237 } // switch() 234 } // switch()
238 return true; 235 return true;
239}; 236};
@@ -252,7 +249,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
252 KC_GESC, 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, \ 249 KC_GESC, 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, \
253 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, \ 250 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, \
254 FW_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ 251 FW_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \
255 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ 252 KC_LSFT, NUBS_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \
256 KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(_FW), KC_RCTL \ 253 KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(_FW), KC_RCTL \
257 ), 254 ),
258 255
@@ -375,15 +372,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
375 // 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 372 // 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
376 TG(_MA), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ 373 TG(_MA), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
377 _______, _______, _______, G_PUSH, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ 374 _______, _______, _______, G_PUSH, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
378 _______, _______, G_RST, G_FTCH, G_COMM, _______, _______, _______, _______, T_L3DED, _______, _______, _______, \ 375 _______, _______, _______, G_FTCH, G_COMM, _______, _______, _______, _______, T_L3DED, _______, _______, _______, \
379 _______, _______, _______, G_C10R, _______, G_BRCH, SIGNA, _______, _______, _______, _______, _______, \ 376 _______, _______, _______, _______, _______, G_BRCH, SIGNA, _______, _______, _______, _______, _______, \
380 _______, _______, _______, _______, _______, _______, NO_CHNG, _______ \ 377 _______, _______, _______, _______, _______, _______, NO_CHNG, _______ \
381 ), 378 ),
382 379
383 /* System layer */ 380 /* System layer */
384 [_SYSTEM] = LAYOUT_60_ansi( 381 [_SYSTEM] = LAYOUT_60_ansi(
385 // 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 382 // 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
386 TG(_SY), TO(_QW), TO(_DV), TO(_CM), GO_Q2, XXXXXXX, XXXXXXX, XXXXXXX, RESET, XXXXXXX, DEBUG, XXXXXXX, XXXXXXX, XXXXXXX, \ 383 TG(_SY), TO(_QW), TO(_DV), TO(_CM), GO_Q2, XXXXXXX, XXXXXXX, XXXXXXX, RESET, XXXXXXX, DEBUG, XXXXXXX, VRSN, XXXXXXX, \
387 XXXXXXX, XXXXXXX, TG(_MC), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ 384 XXXXXXX, XXXXXXX, TG(_MC), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \
388 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ 385 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \
389 XXXXXXX, XXXXXXX, XXXXXXX, BL_DEC, BL_TOGG, BL_INC, BL_BRTG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ 386 XXXXXXX, XXXXXXX, XXXXXXX, BL_DEC, BL_TOGG, BL_INC, BL_BRTG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \
diff --git a/keyboards/kc60/keymaps/noroadsleft/readme.md b/keyboards/kc60/keymaps/noroadsleft/readme.md
index 737fdc06b..59fbfd246 100644
--- a/keyboards/kc60/keymaps/noroadsleft/readme.md
+++ b/keyboards/kc60/keymaps/noroadsleft/readme.md
@@ -1,6 +1,6 @@
1# @noroadsleft's KC60 keymap 1# @noroadsleft's KC60 keymap
2 2
3### Last updated: September 2, 2018, 1:03 PM UTC-0700 3### Last updated: February 14, 2019, 3:50 AM UTC-0800
4 4
5![](https://i.imgur.com/tzhXQYI.jpg) 5![](https://i.imgur.com/tzhXQYI.jpg)
6 6
diff --git a/keyboards/kc60/keymaps/noroadsleft/readme_ch1.md b/keyboards/kc60/keymaps/noroadsleft/readme_ch1.md
index bee0709f4..fff80760e 100644
--- a/keyboards/kc60/keymaps/noroadsleft/readme_ch1.md
+++ b/keyboards/kc60/keymaps/noroadsleft/readme_ch1.md
@@ -7,8 +7,6 @@
7 4. [Function Layers](./readme_ch4.md) 7 4. [Function Layers](./readme_ch4.md)
8 5. [Other Layers](./readme_ch5.md) 8 5. [Other Layers](./readme_ch5.md)
9 9
10### Last updated: September 2, 2018, 1:03 PM UTC-0700
11
12 10
13---- 11----
14 12
diff --git a/keyboards/kc60/keymaps/noroadsleft/readme_ch2.md b/keyboards/kc60/keymaps/noroadsleft/readme_ch2.md
index 75a4fc524..142fe302f 100644
--- a/keyboards/kc60/keymaps/noroadsleft/readme_ch2.md
+++ b/keyboards/kc60/keymaps/noroadsleft/readme_ch2.md
@@ -7,8 +7,6 @@
7 4. [Function Layers](./readme_ch4.md) 7 4. [Function Layers](./readme_ch4.md)
8 5. [Other Layers](./readme_ch5.md) 8 5. [Other Layers](./readme_ch5.md)
9 9
10### Last updated: September 2, 2018, 1:03 PM UTC-0700
11
12 10
13---- 11----
14 12
diff --git a/keyboards/kc60/keymaps/noroadsleft/readme_ch3.md b/keyboards/kc60/keymaps/noroadsleft/readme_ch3.md
index 80549ba5c..ebcb3cca8 100644
--- a/keyboards/kc60/keymaps/noroadsleft/readme_ch3.md
+++ b/keyboards/kc60/keymaps/noroadsleft/readme_ch3.md
@@ -7,8 +7,6 @@
7 4. [Function Layers](./readme_ch4.md) 7 4. [Function Layers](./readme_ch4.md)
8 5. [Other Layers](./readme_ch5.md) 8 5. [Other Layers](./readme_ch5.md)
9 9
10### Last updated: September 2, 2018, 1:03 PM UTC-0700
11
12 10
13---- 11----
14 12
@@ -18,9 +16,9 @@
18 16
19These layers were born out of the confusion I have had trying to use the in-game chat and the console in [Quake 2](https://en.wikipedia.org/wiki/Quake_II). When Quake 2 came out, alternate keyboard layouts weren't really a thing. As a result, all in-game text input is hard-locked to US QWERTY, regardless of what the operating system is using for its input method. 17These layers were born out of the confusion I have had trying to use the in-game chat and the console in [Quake 2](https://en.wikipedia.org/wiki/Quake_II). When Quake 2 came out, alternate keyboard layouts weren't really a thing. As a result, all in-game text input is hard-locked to US QWERTY, regardless of what the operating system is using for its input method.
20 18
21I'm attempting to solve this by some creative use of QMK's macro feature. The keycode in the System layer that enables these layers, [`GO_Q2`](./keymap.c#L386), is a [macro](./keymap.c#L175-183) that sets the default layer to the QWERTY layer, then turns the Quake 2 layer `_Q2` on. The result is a partially-overwritten QWERTY layer, that has some keycodes with some creative layer switching. 19I'm attempting to solve this by some creative use of QMK's macro feature. The keycode in the System layer that enables these layers, [`GO_Q2`](./keymap.c#L383), is a [macro](./keymap.c#L165-172) that sets the default layer to the QWERTY layer, then turns the Quake 2 layer `_Q2` on. The result is a partially-overwritten QWERTY layer, that has some keycodes with some creative layer switching.
22 20
23When I hit the `Enter` key (bound in-game to text chat), the [macro keycode](./keymap.c#L184-L191) I've created sends the keycode for `Enter`, then follows with enabling the Hardware Dvorak layer and its corresponding overlay. Now the game is in text chat mode, and my keyboard is in Dvorak. When I hit `Enter` again, another `Enter` [keycode macro](./keymap.c#L192-L199) is sent, which sends the message, then the macro brings me back to the standard QWERTY+Quake 2 setup. Hitting `Escape` instead runs a [macro](./keymap.c#L200-L207) that cancels the sending of the message, and undoes the layers. 21When I hit the `Enter` key (bound in-game to text chat), the [macro keycode](./keymap.c#L173-L179) I've created sends the keycode for `Enter`, then follows with enabling the Hardware Dvorak layer and its corresponding overlay. Now the game is in text chat mode, and my keyboard is in Dvorak. When I hit `Enter` again, another `Enter` [keycode macro](./keymap.c#L180-L186) is sent, which sends the message, then the macro brings me back to the standard QWERTY+Quake 2 setup. Hitting `Escape` instead runs a [macro](./keymap.c#L187-L193) that cancels the sending of the message, and undoes the layers.
24 22
25I have been testing this configuration for a few months. Sometimes I end up still in Dvorak mode without any text input systems (in-game chat or the console) running, but it pretty much always happens when I'm focused on the game, so I don't know the cause yet. 23I have been testing this configuration for a few months. Sometimes I end up still in Dvorak mode without any text input systems (in-game chat or the console) running, but it pretty much always happens when I'm focused on the game, so I don't know the cause yet.
26 24
diff --git a/keyboards/kc60/keymaps/noroadsleft/readme_ch4.md b/keyboards/kc60/keymaps/noroadsleft/readme_ch4.md
index f1b50846d..00e6b781b 100644
--- a/keyboards/kc60/keymaps/noroadsleft/readme_ch4.md
+++ b/keyboards/kc60/keymaps/noroadsleft/readme_ch4.md
@@ -7,8 +7,6 @@
7 4. **Function Layers** 7 4. **Function Layers**
8 5. [Other Layers](./readme_ch5.md) 8 5. [Other Layers](./readme_ch5.md)
9 9
10### Last updated: September 2, 2018, 1:03 PM UTC-0700
11
12 10
13---- 11----
14 12
@@ -44,7 +42,7 @@ Based on the Windows function layer, but removes some functions that are pointle
44 42
45Keycode(s) Sent | Notes 43Keycode(s) Sent | Notes
46:-------------------------------- | :---- 44:-------------------------------- | :----
47[`Q2_GRV`](./keymap.c#L208-L216) | Sends `KC_GRV`, then enables the Dvorak, Quake 2 Dvorak, and Quake 2 Console layers. 45[`Q2_GRV`](./keymap.c#L194-L201) | Sends `KC_GRV`, then enables the Dvorak, Quake 2 Dvorak, and Quake 2 Console layers.
48 46
49 47
50 48
diff --git a/keyboards/kc60/keymaps/noroadsleft/readme_ch5.md b/keyboards/kc60/keymaps/noroadsleft/readme_ch5.md
index 64102eb88..e5ee7cbde 100644
--- a/keyboards/kc60/keymaps/noroadsleft/readme_ch5.md
+++ b/keyboards/kc60/keymaps/noroadsleft/readme_ch5.md
@@ -7,8 +7,6 @@
7 4. [Function Layers](./readme_ch4.md) 7 4. [Function Layers](./readme_ch4.md)
8 5. **Other Layers** 8 5. **Other Layers**
9 9
10### Last updated: September 2, 2018, 1:03 PM UTC-0700
11
12 10
13---- 11----
14 12
@@ -36,37 +34,79 @@ Tapping `Esc` exits the Macro layer, if the macro used doesn't do it automatical
36 34
37### Macros 35### Macros
38 36
39[![lavak3DED](https://static-cdn.jtvnw.net/emoticons/v1/821796/1.0)](./keymap.c#L122-L127) 37#### [T_L3DED](./keymap.c#L122-L126)
40Inputs: `lavak3DED ` 38
41Twitch emote for [a streamer I watch a lot](https://www.twitch.tv/lavak3_). 39Output: `lavak3DED `
40
41Twitch emote for [a streamer I watch a lot](https://www.twitch.tv/lavak3_).
42![lavak3DED](https://static-cdn.jtvnw.net/emoticons/v1/821796/1.0)
43
44#### [G_PUSH](./keymap.c#L127-L131)
45
46Output: `git push origin `
42 47
43[G_PUSH](./keymap.c#L128-L133)
44Inputs: `git push origin `
45Everything from here down is related to Git or GitHub. 48Everything from here down is related to Git or GitHub.
46 49
47[G_FTCH](./keymap.c#L134-L139) 50#### [G_FTCH](./keymap.c#L132-L141)
48Inputs: `git fetch upstream` 51
52| Condition | Output |
53| :-------- | :----- |
54| If <kbd>Shift</kbd> is active | `git pull upstream ` |
55| Otherwise | `git fetch upstream ` |
56
57#### [G_COMM](./keymap.c#L142-L147)
58
59Output: `git commit -m ""` <kbd>Left</kbd>
49 60
50[G_COMM](./keymap.c#L140-L146)
51Inputs: `git commit -m ""` `[Left]`
52Readies a `git commit` command, moves the cursor between the quotation marks, then disables the Macro layer. 61Readies a `git commit` command, moves the cursor between the quotation marks, then disables the Macro layer.
53 62
54[G_RST](./keymap.c#L147-L153) 63#### [G_BRCH](./keymap.c#L148-158)
55Inputs: `git histt -n 10`, Enter, `git reset --soft ` 64
56Runs a [git alias](./readme_git.md) that shows my last ten commits, then readies a `git reset --soft`. For when I commit something too soon. Disables the Macro layer when complete. 65| Condition | Output |
66| :-------- | :----- |
67| If <kbd>Shift</kbd> is active | `master` |
68| Otherwise | `$(git branch-name)` |
57 69
58[G_C10R](./keymap.c#L154-L160) 70`$(git branch-name)` is a [git alias](./readme_git.md) that returns the name of the current branch. This macro disables the Macro layer when finished.
59Inputs: `cf/`
60A branch prefix I use for my current work in QMK. Disables the Macro layer when finished.
61 71
62[G_BRCH](./keymap.c#L161-L167) 72#### [SIGNA](./keymap.c#L159-L164)
63Inputs: `$(git branch-name)` 73
64A [git alias](./readme_git.md) that returns the name of the current branch. Disables the Macro layer when finished. 74Output: `\- @noroadsleft` <kbd>Enter</kbd>
65 75
66[SIGNA](./keymap.c#L168-L174)
67Inputs: `\- @noroadsleft` `[Enter]`
68Sometimes on GitHub, I sign my comments. Types my GitHub name in Markdown syntax, and then taps the `Enter` key. Disables the Macro layer when finished. 76Sometimes on GitHub, I sign my comments. Types my GitHub name in Markdown syntax, and then taps the `Enter` key. Disables the Macro layer when finished.
69 77
78#### [MC_UNDO](./keymap.c#L202-L210)
79
80| Condition | Output |
81| :-------- | :----- |
82| If <kbd>Shift</kbd> is active | <kbd>Shift</kbd> + <kbd>Command</kbd> + <kbd>Z</kbd> |
83| Otherwise | <kbd>Command</kbd> + <kbd>Z</kbd> |
84
85An Undo shortcut that turns to Redo if <kbd>Shift</kbd> is being held. I'm not sure that part is required to get that behavior, but it works as desired, so I'm not messing with it.
86
87#### [MC_PSTE](./keymap.c#L211-L219)
88
89| Condition | Output |
90| :-------- | :----- |
91| If <kbd>Shift</kbd> is active | <kbd>Shift</kbd> + <kbd>Command</kbd> + <kbd>Option</kbd> + <kbd>V</kbd> |
92| Otherwise | <kbd>Command</kbd> + <kbd>V</kbd> |
93
94The program I use this in uses <kbd>Shift</kbd> + <kbd>Command</kbd> + <kbd>Option</kbd> + <kbd>V</kbd> to paste while maintaining formatting (typeface, text size, etc.). Sometimes I want this and sometimes I don't. Using <kbd>Shift</kbd> changes the behavior.
95
96#### [NUBS_Z](./keymap.c#L220-L228)
97
98| Condition | Output |
99| :-------- | :----- |
100| If Right <kbd>Alt</kbd> is active | `KC_NUBS` |
101| Otherwise | `KC_Z` |
102
103Sometimes I type in languages from countries that use ISO layout, but my keyboard is ANSI, so I have one key fewer. This macro simulates the Non-US Backslash key if I use Right Alt + Z.
104
105#### [VRSN](./keymap.c#L229-L233)
106
107Outputs a string that tells me the Git commit from which my flashed firmware was built. Looks something like:
108
109 kc60/noroadsleft @ 0.6.240-20-ge91549-dirty
70 110
71---- 111----
72 112
diff --git a/keyboards/kc60/keymaps/noroadsleft/readme_git.md b/keyboards/kc60/keymaps/noroadsleft/readme_git.md
index 585d9c890..b81bb9409 100644
--- a/keyboards/kc60/keymaps/noroadsleft/readme_git.md
+++ b/keyboards/kc60/keymaps/noroadsleft/readme_git.md
@@ -4,46 +4,55 @@
4 4
5``` 5```
6[alias] 6[alias]
7 # change branches 7 # Change branches
8 co = checkout 8 co = checkout
9 cob = checkout -b 9 cob = checkout -b
10 10
11 # sync master 11 # Cherry Pick
12 sync = "!f() { if [ $(git branch-name) != "master" ]; then git checkout master; fi; git pull upstream master; git push origin master; }; f" 12 cp = cherry-pick
13
14 # Check out a Pull Request
15 cop = "!f() { git fetch upstream pull/$1/head:pr/$1; git checkout pr/$1; }; f"
16
17 # Sync master branch
18 sync = !git checkout master && git fetch upstream 2> /dev/null && git pull -n upstream master && git push origin master
19
20 # Return the abbreviated SHA-1 of the last three commits, oldest to newest
21 rl = rev-list -n 3 --abbrev-commit --reverse HEAD
22
23 # Add remote repo (for sending PRs to other forks, or checking out someone else's developments)
24 ar = "!f() { git remote add $1 https://github.com/$2/qmk_firmware.git; }; f"
13 25
14 # Return the last five commits on the branch, in a more compact format 26 # Return the last five commits on the branch, in a more compact format
15 hist = log --pretty=format:\"%C(yellow)%h%Creset %Cgreen%ad%Creset%n %w(100,0,3)%s%d [%an]%n\" --graph --date=iso-local -n 5 27 hist = log --pretty=format:\"%C(yellow)%h%Creset %Cgreen%ad%Creset %Cblue[%an%Cgreen% GK%Cblue]%C(yellow)%d%Creset%n %w(100,0,2)%s%n\" --graph --date=iso-local -n 5
16 histm = log --pretty=format:\"%C(yellow)%h%Creset %w(100,0,3)%s%d [%an]\" --graph --date=iso-local -n 5 28 histt = log --pretty=format:\"* %C(yellow)%h%Creset %<(58,trunc)%s %Cblue%>(18,trunc)%an%Cgreen% G?%Creset @ %Cgreen%ad%Creset\" --date=iso-local -n 5
17 histt = log --pretty=format:\"%C(yellow)%h%Creset %<(88,trunc)%s [%an]\" --graph --date=iso-local -n 5 29 histb = log --reverse --pretty=format:\"- %Cblue%>(20,trunc)%an %Creset%<(97,trunc)%s\" --date=iso-local -n 5
18 histb = log --reverse --pretty=format:\"- %<(98,trunc)%s [%an]\" --date=iso-local -n 5 30
31 # Follow a file's filename history
32 follow = log --follow --name-only --pretty=format:\"%C(yellow)commit %H%Creset%d\nAuthor: %an <%ae>\nDate: %ad%n%n %s%n\" --date=iso-local
19 33
20 # compact diff 34 # compact diff
21 df = "diff --compact-summary" 35 df = "diff --compact-summary"
22 36
37 # List all the files changed in a commit
38 dt = "diff-tree --no-commit-id --name-only -r"
39
23 # Short-form status 40 # Short-form status
24 st = "!git status --short" 41 st = "!git status --short --untracked-files=no"
25 42
26 # Returns the name of the current branch 43 # Returns the name of the current branch
27 branch-name = "!git rev-parse --abbrev-ref HEAD" 44 branch-name = "!git rev-parse --abbrev-ref HEAD"
45 bn = "!git branch-name" # short-form of the above
28 46
29 # short-form of the above 47 # Compare commit counts between current branch and QMK master
30 bn = "!git branch-name" 48 cc = "!f() { git fetch upstream; echo \"$(git branch-name) vs. upstream/master\"; git rev-list --left-right --count $(git branch-name)...upstream/master; }; f"
31 49
32 po = "push origin ($(git branch-name))" 50 # Push to origin repo
51 po = "push origin $(git branch-name)"
33 52
34 # List the stashes 53 # List the stashes
35 sl = "stash list" 54 sl = "stash list"
36 55
37 # Show the contents of a numbered stash
38 # Syntax:
39 # git st-show <int>
40 st-show = "!f() { git stash show stash@{$1} -p; }; f"
41
42 # Apply a stash, without deleting it from the list of stashes
43 # Syntax:
44 # git st-copy <int>
45 st-copy = "!f() { git stash apply stash@{$1}; }; f"
46
47 # Unstage a file 56 # Unstage a file
48 unstage = "reset HEAD" 57 unstage = "reset HEAD"
49 58
@@ -53,4 +62,15 @@
53 # Compare local master repo to its upstream branch. If anything is returned, local branch has diverged from upstream. 62 # Compare local master repo to its upstream branch. If anything is returned, local branch has diverged from upstream.
54 cm = "!f() { git fetch upstream master; git diff $(git branch-name) upstream/master --compact-summary; }; f" 63 cm = "!f() { git fetch upstream master; git diff $(git branch-name) upstream/master --compact-summary; }; f"
55 cml = "!f() { git fetch upstream master; git diff $(git branch-name) upstream/master; }; f" 64 cml = "!f() { git fetch upstream master; git diff $(git branch-name) upstream/master; }; f"
65
66 # Delete a branch from local and remote
67 del-branch = "!f() { git branch -d $1; git push origin :$1; git fetch -p origin; }; f"
68
69 # Rebase with signatures
70 rbv = rebase --exec 'git commit --amend --no-edit -n -S' -i
71
72 # Force push without overwriting established history
73 pushf = push --force-with-lease
74
75
56``` 76```