summaryrefslogtreecommitdiffstats
path: root/users/kuatsure/kuatsure.c
blob: a18713626ec1108b09b8d2d960e892db7dfbbf8a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#include "kuatsure.h"

void tmux_prefix(void) {
  register_code(KC_LCTL);
  register_code(KC_SPC);

  unregister_code(KC_LCTL);
  unregister_code(KC_SPC);
}

void tmux_pane_zoom(void) {
  tmux_prefix();

  register_code(KC_Z);
  unregister_code(KC_Z);
}

void tmux_pane_switch(uint16_t keycode) {
  tmux_prefix();

  register_code(KC_Q);
  unregister_code(KC_Q);

  register_code(keycode);
  unregister_code(keycode);
}

void tmux_window_switch(uint16_t keycode) {
  tmux_prefix();

  register_code(keycode);
  unregister_code(keycode);
}

LEADER_EXTERNS();
void matrix_scan_user(void) {
  LEADER_DICTIONARY() {
    leading = false;
    leader_end();

    // Available seqs
    // SEQ_ONE_KEY, SEQ_TWO_KEYS, SEQ_THREE_KEYS
    // anything you can do in a macro https://docs.qmk.fm/macros.html
    // https://docs.qmk.fm/feature_leader_key.html

    // Whole Screen Shot
    SEQ_ONE_KEY(KC_A) {
      register_code(KC_LGUI);
      register_code(KC_LSFT);
      register_code(KC_3);

      unregister_code(KC_3);
      unregister_code(KC_LSFT);
      unregister_code(KC_LGUI);
    }

    // Selective Screen Shot
    SEQ_ONE_KEY(KC_S) {
      register_code(KC_LGUI);
      register_code(KC_LSFT);
      register_code(KC_4);

      unregister_code(KC_4);
      unregister_code(KC_LSFT);
      unregister_code(KC_LGUI);
    }

    // TMUX - shift to pane 1 and zoom
    SEQ_ONE_KEY(KC_J) {
      tmux_pane_switch(KC_1);
      tmux_pane_zoom();
    }

    // TMUX - shift to pane 2 and zoom
    SEQ_ONE_KEY(KC_K) {
      tmux_pane_switch(KC_2);
      tmux_pane_zoom();
    }

    // TMUX - shift to pane 3 and zoom
    SEQ_ONE_KEY(KC_L) {
      tmux_pane_switch(KC_3);
      tmux_pane_zoom();
    }

    // TMUX - shift to last pane and zoom
    SEQ_ONE_KEY(KC_SCOLON) {
      tmux_prefix();

      register_code(KC_SCOLON);
      unregister_code(KC_SCOLON);

      tmux_pane_zoom();
    }

    // TMUX - shift to first window
    SEQ_ONE_KEY(KC_U) {
      tmux_window_switch(KC_1);
    }

    // TMUX - shift to second window
    SEQ_ONE_KEY(KC_I) {
      tmux_window_switch(KC_2);
    }

    // TMUX - shift to third window
    SEQ_ONE_KEY(KC_O) {
      tmux_window_switch(KC_3);
    }
  }
}