Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xton's first keymap! #2941

Merged
merged 26 commits into from
May 12, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
cleaned up some yanking edge cases
  • Loading branch information
Xton committed May 12, 2018
commit d4dae4a5354653a94c329ea5825278522c5aa055
25 changes: 15 additions & 10 deletions users/xtonhasvim/xtonhasvim.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ bool process_record_xtonhasvim(uint16_t keycode, keyrecord_t *record) {
CMD(KC_RIGHT);
RELEASE(KC_LSHIFT);
CMD(KC_X);
yank_was_lines = false;
EDIT;
} else {
vstate = VIM_C;
Expand Down Expand Up @@ -225,10 +226,12 @@ bool process_record_xtonhasvim(uint16_t keycode, keyrecord_t *record) {
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;
Expand Down Expand Up @@ -264,13 +267,11 @@ bool process_record_xtonhasvim(uint16_t keycode, keyrecord_t *record) {
break;
case VIM_Y:
if(SHIFTED) {

CMD(KC_LEFT);
PRESS(KC_LSHIFT);
CMD(KC_RIGHT);
RELEASE(KC_LSHIFT);
SHIFT(KC_DOWN);
CMD(KC_C);
TAP(KC_LEFT);
TAP(KC_RIGHT);
yank_was_lines = true;
} else {
vstate = VIM_Y;
}
Expand Down Expand Up @@ -306,6 +307,7 @@ bool process_record_xtonhasvim(uint16_t keycode, keyrecord_t *record) {
case VIM_W:
simple_movement(keycode);
CMD(KC_X);
yank_was_lines = false;
EDIT;
break;

Expand All @@ -315,6 +317,7 @@ bool process_record_xtonhasvim(uint16_t keycode, keyrecord_t *record) {
CMD(KC_RIGHT);
RELEASE(KC_LSHIFT);
CMD(KC_X);
yank_was_lines = false;
EDIT;
break;
case VIM_I:
Expand All @@ -336,6 +339,7 @@ bool process_record_xtonhasvim(uint16_t keycode, keyrecord_t *record) {
ALT(KC_RIGHT);
RELEASE(KC_LSHIFT);
CMD(KC_X);
yank_was_lines = false;
EDIT;
default:
vstate = VIM_START;
Expand All @@ -356,14 +360,13 @@ bool process_record_xtonhasvim(uint16_t keycode, keyrecord_t *record) {
case VIM_W:
simple_movement(keycode);
CMD(KC_X);
yank_was_lines = false;
break;
case VIM_D:
CMD(KC_LEFT);
PRESS(KC_LSHIFT);
CMD(KC_RIGHT);
TAP(KC_RIGHT);
RELEASE(KC_LSHIFT);
SHIFT(KC_DOWN);
CMD(KC_X);
yank_was_lines = true;
vstate = VIM_START;
break;
case VIM_I:
Expand All @@ -385,6 +388,7 @@ bool process_record_xtonhasvim(uint16_t keycode, keyrecord_t *record) {
ALT(KC_RIGHT);
RELEASE(KC_LSHIFT);
CMD(KC_X);
yank_was_lines = false;
vstate = VIM_START;
default:
vstate = VIM_START;
Expand Down Expand Up @@ -550,13 +554,14 @@ bool process_record_xtonhasvim(uint16_t keycode, keyrecord_t *record) {
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);
TAP(KC_LEFT);
yank_was_lines = true;
break;
default:
// NOTHING
Expand Down