21825
|
1 " Vim filetype plugin file
|
|
2 " Language: TypeScript
|
|
3 " Maintainer: Doug Kearns <dougkearns@gmail.com>
|
|
4 " Last Change: 2019 Aug 30
|
|
5
|
|
6 if exists("b:did_ftplugin")
|
|
7 finish
|
|
8 endif
|
|
9 let b:did_ftplugin = 1
|
|
10
|
|
11 let s:cpo_save = &cpo
|
|
12 set cpo-=C
|
|
13
|
|
14 " Set 'formatoptions' to break comment lines but not other lines,
|
|
15 " and insert the comment leader when hitting <CR> or using "o".
|
|
16 setlocal formatoptions-=t formatoptions+=croql
|
|
17
|
|
18 " Set 'comments' to format dashed lists in comments.
|
|
19 setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,://
|
|
20
|
|
21 setlocal commentstring=//%s
|
|
22
|
|
23 setlocal suffixesadd+=.ts,.d.ts,.tsx,.js,.jsx,.cjs,.mjs
|
|
24
|
|
25 " Change the :browse e filter to primarily show TypeScript-related files.
|
|
26 if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
|
|
27 let b:browsefilter="TypeScript Files (*.ts)\t*.ts\n" .
|
|
28 \ "TypeScript Declaration Files (*.d.ts)\t*.d.ts\n" .
|
|
29 \ "TSX Files (*.tsx)\t*.tsx\n" .
|
|
30 \ "JavaScript Files (*.js)\t*.js\n" .
|
|
31 \ "JavaScript Modules (*.es, *.cjs, *.mjs)\t*.es;*.cjs;*.mjs\n" .
|
|
32 \ "JSON Files (*.json)\t*.json\n" .
|
|
33 \ "All Files (*.*)\t*.*\n"
|
|
34 endif
|
|
35
|
|
36 let b:undo_ftplugin = "setl fo< com< cms< sua< | unlet! b:browsefilter"
|
|
37
|
|
38 let &cpo = s:cpo_save
|
|
39 unlet s:cpo_save
|