11if exists (" b:did_ftplugin" ) | finish | endif
22let b: did_ftplugin = 1
33
4- let b: undo_ftplugin = get (b: , ' undo_ftplugin' , ' ' )
4+ " Indent correctly with template string for vim-javascript/builtin
5+ " indentexpr
6+ let b: syng_str = ' ^\%(.*template\)\@!.*string\|special'
7+ let b: syng_strcom = ' ^\%(.*template\)\@!.*string\|comment\|regex\|special\|doc'
8+
9+ let b: undo_ftplugin = (exists (' b:undo_ftplugin' ) ? b: undo_ftplugin . " | " : " " ) .
10+ \ " unlet! b:syng_str b:syng_strcom"
511
612if ! has (' nvim' )
713 setlocal matchpairs += <:>
8- let b: undo_ftplugin .= " | setlocal matchpairs<"
14+ let b: undo_ftplugin .= " | setlocal matchpairs<"
915endif
1016
1117if exists (" loaded_matchit" )
@@ -16,24 +22,19 @@ if exists("loaded_matchit")
1622 \ ' <\@<=\([^/][^ \t>]*\)[^>]*\%(>\|$\):<\@<=/\1>,' .
1723 \ ' {#\(if\|each\)[^}]*}:{\:else[^}]*}:{\/\(if\|each\)},' .
1824 \ ' {#await[^}]*}:{\:then[^}]*}:{\/await},'
19- let b: undo_ftplugin .= " | unlet b:match_ignorecase b:match_words"
25+ let b: undo_ftplugin .= " | unlet! b:match_ignorecase b:match_words"
2026endif
2127
22- " Indent correctly with template string for vim-javascript/builtin
23- " indentexpr
24- let b: syng_str = ' ^\%(.*template\)\@!.*string\|special'
25- let b: syng_strcom = ' ^\%(.*template\)\@!.*string\|comment\|regex\|special\|doc'
26- let b: undo_ftplugin .= " | unlet b:syng_str b:syng_strcom"
27-
2828if executable (' npx' ) && ! empty (globpath (&runtimepath , ' compiler/svelte-check.vim' ))
2929 compiler svelte- check
30- let b: undo_ftplugin .= " | compiler make"
30+ let b: undo_ftplugin .= " | compiler make"
3131endif
3232if exists (' :Open' ) == 2
3333 " let &keywordprg = ':Open https://devdocs.io/\#q='..&filetype
3434 nnoremap <buffer> <expr> <F1> '<cmd> Open https://devdocs.io/\#q='..&filetype..' '..expand('<cword> ')..'<CR> '
35+ let b: undo_ftplugin .= " | exe 'nunmap <buffer> <F1>'"
3536 if exists (' *getregion' )
3637 vnoremap <buffer> <expr> <F1> '<cmd> Open https://devdocs.io/\#q='..&filetype..' '..join(getregion(getpos('v'), getpos('.')))..'<CR> '
38+ let b: undo_ftplugin .= " | exe 'vunmap <buffer> <F1>'"
3739 endif
38- let b: undo_ftplugin .= " | nunmap <buffer> <F1> | vnunmap <buffer> <F1>"
3940endif
0 commit comments