diff options
author | LucW <luc.wastiaux@xsmail.com> | 2020-08-20 09:38:52 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-19 18:38:52 -0700 |
commit | 0b894ca99c4b4556f386afb7badd6f04b715d086 (patch) | |
tree | 9e30f170cdf4ea0ed0ae38b9d17280e94e780814 /keyboards/atreus/keymaps | |
parent | cdb69da86e482cba7f7980cba946a5409215fe62 (diff) |
[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
Diffstat (limited to 'keyboards/atreus/keymaps')
-rw-r--r-- | keyboards/atreus/keymaps/dvorak_42_key/keymap.c | 99 |
1 files changed, 60 insertions, 39 deletions
diff --git a/keyboards/atreus/keymaps/dvorak_42_key/keymap.c b/keyboards/atreus/keymaps/dvorak_42_key/keymap.c index 3f76949449..0c9ab59a92 100644 --- a/keyboards/atreus/keymaps/dvorak_42_key/keymap.c +++ b/keyboards/atreus/keymaps/dvorak_42_key/keymap.c @@ -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,34 +132,10 @@ 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; + return true; break; case W10_WORKSPACE_LEFT: tap_code16(G(C(KC_LEFT))); @@ -122,7 +143,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { break; case W10_WORKSPACE_RIGHT: tap_code16(G(C(KC_RIGHT))); - break; + break; } } |