vim

Fork of vim, an acceptable text editor
git clone git://git.laack.co/vim.git
Log | Files | Refs | README | LICENSE

svelte.vim (1219B)


      1 " Vim filetype plugin
      2 " Language:	svelte
      3 " Maintainer:	Igor Lacerda <igorlafarsi@gmail.com>
      4 " Last Change:	2025 Apr 06
      5 
      6 if exists('b:did_ftplugin')
      7   finish
      8 endif
      9 let b:did_ftplugin = 1
     10 
     11 let s:cpo_sav = &cpo
     12 set cpo&vim
     13 
     14 setlocal matchpairs+=<:>
     15 setlocal commentstring=<!--\ %s\ -->
     16 setlocal comments=s:<!--,m:\ \ \ \ ,e:-->
     17 
     18 let b:undo_ftplugin = 'setlocal comments< commentstring< matchpairs<'
     19 
     20 if exists('&omnifunc')
     21   setlocal omnifunc=htmlcomplete#CompleteTags
     22   call htmlcomplete#DetectOmniFlavor()
     23   let b:undo_ftplugin ..= " | setlocal omnifunc<"
     24 endif
     25 
     26 if 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"
     38 endif
     39 let &cpo = s:cpo_sav
     40 unlet! s:cpo_sav