-
Notifications
You must be signed in to change notification settings - Fork 2
/
m3u.vim
59 lines (45 loc) · 1.71 KB
/
m3u.vim
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
" Vim syntax file
" Language: m3u multimedia list
" Maintainer: Fauve <fauve.ordinator@taniere.info>
" Last Change: 2020-04-05
" Version: 0.1
" License: MIT (see https://opensource.org/licenses/MIT)
" Website: http://taniere.info
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish
endif
" Header.
syn match m3uHeader /^#\(EXTM3U\|EXTM3A\)$/
" Comments.
syn match m3uComment /^#EXTREM:.*$/ contains=@Spell
" Group name tag
syn match m3uGroupNameTag "^#EXTGRP:"
" Group name
syn match m3uGroupName "\(^#EXTGRP:\s*\)\@<=.*"
" Links
syn match m3uLink /^[^#].*$/
" Informations
syn match m3uInformationsTag /^#EXTINF:/
syn match m3uInformationsRuntime "\(^#EXTINF:\s*\)\@<=[0-9]*"
syn match m3uInformationsTitle "\(^#EXTINF:\s*[0-9]*,\s*\)\@<=.*"
" Titles
syn match m3uTitles /^#\(PLAYLIST\|EXTALB\|EXTGENRE\):/
" Titles Identifiers
syn match m3uTitlesIdentifiers "\(^#\(PLAYLIST\|EXTALB\|EXTGENRE\):\s*\)\@<=.*"
" Uniq album file
syn match m3uUniqAlbumFile /^#\(EXTBYT\|EXTBIN\|EXTENC\|EXTIMG\):/
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
highlight default link m3uComment Comment
highlight default link m3uHeader Comment
highlight default link m3uLink String
highlight default link m3uInformationsRuntime Number
highlight default link m3uInformationsTag Define
highlight default link m3uInformationsTitle Identifier
highlight default link m3uTitles Define
highlight default link m3uTitlesIdentifiers Identifier
highlight default link m3uUniqAlbumFile Define
highlight default link m3uGroupNameTag Keyword
highlight default link m3uGroupName Identifier
let b:current_syntax = "m3u"