1
1
if exists (" b:did_ftplugin" ) | finish | endif
2
2
let b: did_ftplugin = 1
3
3
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"
5
11
6
12
if ! has (' nvim' )
7
13
setlocal matchpairs += <:>
8
- let b: undo_ftplugin .= " | setlocal matchpairs<"
14
+ let b: undo_ftplugin .= " | setlocal matchpairs<"
9
15
endif
10
16
11
17
if exists (" loaded_matchit" )
@@ -16,24 +22,19 @@ if exists("loaded_matchit")
16
22
\ ' <\@<=\([^/][^ \t>]*\)[^>]*\%(>\|$\):<\@<=/\1>,' .
17
23
\ ' {#\(if\|each\)[^}]*}:{\:else[^}]*}:{\/\(if\|each\)},' .
18
24
\ ' {#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"
20
26
endif
21
27
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
-
28
28
if executable (' npx' ) && ! empty (globpath (&runtimepath , ' compiler/svelte-check.vim' ))
29
29
compiler svelte- check
30
- let b: undo_ftplugin .= " | compiler make"
30
+ let b: undo_ftplugin .= " | compiler make"
31
31
endif
32
32
if exists (' :Open' ) == 2
33
33
" let &keywordprg = ':Open https://devdocs.io/\#q='..&filetype
34
34
nnoremap <buffer> <expr> <F1> '<cmd> Open https://devdocs.io/\#q='..&filetype..' '..expand('<cword> ')..'<CR> '
35
+ let b: undo_ftplugin .= " | exe 'nunmap <buffer> <F1>'"
35
36
if exists (' *getregion' )
36
37
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>'"
37
39
endif
38
- let b: undo_ftplugin .= " | nunmap <buffer> <F1> | vnunmap <buffer> <F1>"
39
40
endif
0 commit comments