You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

126 lines
3.4 KiB

  1. /* Copyright 2020
  2. Sergi Meseguer <zigotica@gmail.com>
  3. This program is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation, either version 2 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>.
  13. */
  14. #include "zigotica.h"
  15. // Custom Keycodes
  16. #define MODE_1 TO(_TERMINAL)
  17. #define MODE_2 TO(_FIGMA)
  18. #define MODE_3 TO(_BROWSER)
  19. #define MODE_4 TO(_VIM)
  20. enum custom_keycodes {
  21. VIM_SIP = SAFE_RANGE
  22. };
  23. bool process_record_user(uint16_t keycode, keyrecord_t *record) {
  24. switch (keycode) {
  25. case VIM_SIP:
  26. if (record->event.pressed) {
  27. register_code(KC_ESC);
  28. SEND_STRING(":Ag ");
  29. } else {
  30. // released
  31. unregister_code(KC_ESC);
  32. }
  33. break;
  34. }
  35. return true;
  36. };
  37. const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  38. /*
  39. * TERMINAL Layer
  40. *
  41. * ,-----------------------------.
  42. * | | TERM | FIGM | |
  43. * |-------+------+------+-------|
  44. * | VOL | BROW | VIM | SCROLL|
  45. * |-------+------+------+-------|
  46. * |-------+-------+-------|
  47. * | MEDIA | o | o |
  48. * |-------+-------+-------|
  49. * | o | o | o |
  50. * |-------+-------+-------|
  51. */
  52. [_TERMINAL] = LAYOUT(
  53. MODE_1, MODE_2,
  54. ZK_MEDIA, MODE_3, MODE_4, _______,
  55. _______, _______, _______,
  56. _______, _______, _______
  57. ),
  58. /*
  59. * VIM Layer
  60. *
  61. * ,-----------------------------.
  62. * | | TERM | FIGM | |
  63. * |-------+------+------+-------|
  64. * |BUFFER | BROW | VIM | SCROLL|
  65. * |-------+------+------+-------|
  66. * |-------+-------+-------|
  67. * |SEARCH | o | o |
  68. * |-------+-------+-------|
  69. * | o | o | o |
  70. * |-------+-------+-------|
  71. */
  72. [_VIM] = LAYOUT(
  73. _______, _______,
  74. _______, _______, _______, _______,
  75. VIM_SIP, _______, _______,
  76. _______, _______, _______
  77. ),
  78. /*
  79. * FIGMA Layer
  80. *
  81. * ,-----------------------------.
  82. * | | TERM | FIGM | |
  83. * |-------+------+------+-------|
  84. * | VOL | BROW | VIM | ZOOM |
  85. * |-------+------+------+-------|
  86. * |-------+-------+-------|
  87. * | ZOOM | GRIDS | FULL |
  88. * |-------+-------+-------|
  89. * | o | o | o |
  90. * |-------+-------+-------|
  91. */
  92. [_FIGMA] = LAYOUT(
  93. _______, _______,
  94. _______, _______, _______, _______,
  95. LSFT(KC_1), LCTL(KC_G), LGUI(KC_BSLS),
  96. _______, _______, _______
  97. ),
  98. /*
  99. * BROWSER Layer
  100. *
  101. * ,-----------------------------.
  102. * | | TERM | FIGM | |
  103. * |-------+------+------+-------|
  104. * | TABS | BROW | VIM | SCROLL|
  105. * |-------+------+------+-------|
  106. * |-------+-------+-------|
  107. * |SEARCH | BOOKM | DEVTL |
  108. * |-------+-------+-------|
  109. * | o | o | o |
  110. * |-------+-------+-------|
  111. */
  112. [_BROWSER] = LAYOUT(
  113. _______, _______,
  114. _______, _______, _______, _______,
  115. G(KC_F), G(KC_D), G(A(KC_I)),
  116. _______, _______, _______
  117. ),
  118. };