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 . " | " : " " ) . " unlet b:syng_str b:syng_strcom"
510
611if ! has (' nvim' )
712 setlocal matchpairs += <:>
@@ -16,24 +21,19 @@ if exists("loaded_matchit")
1621 \ ' <\@<=\([^/][^ \t>]*\)[^>]*\%(>\|$\):<\@<=/\1>,' .
1722 \ ' {#\(if\|each\)[^}]*}:{\:else[^}]*}:{\/\(if\|each\)},' .
1823 \ ' {#await[^}]*}:{\:then[^}]*}:{\/await},'
19- let b: undo_ftplugin .= " | unlet b:match_ignorecase b:match_words"
24+ let b: undo_ftplugin .= " | unlet b:match_ignorecase b:match_words"
2025endif
2126
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-
2827if executable (' npx' ) && ! empty (globpath (&runtimepath , ' compiler/svelte-check.vim' ))
2928 compiler svelte- check
30- let b: undo_ftplugin .= " | compiler make"
29+ let b: undo_ftplugin .= " | compiler make"
3130endif
3231if exists (' :Open' ) == 2
3332 " let &keywordprg = ':Open https://devdocs.io/\#q='..&filetype
3433 nnoremap <buffer> <expr> <F1> '<cmd> Open https://devdocs.io/\#q='..&filetype..' '..expand('<cword> ')..'<CR> '
34+ let b: undo_ftplugin .= " | exe 'nunmap <buffer> <F1>'"
3535 if exists (' *getregion' )
3636 vnoremap <buffer> <expr> <F1> '<cmd> Open https://devdocs.io/\#q='..&filetype..' '..join(getregion(getpos('v'), getpos('.')))..'<CR> '
37+ let b: undo_ftplugin .= " | exe 'vunmap <buffer> <F1>'"
3738 endif
38- let b: undo_ftplugin .= " | nunmap <buffer> <F1> | vnunmap <buffer> <F1>"
3939endif
0 commit comments