blob: 5114de256c765186c984f209d9c61dc1d9f29079 [file] [log] [blame]
Igor7e9a1a72024-06-10 18:19:57 +02001" Vim filetype plugin
2" Language: svelte
3" Maintainer: Igor Lacerda <igorlafarsi@gmail.com>
231tr0n9adb3102025-04-06 17:28:11 +02004" Last Change: 2025 Apr 06
Igor7e9a1a72024-06-10 18:19:57 +02005
6if exists('b:did_ftplugin')
7 finish
8endif
9let b:did_ftplugin = 1
10
231tr0n9adb3102025-04-06 17:28:11 +020011let s:cpo_sav = &cpo
12set cpo&vim
Igor7e9a1a72024-06-10 18:19:57 +020013
231tr0n9adb3102025-04-06 17:28:11 +020014setlocal matchpairs+=<:>
15setlocal commentstring=<!--\ %s\ -->
16setlocal comments=s:<!--,m:\ \ \ \ ,e:-->
17
18let b:undo_ftplugin = 'setlocal comments< commentstring< matchpairs<'
19
20if exists('&omnifunc')
21 setlocal omnifunc=htmlcomplete#CompleteTags
22 call htmlcomplete#DetectOmniFlavor()
23 let b:undo_ftplugin ..= " | setlocal omnifunc<"
24endif
25
26if exists("loaded_matchit") && !exists("b:match_words")
27 let b:match_ignorecase = 1
28 let b:match_words = '<:>,' .
29 \ '<\@<=[ou]l\>[^>]*\%(>\|$\):<\@<=li\>:<\@<=/[ou]l>,' .
30 \ '<\@<=dl\>[^>]*\%(>\|$\):<\@<=d[td]\>:<\@<=/dl>,' .
31 \ '<\@<=\([^/][^ \t>]*\)[^>]*\%(>\|$\):<\@<=/\1>,' .
32 \ '{#\(if\|each\)[^}]*}:{\:else[^}]*}:{\/\(if\|each\)},' .
33 \ '{#await[^}]*}:{\:then[^}]*}:{\:catch[^}]*}:{\/await},' .
34 \ '{#snippet[^}]*}:{\/snippet},' .
35 \ '{#key[^}]*}:{\/key}'
36 let b:html_set_match_words = 1
37 let b:undo_ftplugin ..= " | unlet! b:match_ignorecase b:match_words b:html_set_match_words"
38endif
39let &cpo = s:cpo_sav
40unlet! s:cpo_sav