robin/laufey

git clone https://git.robinwobin.dev/robin/laufey

Christian Clasonvim-patch:9.1.0464: no whitespace padding in commentstring option in ftplugins2f5b8a0092

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