[Keymap] update dvorak_42_key keymaps for atreus and ergodox_ez: add VSCode shortcuts (#10054)

* remove obsolete cloud9 macros, add vscode macros on the KEYNAV layer

* add vscode layer and shortcuts

* remove duplicate VSCODE layer and macros

* apply review changes
This commit is contained in:
LucW 2020-08-20 09:38:52 +08:00 committed by GitHub
parent cdb69da86e
commit 0b894ca99c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 70 additions and 46 deletions

View File

@ -11,8 +11,11 @@
// aliases
// shell
#define SHELL_DEL_WORD RCTL(KC_W)
// android studio
// comment out to use android studio macros instead
#define USE_VSCODE_MACROS
// android studio shortcuts
#define AS_TABLEFT LALT(KC_LEFT)
#define AS_TABRIGHT LALT(KC_RIGHT)
#define AS_SYMBOL LCTL(LALT(KC_N))
@ -25,17 +28,49 @@
#define AS_CLOSETOOLWINDOW LCTL(LSFT(KC_F4))
#define AS_ALTENTER LALT(KC_ENTER)
// visual studio code shortcuts
#define VS_FILE LCTL(KC_P)
#define VS_LINE LCTL(KC_G)
#define VS_SYMBOLEDITOR LCTL(LSFT(KC_O))
#define VS_DEFINITION KC_F12
#define VS_IMPLEMENTATION LCTL(KC_F12)
#define VS_REFERENCES LSFT(KC_F12)
#define VS_BACK LALT(KC_LEFT)
#define VS_BRACKET LCTL(LSFT(KC_BSLS))
#define VS_TABLEFT LCTL(KC_PGUP)
#define VS_TABRIGHT LCTL(KC_PGDN)
#define VS_CLOSETAB LCTL(KC_W)
#define VS_CLOSEPANEL LCTL(LSFT(KC_W))
#define VS_TERMINAL LCTL(KC_GRAVE)
#define VS_BUILD LCTL(LSFT(KC_B))
#define VS_COMMANDS LCTL(LSFT(KC_P))
#define VS_CMT_BLOCK LSFT(LALT(KC_A))
#define VS_CMT_LINE LCTL(KC_SLSH)
#define VS_DEL_LINE LCTL(LSFT(KC_K))
#define VS_COPYLINEDOWN LSFT(LALT(KC_DOWN))
// visual studio bookmark commands
#define VS_BM_LIST LCTL(LALT(KC_L))
#define VS_BM_LISTALL LCTL(LALT(KC_A))
#define VS_BM_PREV LCTL(LALT(KC_P))
#define VS_BM_NEXT LCTL(LALT(KC_N))
#define VS_BM_TOGGLE LCTL(LALT(KC_K))
#define VS_BM_LABEL LCTL(LALT(KC_B))
/*
// VS code bookmark prev/next requires the following in vscode shortcuts config
{
"key": "ctrl+alt+p",
"command": "bookmarks.jumpToPrevious"
},
{
"key": "ctrl+alt+n",
"command": "bookmarks.jumpToNext"
},
*/
enum custom_keycodes {
PLACEHOLDER = SAFE_RANGE, // can always be here
// Cloud9 macros
CLOUD9_TAB_LEFT,
CLOUD9_TAB_RIGHT,
CLOUD9_TAB_CLOSE,
CLOUD9_GOTO_SYMBOL,
CLOUD9_GOTO_LINE,
CLOUD9_NAVIGATE,
// Windows 10 macros
W10_TASKVIEW,
W10_WORKSPACE_LEFT,
@ -43,9 +78,8 @@ enum custom_keycodes {
};
// building instructions:
// make atreus:dvorak_42_key
// building/flashing instructions:
// make atreus/astar:dvorak_42_key:flash
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[BASE] = LAYOUT(
@ -55,12 +89,23 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
OSM(MOD_LSFT), OSM(MOD_LCTL), MO(KEYSEL), MO(BROWSER_CONTROL), MO(COMBINED), MO(KEYNAV), KC_ENTER, KC_SPACE, KC_BSPC, RCTL(KC_BSPC), KC_CAPSLOCK, OSM(MOD_LSFT)
),
#ifdef USE_VSCODE_MACROS
// use visual studio code macros on the KEYNAV layer
[KEYNAV] = LAYOUT(
KC_ESC, VS_DEFINITION, RCTL(KC_Z), RCTL(KC_S), MEH(KC_A), MEH(KC_B), KC_HOME, KC_UP, KC_END, KC_PGUP,
VS_BACK, VS_SYMBOLEDITOR, RSFT(KC_TAB), KC_TAB, SHELL_DEL_WORD, LCTL(KC_LEFT), KC_LEFT, KC_DOWN, KC_RIGHT, LCTL(KC_RIGHT),
VS_LINE, VS_FILE, VS_TABLEFT, VS_TABRIGHT, VS_CLOSETAB, KC_TRNS, RCTL(KC_C), RCTL(KC_X), RCTL(KC_V), KC_PGDOWN,
VS_COMMANDS, VS_CMT_LINE, VS_BM_PREV, VS_BM_NEXT, VS_BM_TOGGLE, KC_TRNS, KC_ENTER, KC_SPACE, KC_BSPC, RCTL(KC_BSPC), KC_DELETE, LCTL(KC_DELETE)
),
#else
// use android studio macros on the KEYNAV layer
[KEYNAV] = LAYOUT(
KC_ESC, AS_GO_IMPLEMENTATION, RCTL(KC_Z), RCTL(KC_S), MEH(KC_A), MEH(KC_B), KC_HOME, KC_UP, KC_END, KC_PGUP,
AS_BACK, AS_SYMBOL, RSFT(KC_TAB), KC_TAB, SHELL_DEL_WORD, LCTL(KC_LEFT), KC_LEFT, KC_DOWN, KC_RIGHT, LCTL(KC_RIGHT),
AS_FINDUSAGE, AS_CLASS, AS_TABLEFT, AS_TABRIGHT, AS_CLOSETAB, KC_TRNS, RCTL(KC_C), RCTL(KC_X), RCTL(KC_V), KC_PGDOWN,
AS_CLOSETOOLWINDOW, AS_GO_DECLARATION, KC_TRNS, KC_TRNS, AS_ALTENTER, KC_TRNS, KC_ENTER, KC_SPACE, KC_BSPC, RCTL(KC_BSPC), KC_DELETE, LCTL(KC_DELETE)
),
#endif
[KEYSEL] = LAYOUT(
MEH(KC_G), MEH(KC_H),MEH(KC_I), MEH(KC_J), MEH(KC_K), KC_TRNS, RSFT(KC_HOME), RSFT(KC_UP), RSFT(KC_END), RSFT(KC_PGUP),
@ -87,31 +132,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if(record->event.pressed) {
switch (keycode) {
// Cloud9 macros
case CLOUD9_TAB_LEFT:
SEND_STRING(SS_LCTRL("["));
return true;
break;
case CLOUD9_TAB_RIGHT:
SEND_STRING(SS_LCTRL("]"));
return true;
break;
case CLOUD9_TAB_CLOSE:
SEND_STRING(SS_LALT("w"));
return true;
break;
case CLOUD9_GOTO_SYMBOL:
SEND_STRING(SS_LSFT(SS_LCTRL("e")));
return true;
break;
case CLOUD9_GOTO_LINE:
SEND_STRING(SS_LCTRL("g"));
return true;
break;
case CLOUD9_NAVIGATE:
SEND_STRING(SS_LCTRL("e"));
return true;
break;
// windows 10 workspace shortcuts
case W10_TASKVIEW:
tap_code16(G(KC_TAB));
return true;

View File

@ -109,6 +109,9 @@ enum custom_keycodes {
#define AS_GO_IMPLEMENTATION LCTL(LALT(KC_B))
#define AS_CLOSETAB LCTL(KC_F4)
#define AS_CLOSETOOLWINDOW LCTL(LSFT(KC_F4))
#define AS_COPYLINEDOWN LCTL(KC_D)
#define AS_DEL_LINE LCTL(KC_Y)
#define AS_LINE LCTL(KC_G)
// visual studio code shortcuts
#define VS_FILE LCTL(KC_P)
@ -185,7 +188,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[BASE] = LAYOUT_ergodox(
// left hand
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6,
OSL(SCREEN_NAV), KC_QUOTE, KC_COMMA, KC_DOT, KC_P, KC_Y, MEH(KC_2),
OSL(SCREEN_NAV), KC_QUOTE, KC_COMMA, KC_DOT, KC_P, KC_Y, MO(ANDROID_STUDIO),
OSL(SHELL_NAV), KC_A, KC_O, KC_E, KC_U, KC_I,
OSL(SHELL_SCREEN), KC_SCOLON, KC_Q, KC_J, KC_K, KC_X, MO(VSCODE),
MEH(KC_1), OSM(MOD_LSFT), OSM(MOD_LCTL), MO(KEYSEL), MO(BROWSER_CONTROL),
@ -351,7 +354,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_TRNS,KC_TRNS,KC_TRNS,
// right hand
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, AS_FINDUSAGE, AS_GO_DECLARATION, AS_GO_IMPLEMENTATION, KC_TRNS,
KC_TRNS, AS_COPYLINEDOWN, AS_FINDUSAGE, AS_GO_DECLARATION, AS_GO_IMPLEMENTATION, AS_LINE, KC_TRNS,
AS_CLOSETAB, AS_TABLEFT, AS_TABRIGHT, AS_SYMBOL, AS_CLASS, AS_BACK,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, AS_CLOSETOOLWINDOW, KC_TRNS,
// bottom row
@ -359,7 +362,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
// thumb cluster
KC_TRNS, KC_TRNS,
KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS
KC_TRNS, AS_DEL_LINE, KC_TRNS
),
// vscode shortcuts shortcuts