robin/laufey

git clone https://git.robinwobin.dev/robin/laufey

Christian Clasonvim-patch:9adb310: runtime(svelte): add matchit support to svelte filetype plugin1867f2a830

master
1.2 KiB40 linesraw
1" Vim filetype plugin
2" Language:	svelte
3" Maintainer:	Igor Lacerda <igorlafarsi@gmail.com>
4" Last Change:	2025 Apr 06
5
6if exists('b:did_ftplugin')
7  finish
8endif
9let b:did_ftplugin = 1
10
11let s:cpo_sav = &cpo
12set cpo&vim
13
14setlocal 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