summaryrefslogtreecommitdiff
path: root/users/danielo515/danielo515.c
blob: aa33f55d66ae17811c93e3aba5d2ba9e442ae2f4 (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
112
113
114
115
116
117
118
119
120
121
122
123
124
#include "danielo515.h"

bool onMac = true;

//**************** LEADER *********************//
#ifdef LEADER_ENABLE
void leader_start_user(vodi) {
#    ifdef RGBLIGHT_ENABLE
    rgblight_setrgb_range(5, 100, 199, 10, 15);
#    endif
}

void leader_end_user() {
    if (leader_sequence_one_key(KC_T)) {
        SEND_STRING("``" SS_TAP(X_LEFT));
    }
    // Triple ticks
    if (leader_sequence_two_keys(KC_T, KC_T)) {
        SEND_STRING("```" SS_TAP(X_ENTER) SS_TAP(X_ENTER) "```" SS_TAP(X_UP));
    }
    // ==== International spanish accent vowels ====
    if (leader_sequence_one_key(KC_A)) {
        SEND_STRING(SS_LALT("e") "a");
    }
    if (leader_sequence_one_key(KC_E)) {
        SEND_STRING(SS_LALT("e") "e");
    }
    if (leader_sequence_one_key(KC_I)) {
        SEND_STRING(SS_LALT("e") "i");
    }
    if (leader_sequence_one_key(KC_O)) {
        SEND_STRING(SS_LALT("e") "o");
    }
    if (leader_sequence_one_key(KC_U)) {
        SEND_STRING(SS_LALT("e") "u");
    }
    if (leader_sequence_one_key(KC_N)) {
        SEND_STRING(SS_LALT("n") "n");
    }
    // ==== MACROS ===
    if (leader_sequence_one_key(KC_G)) {
        SEND_STRING(" | grep ");
    }
    if (leader_sequence_one_key(KC_K)) {
        onMac ? SEND_STRING(SS_LCTL(" ")) : SEND_STRING(SS_LCTL("f"));
    }
    // vim delete all
    if (leader_sequence_two_keys(KC_D, KC_G)) {
        if (onMac) {
            SEND_STRING(SS_LGUI("a") SS_TAP(X_D));
        } else {
            SEND_STRING(SS_LCTL("a") SS_TAP(X_D));
        }
    }
    // tripe delete!
    if (leader_sequence_one_key(KC_BACKSPACE)) {
        SEND_STRING(SS_TAP(X_BACKSPACE) SS_TAP(X_BACKSPACE) SS_TAP(X_BACKSPACE));
    }
    if (leader_sequence_two_keys(KC_P, KC_G)) {
        SEND_STRING("ps -ef | grep ");
    }
    if (leader_sequence_two_keys(KC_J, KC_A)) {
        SEND_STRING("() => {}" SS_TAP(X_LEFT) SS_TAP(X_LEFT) SS_TAP(X_LEFT) SS_TAP(X_LEFT) SS_TAP(X_LEFT) SS_TAP(X_LEFT) SS_TAP(X_LEFT));
    }
    // this is a pain to type
    if (leader_sequence_two_keys(KC_S, KC_S)) {
        SEND_STRING("~/.ssh/ ");
    }
    if (leader_sequence_two_keys(KC_F, KC_T)) {
        SEND_STRING("feat():" SS_TAP(X_LEFT) SS_TAP(X_LEFT));
    }
    // ### LAYER CHANGE
    if (leader_sequence_one_key(KC_1)) {
        layer_on(1);
    }
    // control enter, because yes
    if (leader_sequence_one_key(KC_H)) {
        SEND_STRING(SS_DOWN(X_LCTL) SS_TAP(X_ENTER) SS_UP(X_LCTL));
    }
    // paste all
    if (leader_sequence_one_key(KC_P)) {
        if (onMac) {
            SEND_STRING(SS_LGUI("a") SS_LGUI("v"));
        } else {
            SEND_STRING(SS_LCTL("a") SS_LCTL("v"));
        }
    }
    if (leader_sequence_three_keys(KC_M, KC_A, KC_C)) {
        onMac = true;
#    ifdef RGBLIGHT_ENABLE
        rgblight_setrgb(255, 255, 255);
#    endif
    }
    if (leader_sequence_three_keys(KC_W, KC_I, KC_N)) {
        onMac = false;
#    ifdef RGBLIGHT_ENABLE
        rgblight_setrgb(255, 255, 0);
#    endif
    }
    /*  Copy all */
    if (leader_sequence_one_key(KC_Y)) {
        if (onMac) {
            SEND_STRING(SS_LGUI("a") SS_LGUI("c"));
        } else {
            SEND_STRING(SS_LCTL("a") SS_LCTL("c"));
        }
    }
    // emoji bar
    if (leader_sequence_two_keys(KC_E, KC_E)) {
        SEND_STRING(SS_DOWN(X_LGUI) SS_LCTL(" ") SS_UP(X_LGUI));
    }

    if (leader_sequence_two_keys(KC_F, KC_F)) {
        SEND_STRING("ps -ef | grep ");
    }
    if (leader_sequence_two_keys(KC_H, KC_T)) {
        SEND_STRING("https://");
    }

#    ifdef RGBLIGHT_ENABLE
    rgblight_setrgb_range(200, 200, 255, 10, 15);
#    endif
}
#endif  // LEADER