elv-lib/completion/mpv.elv

54 lines
596 B
Plaintext
Raw Normal View History

2021-12-26 15:40:57 +00:00
use ./file
var extensions = [
aac
ape
avi
divx
flac
flv
m3u
m4a
m4v
mp3
mp4
mpeg
mpg
mkv
mng
mov
qt
oga
ogg
ogm
ogv
opus
ra
rv
ts
vob
wav
webm
wmv
wma
wmx
]
fn complete {|@argv|
var c = (count $argv)
if (== $c 2) {
put --speed
2021-12-30 08:22:12 +00:00
file:complete $argv[-1] $@extensions
2021-12-26 15:40:57 +00:00
} elif (== $c 3) {
if (eq $argv[-2] --speed) {
put 0.8 0.9 1.0 1.1 1.2
} else {
file:complete $argv[-1] $@extensions
}
} else {
2021-12-30 08:22:12 +00:00
file:complete $argv[-1] $@extensions
2021-12-26 15:40:57 +00:00
}
}
set edit:completion:arg-completer[mpv] = $complete~