-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.mim
133 lines (113 loc) · 2.1 KB
/
config.mim
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
125
126
127
128
129
130
131
132
133
:on_no_playback
:load_script scripts/shuffle.tengo
:bind p
:load_script scripts/pause.tengo
:bind q
:load_script scripts/skip.tengo
:bind j
:begin
selectDown()
:end move_down
:bind k
:begin
selectUp()
:end move_up
:bind h
:begin
selectEnclosing()
:end select_enclosing
:bind l
:begin
if selectedIsDir() {
toggle(currentIndex())
} else {
playSelected()
}
:end play_or_toggle
:bind a
:load_script scripts/play_album.tengo
:bind C
:load_script scripts/close_all.tengo
:bind n
:begin
matchIndex := nextMatch(currentIndex() + 1)
if matchIndex != -1 {
selectIndex(matchIndex)
} else if matchIndex = nextMatch(0); matchIndex != -1 {
selectIndex(matchIndex)
}
:end select_next_match_wrapped
:bind N
:begin
matchIndex := prevMatch(currentIndex() - 1)
if matchIndex != -1 {
selectIndex(matchIndex)
}
:end select_previous_match
:bind /
:begin
infoPrint("Input search: ")
line := ""
ch := getChar()
for ; ch != '\n'; ch = getChar() {
line = line + string(ch)
infoPrint(string(ch))
}
infoPrintln()
setSearch(line)
matchIndex := nextMatch(currentIndex() + 1)
if matchIndex != -1 {
selectIndex(matchIndex)
}
:end input_search
:bind ?
:begin
selectWrappedNextMatch := func() {
matchIndex := nextMatch(currentIndex())
if matchIndex != -1 {
selectIndex(matchIndex)
} else if matchIndex = nextMatch(0); matchIndex != -1 {
selectIndex(matchIndex)
}
}
infoPrint("Input search: ")
line := ""
ch := getChar()
for ; ch != '\n'; ch = getChar() {
line = line + string(ch)
infoPrint(string(ch))
setSearch(line)
selectWrappedNextMatch()
}
infoPrintln()
setSearch(line)
selectWrappedNextMatch()
:end live_search
:bind .
:begin
send("seek +15")
:end seek_forward
:bind ,
:begin
send("seek -15")
:end seek_back
:bind g
:begin
selectIndex(0)
:end jump_to_top
:bind G
:begin
selectIndex(itemCount() - 1)
:end jump_to_bottom
:bind =
:begin
send("volume +10 0")
:end volume_up
:bind -
:begin
send("volume -10 0")
:end volume_down
:new_command s scripts/enable_shuffle.mim
:new_command ns scripts/enable_sequential.mim
:new_command as scripts/enable_album_shuffle.mim
:alias q :exit