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' , ' ' )
5
+
4
6
if ! has (' nvim' )
5
7
setlocal matchpairs += <:>
8
+ let b: undo_ftplugin .= " | setlocal matchpairs<"
6
9
endif
7
10
8
11
if exists (" loaded_matchit" )
@@ -13,18 +16,24 @@ if exists("loaded_matchit")
13
16
\ ' <\@<=\([^/][^ \t>]*\)[^>]*\%(>\|$\):<\@<=/\1>,' .
14
17
\ ' {#\(if\|each\)[^}]*}:{\:else[^}]*}:{\/\(if\|each\)},' .
15
18
\ ' {#await[^}]*}:{\:then[^}]*}:{\/await},'
19
+ let b: undo_ftplugin .= " | unlet b:match_ignorecase b:match_words"
16
20
endif
17
21
18
22
" Indent correctly with template string for vim-javascript/builtin
19
23
" indentexpr
20
24
let b: syng_str = ' ^\%(.*template\)\@!.*string\|special'
21
25
let b: syng_strcom = ' ^\%(.*template\)\@!.*string\|comment\|regex\|special\|doc'
26
+ let b: undo_ftplugin .= " | unlet b:syng_str b:syng_strcom"
22
27
23
- if executable (' npx' )
28
+ if executable (' npx' ) && ! empty ( globpath (& runtimepath , ' compiler/svelte-check.vim ' ))
24
29
compiler svelte- check
30
+ let b: undo_ftplugin .= " | compiler make"
25
31
endif
26
- " let &keywordprg = ':Open https://devdocs.io/\#q='..&filetype
27
- nnoremap <buffer> <expr> <F1> '<cmd> Open https://devdocs.io/\#q='..&filetype..' '..expand('<cword> ')..'<CR> '
28
- if exists (' *getregion' )
29
- vnoremap <buffer> <expr> <F1> '<cmd> Open https://devdocs.io/\#q='..&filetype..' '..join(getregion(getpos('v'), getpos('.')))..'<CR> '
32
+ if exists (' :Open' ) == 2
33
+ " let &keywordprg = ':Open https://devdocs.io/\#q='..&filetype
34
+ nnoremap <buffer> <expr> <F1> '<cmd> Open https://devdocs.io/\#q='..&filetype..' '..expand('<cword> ')..'<CR> '
35
+ if exists (' *getregion' )
36
+ vnoremap <buffer> <expr> <F1> '<cmd> Open https://devdocs.io/\#q='..&filetype..' '..join(getregion(getpos('v'), getpos('.')))..'<CR> '
37
+ endif
38
+ let b: undo_ftplugin .= " | nunmap <buffer> <F1> | vnunmap <buffer> <F1>"
30
39
endif
0 commit comments