-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstartup.min
106 lines (63 loc) · 2.76 KB
/
startup.min
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
; HACK: next two lines have to be identical except for
; the last word: "define" on first line, "bind" on
; second. This is so that we can set up 'redefine
; to update symbol definitions when sourcing this
; file from the repl.
; (swap over quote-define dup "($1)" swap quote interpolate eval source dequote swap "($1)" swap quote interpolate eval bind) 'string-bind-or-define define
; (swap over quote-define dup "($1)" swap quote interpolate eval source dequote swap "($1)" swap quote interpolate eval bind) 'string-bind-or-define bind
; (string-bind-or-define) 'redefine define
; (quote-define) 'redefine define
(quote "tmux send-key -t0 '$1'" swap interpolate system pop) 'k define
; (quote prepend "tmux send-key -t$1 '$2'" swap interpolate sp) 'pk define
("\n[----\nstack:\n" print! get-stack print! "\n]----\n\n" print!) 'stack-print define
(stack-print temp-cached-frequent-ngrams-from-history-increment kapp-suggestions-do-offer kapp-suggestions-keybindings-listen) 'keykapp-event-loop-run define
(keykapp-event-loop-run "\n--------------------------------\n[$1]\nλ " (. "^/Users/hsribei" "~" replace) => %) 'prompt bind
(quote "\n" swap append "" join print) 'println define
(println pop) 'println! define
("\n[---- shell output:\n" println! system pop "\n]---- shell output.\n" println!) 'sp define
(clear-stack) 'cs define
(pop) 'd define
("/usr/sbin/networksetup -setairportpower en0 off" sp) 'wfj define
("/usr/sbin/networksetup -setairportpower en0 on" sp) 'wfk define
; append string 2 to 1
(swap quote append "" join) 'ja define
; append slash
("/" ja) 'jal define
; prepend string 2 to 1
(swap quote prepend "" join) 'jp define
; join two strings with a space
(quote prepend " " join) 'js define
; join two strings with a slash
(quote prepend "/" join) 'jl define
; call macos open command
("open " jp sp) 'o define
; ("/Applications/" jp ".app" ja o) 'oa define
; "fuck-yeah": move todo item to done
("ddGp:w" k "Enter" k "C-o" k) 'fy define
'HOME get-env "/" ja 'homedir define
(homedir) 'hd define
(homedir "kk/" ja) 'kkd define
(kkd "startup.min" ja) 'kkb define
("nvim" swap js sp) 'v define
("nvim" kkb js sp) 'vm define
(kkb fread eval "##! keykapp reloaded !##" println!) 'sm define
("mpv '$1'" swap quote interpolate sp) 'mpv define
; import all stored symbols from .min_symbols
kkd
".min_symbols"
ja
fread
from-json
'keykapp
module
'keykapp
import
; FIXME turn to-pairs into a reduce to stop relying on bind
rhcounts '__dict define
; keep result of last 'kf run (frequent kapp fuzzy filter)
() 'temp-kf-last-result define
; HACK memoize kapp ngrams
(temp-cached-frequent-ngrams) keykapp-data-load-and-bind
; keep result of last temp-kapp-suggestions-recompute
; this is currently done on every new prompt rendering
(()) 'temp-kapp-suggestions define