diff options
author | Drashna Jaelre <drashna@live.com> | 2019-04-09 08:57:19 -0700 |
---|---|---|
committer | Drashna Jaelre <drashna@live.com> | 2019-04-09 08:57:19 -0700 |
commit | 6baec0fffdc1e48d228dfc0a73b98a4ecf6d4caf (patch) | |
tree | eff7483e3e82b9dcb249c03ec2bb457e58df04df /users/xtonhasvim | |
parent | 23a52e40b384199b1146f534aac1c3b83fcaa993 (diff) |
Remove Userspace folders
Diffstat (limited to 'users/xtonhasvim')
-rw-r--r-- | users/xtonhasvim/fancylighting.c | 172 | ||||
-rw-r--r-- | users/xtonhasvim/fancylighting.h | 36 | ||||
-rw-r--r-- | users/xtonhasvim/readme.md | 10 | ||||
-rw-r--r-- | users/xtonhasvim/rules.mk | 2 | ||||
-rw-r--r-- | users/xtonhasvim/xtonhasvim.c | 643 | ||||
-rw-r--r-- | users/xtonhasvim/xtonhasvim.h | 65 |
6 files changed, 0 insertions, 928 deletions
diff --git a/users/xtonhasvim/fancylighting.c b/users/xtonhasvim/fancylighting.c deleted file mode 100644 index a88ca4beb3..0000000000 --- a/users/xtonhasvim/fancylighting.c +++ /dev/null @@ -1,172 +0,0 @@ - /* Copyright 2015-2017 Christon DeWan - * - * 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/>. - */ - -#ifdef RGBLIGHT_ENABLE - -#include <math.h> - -#include "rgblight.h" -#include "color.h" -#include "fancylighting.h" - - -__attribute__ ((weak)) -void matrix_scan_keymap(void) { - // override me, if you want. - return; -} - -#define ABSDIFF(a,b) ((a)>(b)?(a)-(b):(b)-(a)) - -#define FADE_BACK_TIME 500 -#define BREATH_FIRE_TIME 1000 -#define ANIMATION_STEP_INTERVAL 20 - -#if RGBLED_NUM >= 2 -#define POWER_KEY_OFFSET (RGBLED_NUM / 2) -#define SPACE_OFFSET_MAX (RGBLED_NUM / 2) -#else -#define POWER_KEY_OFFSET 1 -#define SPACE_OFFSET_MAX 1 -#endif - -uint16_t effect_start_timer = 0; -uint8_t user_rgb_mode = 0; -LED_TYPE shadowed_led[RGBLED_NUM] = {{0}}; - -void start_firey_return(void) { - user_rgb_mode = BREATH_FIRE; - effect_start_timer = timer_read(); - for(uint8_t i = 0; i < RGBLED_NUM; i++) { - shadowed_led[i] = led[i]; - } -} - -/** 0---max - * [___] - * [__/] - * [_/\] - * [/\_] - * [\__] - * [___] - **/ - -void set_color_for_offsets(uint16_t time_offset, uint16_t space_offset, uint8_t idx) { - float time_progress = (float)time_offset / BREATH_FIRE_TIME; - float space_progress = (float)space_offset / SPACE_OFFSET_MAX; - float progress = time_progress * 5.0 - space_progress; - if(progress > 1.0) { - progress -= 1.0; - progress /= 4.0; - progress = 1.0 - progress; - } - progress = fmax(0.0,progress); - progress *= progress; // squared! - - float alpha = (time_progress + 0.1) * 7.0 - space_progress; - alpha = fmin(1.0, alpha*alpha); - - LED_TYPE px[1] = {{0}}; - sethsv((uint16_t)(fmod(time_progress * 1.5 + space_progress,1.0)*360), 255, (uint8_t)(progress*255),&px[0]); - led[idx].r = alpha * px[0].r + ( 1.0 - alpha) * shadowed_led[idx].r; - led[idx].g = alpha * px[0].g + ( 1.0 - alpha) * shadowed_led[idx].g; - led[idx].b = alpha * px[0].b + ( 1.0 - alpha) * shadowed_led[idx].b; -} - -/** - * It's actually a rainbow: a fire curve didn't really look right. - * it's still cool, though! - */ -void rgb_mode_breath_fire(void) { - static uint16_t last_timer = 0; - if(!last_timer) last_timer = timer_read(); - uint16_t this_timer = timer_read(); - - // too soon. don't spam updates - if(this_timer - last_timer < ANIMATION_STEP_INTERVAL) return; - - uint16_t elapsed = this_timer - effect_start_timer; - - last_timer = this_timer; - if(elapsed >= BREATH_FIRE_TIME) { - // complete - user_rgb_mode = FADE_BACK; - effect_start_timer = this_timer; - } else { - // linear fade - for(uint16_t i = 0; i < RGBLED_NUM; i++) { - uint16_t space_offset = ABSDIFF(i,POWER_KEY_OFFSET); - if(space_offset > SPACE_OFFSET_MAX) space_offset = RGBLED_NUM - space_offset; - - set_color_for_offsets(elapsed, space_offset, i); - } - rgblight_set(); - } -} - -void rgb_mode_fade_back(void) { - static uint16_t last_timer = 0; - if(!last_timer) last_timer = timer_read(); - uint16_t this_timer = timer_read(); - - // too soon. don't spam updates - if(this_timer - last_timer < ANIMATION_STEP_INTERVAL) return; - - uint16_t elapsed = this_timer - effect_start_timer; - - last_timer = this_timer; - float progress = (float)elapsed / FADE_BACK_TIME; - progress = fmin(1.0,progress); - - for(uint8_t i = 0; i < RGBLED_NUM; i++) { - led[i].r = shadowed_led[i].r * progress; - led[i].g = shadowed_led[i].g * progress; - led[i].b = shadowed_led[i].b * progress; - } - rgblight_set(); - - if(elapsed >= FADE_BACK_TIME) user_rgb_mode = 0; -} - -/** called when layer state or vstate has changed */ -__attribute__ ((weak)) -void set_state_leds(void) { - return; -} - -void matrix_scan_user(void) { - static uint32_t last_layer = 0; - static uint32_t last_vstate = 0; - if(last_layer != layer_state || last_vstate != vstate) set_state_leds(); - last_layer = layer_state; - last_vstate = vstate; - - switch (user_rgb_mode) { - case BREATH_FIRE: - rgb_mode_breath_fire(); - break; - case FADE_BACK: - rgb_mode_fade_back(); - break; - } - matrix_scan_keymap(); -} - -#else - -void start_firey_return(void) {} - -#endif diff --git a/users/xtonhasvim/fancylighting.h b/users/xtonhasvim/fancylighting.h deleted file mode 100644 index 02fb58b84a..0000000000 --- a/users/xtonhasvim/fancylighting.h +++ /dev/null @@ -1,36 +0,0 @@ -/* Copyright 2015-2017 Christon DeWan - * - * 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/>. - */ - -#ifndef _fancy_lighting_h -#define _fancy_lighting_h -#ifdef RGBLIGHT_ENABLE - -#include "xtonhasvim.h" - - -extern uint8_t user_rgb_mode; -extern LED_TYPE shadowed_led[]; - - -#endif //RGBLIGHT_ENABLE -void start_firey_return(void); - -enum xtonhasvim_rgbmodes { - BREATH_FIRE = 1, - FADE_BACK -}; - -#endif //_fancy_lighting_h diff --git a/users/xtonhasvim/readme.md b/users/xtonhasvim/readme.md deleted file mode 100644 index e08e972f4d..0000000000 --- a/users/xtonhasvim/readme.md +++ /dev/null @@ -1,10 +0,0 @@ - -# Xton has Vim! - -Contains common code for Xton's vim emulation (vimulation?) layer. - -Inspired/stolen from the `ergodox_ez/vim` keymap. Rewritten to be a more straightforward state machine and support more macros. Vim layers `_CMD` and `_EDIT` are designed to lay on top of an otherwise fully-functional layout. `_CMD` runs the entire vim state machine while `_EDIT` should lay across your base layer and mask off just the escape key. - -Works via OSX text editing shortcuts, mainly MOD+arrow combinations. This has some limitations and only works on OSX. - -The `_CMD` layer will temporarily disable itself while *CMD* or *ALT* are held down so that typical OSX shortcuts can be used without switching out of vim mode. diff --git a/users/xtonhasvim/rules.mk b/users/xtonhasvim/rules.mk deleted file mode 100644 index a901bfcf67..0000000000 --- a/users/xtonhasvim/rules.mk +++ /dev/null @@ -1,2 +0,0 @@ -SRC += xtonhasvim.c -SRC += fancylighting.c diff --git a/users/xtonhasvim/xtonhasvim.c b/users/xtonhasvim/xtonhasvim.c deleted file mode 100644 index 5f6701830f..0000000000 --- a/users/xtonhasvim/xtonhasvim.c +++ /dev/null @@ -1,643 +0,0 @@ - /* Copyright 2015-2017 Christon DeWan - * - * 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/>. - */ - -#include "xtonhasvim.h" -#include "fancylighting.h" - -/************************************ - * helper foo - ************************************/ - -#define PRESS(kc) register_code(kc) -#define RELEASE(kc) unregister_code(kc) - -static void TAP(uint16_t keycode) { - PRESS(keycode); - RELEASE(keycode); -} - -static void CMD(uint16_t keycode) { - PRESS(KC_LGUI); - TAP(keycode); - RELEASE(KC_LGUI); -} - -static void CTRL(uint16_t keycode) { - PRESS(KC_LCTRL); - TAP(keycode); - RELEASE(KC_LCTRL); -} - -static void SHIFT(uint16_t keycode) { - PRESS(KC_LSHIFT); - TAP(keycode); - RELEASE(KC_LSHIFT); -} - -static void ALT(uint16_t keycode) { - PRESS(KC_LALT); - TAP(keycode); - RELEASE(KC_LALT); -} - - -uint16_t vstate = VIM_START; -static bool yank_was_lines = false; -static bool SHIFTED = false; -static uint32_t mod_override_layer_state = 0; -static uint16_t mod_override_triggering_key = 0; - -static void edit(void) { vstate = VIM_START; layer_clear(); } -#define EDIT edit() - - -static void simple_movement(uint16_t keycode) { - switch(keycode) { - case VIM_B: - PRESS(KC_LALT); - SHIFT(KC_LEFT); // select to start of this word - RELEASE(KC_LALT); - break; - case VIM_E: - PRESS(KC_LALT); - SHIFT(KC_RIGHT); // select to end of this word - RELEASE(KC_LALT); - break; - case VIM_H: - SHIFT(KC_LEFT); - break; - case VIM_J: - CMD(KC_LEFT); - SHIFT(KC_DOWN); - SHIFT(KC_DOWN); - break; - case VIM_K: - CMD(KC_LEFT); - TAP(KC_DOWN); - SHIFT(KC_UP); - SHIFT(KC_UP); - break; - case VIM_L: - SHIFT(KC_RIGHT); - break; - case VIM_W: - PRESS(KC_LALT); - SHIFT(KC_RIGHT); // select to end of this word - SHIFT(KC_RIGHT); // select to end of next word - SHIFT(KC_LEFT); // select to start of next word - RELEASE(KC_LALT); - break; - } -} - -static void comma_period(uint16_t keycode) { - switch (keycode) { - case VIM_COMMA: - if (SHIFTED) { - // indent - CMD(KC_LBRACKET); - } else { - // toggle comment - CMD(KC_SLASH); - } - break; - case VIM_PERIOD: - if (SHIFTED) { - // outdent - CMD(KC_RBRACKET); - } - break; - } -} - -__attribute__ ((weak)) -bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { - return true; -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - /* keymap gets first whack */ - if(!process_record_keymap(keycode, record)) return false; - - /****** FIREY_RETURN *****/ - if(record->event.pressed && keycode == FIREY_RETURN) { - start_firey_return(); - TAP(KC_ENT); - } - - /****** mod passthru *****/ - if(record->event.pressed && layer_state_is(vim_cmd_layer()) && (IS_MOD(keycode) || keycode == LSFT(KC_LALT))) { - mod_override_layer_state = layer_state; - mod_override_triggering_key = keycode; - // TODO: change this to track key location instead - layer_clear(); - return true; // let the event fall through... - } - if(mod_override_layer_state && !record->event.pressed && keycode == mod_override_triggering_key) { - layer_state_set(mod_override_layer_state); - mod_override_layer_state = 0; - mod_override_triggering_key = 0; - return true; - } - - if (VIM_START <= keycode && keycode <= VIM_ESC) { - if(keycode == VIM_SHIFT) { - SHIFTED = record->event.pressed; - return false; - } - - if (record->event.pressed) { - if(keycode == VIM_START) { - // entry from anywhere - layer_on(vim_cmd_layer()); - vstate = VIM_START; - - // reset state - yank_was_lines = false; - SHIFTED = false; - mod_override_layer_state = 0; - mod_override_triggering_key = 0; - - return false; - } - switch(vstate) { - case VIM_START: - switch(keycode){ - /***************************** - * ground state - *****************************/ - case VIM_A: - if(SHIFTED) { - // CMD(KC_RIGHT); - CTRL(KC_E); - } else { - TAP(KC_RIGHT); - } - EDIT; - break; - case VIM_B: - PRESS(KC_LALT); - PRESS(KC_LEFT); - break; - case VIM_C: - if(SHIFTED) { - PRESS(KC_LSHIFT); - CMD(KC_RIGHT); - RELEASE(KC_LSHIFT); - CMD(KC_X); - yank_was_lines = false; - EDIT; - } else { - vstate = VIM_C; - } - break; - case VIM_D: - if(SHIFTED) { - CTRL(KC_K); - } else { - vstate = VIM_D; - } - break; - case VIM_E: - PRESS(KC_LALT); - PRESS(KC_RIGHT); - break; - case VIM_G: - if(SHIFTED) { - TAP(KC_END); - } else { - vstate = VIM_G; - } - break; - case VIM_H: - PRESS(KC_LEFT); - break; - case VIM_I: - if(SHIFTED){ - CTRL(KC_A); - } - EDIT; - break; - case VIM_J: - if(SHIFTED) { - CMD(KC_RIGHT); - TAP(KC_DEL); - } else { - PRESS(KC_DOWN); - } - break; - case VIM_K: - PRESS(KC_UP); - break; - case VIM_L: - PRESS(KC_RIGHT); - break; - case VIM_O: - if(SHIFTED) { - CMD(KC_LEFT); - TAP(KC_ENTER); - TAP(KC_UP); - EDIT; - } else { - CMD(KC_RIGHT); - TAP(KC_ENTER); - EDIT; - } - break; - case VIM_P: - if(SHIFTED) { - CMD(KC_LEFT); - CMD(KC_V); - } else { - if(yank_was_lines) { - CMD(KC_RIGHT); - TAP(KC_RIGHT); - CMD(KC_V); - } else { - CMD(KC_V); - } - } - break; - case VIM_S: - // s for substitute? - if(SHIFTED) { - CMD(KC_LEFT); - PRESS(KC_LSHIFT); - CMD(KC_RIGHT); - RELEASE(KC_LSHIFT); - CMD(KC_X); - yank_was_lines = false; - EDIT; - } else { - SHIFT(KC_RIGHT); - CMD(KC_X); - yank_was_lines = false; - EDIT; - } - break; - case VIM_U: - if(SHIFTED) { - PRESS(KC_LSFT); - CMD(KC_Z); - RELEASE(KC_LSHIFT); - } else { - CMD(KC_Z); - } - break; - case VIM_V: - if(SHIFTED) { - CMD(KC_LEFT); - SHIFT(KC_DOWN); - vstate = VIM_VS; - } else { - vstate = VIM_V; - } - break; - case VIM_W: - PRESS(KC_LALT); - TAP(KC_RIGHT); - TAP(KC_RIGHT); - TAP(KC_LEFT); - RELEASE(KC_LALT); - break; - case VIM_X: - // SHIFT(KC_RIGHT); - // CMD(KC_X); - PRESS(KC_DEL); - break; - case VIM_Y: - if(SHIFTED) { - CMD(KC_LEFT); - SHIFT(KC_DOWN); - CMD(KC_C); - TAP(KC_RIGHT); - yank_was_lines = true; - } else { - vstate = VIM_Y; - } - break; - case VIM_COMMA: - case VIM_PERIOD: - comma_period(keycode); - break; - } - break; - case VIM_C: - /***************************** - * c- ...for change. I never use this... - *****************************/ - switch(keycode) { - case VIM_B: - case VIM_E: - case VIM_H: - case VIM_J: - case VIM_K: - case VIM_L: - case VIM_W: - simple_movement(keycode); - CMD(KC_X); - yank_was_lines = false; - EDIT; - break; - - case VIM_C: - CMD(KC_LEFT); - PRESS(KC_LSHIFT); - CMD(KC_RIGHT); - RELEASE(KC_LSHIFT); - CMD(KC_X); - yank_was_lines = false; - EDIT; - break; - case VIM_I: - vstate = VIM_CI; - break; - default: - vstate = VIM_START; - break; - } - break; - case VIM_CI: - /***************************** - * ci- ...change inner word - *****************************/ - switch(keycode) { - case VIM_W: - ALT(KC_LEFT); - PRESS(KC_LSHIFT); - ALT(KC_RIGHT); - RELEASE(KC_LSHIFT); - CMD(KC_X); - yank_was_lines = false; - EDIT; - default: - vstate = VIM_START; - break; - } - break; - case VIM_D: - /***************************** - * d- ...delete stuff - *****************************/ - switch(keycode) { - case VIM_B: - case VIM_E: - case VIM_H: - case VIM_J: - case VIM_K: - case VIM_L: - case VIM_W: - simple_movement(keycode); - CMD(KC_X); - yank_was_lines = false; - vstate = VIM_START; - break; - case VIM_D: - CMD(KC_LEFT); - SHIFT(KC_DOWN); - CMD(KC_X); - yank_was_lines = true; - vstate = VIM_START; - break; - case VIM_I: - vstate = VIM_DI; - break; - default: - vstate = VIM_START; - break; - } - break; - case VIM_DI: - /***************************** - * ci- ...delete a word... FROM THE INSIDE! - *****************************/ - switch(keycode) { - case VIM_W: - ALT(KC_LEFT); - PRESS(KC_LSHIFT); - ALT(KC_RIGHT); - RELEASE(KC_LSHIFT); - CMD(KC_X); - yank_was_lines = false; - vstate = VIM_START; - default: - vstate = VIM_START; - break; - } - break; - case VIM_V: - /***************************** - * visual! - *****************************/ - switch(keycode) { - case VIM_D: - case VIM_X: - CMD(KC_X); - yank_was_lines = false; - vstate = VIM_START; - break; - case VIM_B: - PRESS(KC_LALT); - PRESS(KC_LSHIFT); - PRESS(KC_LEFT); - // leave open for key repeat - break; - case VIM_E: - PRESS(KC_LALT); - PRESS(KC_LSHIFT); - PRESS(KC_RIGHT); - // leave open for key repeat - break; - case VIM_H: - PRESS(KC_LSHIFT); - PRESS(KC_LEFT); - break; - case VIM_I: - vstate = VIM_VI; - break; - case VIM_J: - PRESS(KC_LSHIFT); - PRESS(KC_DOWN); - break; - case VIM_K: - PRESS(KC_LSHIFT); - PRESS(KC_UP); - break; - case VIM_L: - PRESS(KC_LSHIFT); - PRESS(KC_RIGHT); - break; - case VIM_W: - PRESS(KC_LALT); - SHIFT(KC_RIGHT); // select to end of this word - SHIFT(KC_RIGHT); // select to end of next word - SHIFT(KC_LEFT); // select to start of next word - RELEASE(KC_LALT); - break; - case VIM_P: - CMD(KC_V); - vstate = VIM_START; - break; - case VIM_Y: - CMD(KC_C); - TAP(KC_RIGHT); - yank_was_lines = false; - vstate = VIM_START; - break; - case VIM_V: - case VIM_ESC: - TAP(KC_RIGHT); - vstate = VIM_START; - break; - case VIM_COMMA: - case VIM_PERIOD: - comma_period(keycode); - break; - default: - // do nothing - break; - } - break; - case VIM_VI: - /***************************** - * vi- ...select a word... FROM THE INSIDE! - *****************************/ - switch(keycode) { - case VIM_W: - ALT(KC_LEFT); - PRESS(KC_LSHIFT); - ALT(KC_RIGHT); - RELEASE(KC_LSHIFT); - vstate = VIM_V; - default: - // ignore - vstate = VIM_V; - break; - } - break; - case VIM_VS: - /***************************** - * visual line - *****************************/ - switch(keycode) { - case VIM_D: - case VIM_X: - CMD(KC_X); - yank_was_lines = true; - vstate = VIM_START; - break; - case VIM_J: - PRESS(KC_LSHIFT); - PRESS(KC_DOWN); - break; - case VIM_K: - PRESS(KC_LSHIFT); - PRESS(KC_UP); - break; - case VIM_Y: - CMD(KC_C); - yank_was_lines = true; - TAP(KC_RIGHT); - vstate = VIM_START; - break; - case VIM_P: - CMD(KC_V); - vstate = VIM_START; - break; - case VIM_V: - case VIM_ESC: - TAP(KC_RIGHT); - vstate = VIM_START; - break; - case VIM_COMMA: - case VIM_PERIOD: - comma_period(keycode); - break; - default: - // do nothing - break; - } - break; - case VIM_G: - /***************************** - * gg, and a grab-bag of other macros i find useful - *****************************/ - switch(keycode) { - case VIM_G: - TAP(KC_HOME); - break; - // codes b - case VIM_H: - CTRL(KC_A); - break; - case VIM_J: - PRESS(KC_PGDN); - break; - case VIM_K: - PRESS(KC_PGUP); - break; - case VIM_L: - CTRL(KC_E); - break; - default: - // do nothing - break; - } - vstate = VIM_START; - break; - case VIM_Y: - /***************************** - * yoink! - *****************************/ - switch(keycode) { - case VIM_B: - case VIM_E: - case VIM_H: - case VIM_J: - case VIM_K: - case VIM_L: - case VIM_W: - simple_movement(keycode); - CMD(KC_C); - TAP(KC_RIGHT); - yank_was_lines = false; - break; - case VIM_Y: - CMD(KC_LEFT); - SHIFT(KC_DOWN); - CMD(KC_C); - TAP(KC_RIGHT); - yank_was_lines = true; - break; - default: - // NOTHING - break; - } - vstate = VIM_START; - break; - } - } else { - /************************ - * key release events - ************************/ - clear_keyboard(); - } - return false; - } else { - return true; - } -} - diff --git a/users/xtonhasvim/xtonhasvim.h b/users/xtonhasvim/xtonhasvim.h deleted file mode 100644 index 2d6670a5e6..0000000000 --- a/users/xtonhasvim/xtonhasvim.h +++ /dev/null @@ -1,65 +0,0 @@ - /* Copyright 2015-2017 Christon DeWan - * - * 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/>. - */ - -#ifndef USERSPACE -#define USERSPACE - -#include QMK_KEYBOARD_H -#include "action_layer.h" - -#define X_____X KC_NO - -enum xtonhasvim_keycodes { - // 20: give keyboard-specific codes some room - FIREY_RETURN = SAFE_RANGE + 20, // kick off special effects - VIM_START, // bookend for vim states - VIM_A, - VIM_B, - VIM_C, - VIM_CI, - VIM_D, - VIM_DI, - VIM_E, - VIM_H, - VIM_G, - VIM_I, - VIM_J, - VIM_K, - VIM_L, - VIM_O, - VIM_P, - VIM_S, - VIM_U, - VIM_V, - VIM_VS, // visual-line - VIM_VI, - VIM_W, - VIM_X, - VIM_Y, - VIM_PERIOD, // to support indent/outdent - VIM_COMMA, // and toggle comments - VIM_SHIFT, // avoid side-effect of supporting real shift. - VIM_ESC, // bookend - VIM_SAFE_RANGE // start other keycodes here. -}; - -// NOTE: YOU MUST DEFINE THIS -extern uint8_t vim_cmd_layer(void); - -extern uint16_t vstate; - - -#endif |