summaryrefslogtreecommitdiffstats
path: root/runtime/ftplugin
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-08-15 18:55:18 +0200
committerBram Moolenaar <Bram@vim.org>2020-08-15 18:55:18 +0200
commit3d1cde8a2f28dce2c82d2b2b4c5e35e6662030e0 (patch)
tree997f03c1bd793148efe3387f64c9e3efdcb44be9 /runtime/ftplugin
parente3c37d8ebf9dbbf210fde4a5fb28eb1f2a492a34 (diff)
Update runtime files.
Diffstat (limited to 'runtime/ftplugin')
-rw-r--r--runtime/ftplugin/cobol.vim5
-rw-r--r--runtime/ftplugin/css.vim7
-rw-r--r--runtime/ftplugin/typescript.vim39
-rw-r--r--runtime/ftplugin/typescriptreact.vim33
-rw-r--r--runtime/ftplugin/vim.vim5
5 files changed, 82 insertions, 7 deletions
diff --git a/runtime/ftplugin/cobol.vim b/runtime/ftplugin/cobol.vim
index d96a1bf281..ec1e95456d 100644
--- a/runtime/ftplugin/cobol.vim
+++ b/runtime/ftplugin/cobol.vim
@@ -2,7 +2,7 @@
" Language: cobol
" Maintainer: Ankit Jain <ajatkj@yahoo.co.in>
" (formerly Tim Pope <vimNOSPAM@tpope.info>)
-" Last Update: By Ankit Jain (changed maintainer) on 22.03.2019
+" Last Update: By Ankit Jain (add gtk support) on 15.08.2020
" Insert mode mappings: <C-T> <C-D> <Tab>
" Normal mode mappings: < > << >> [[ ]] [] ][
@@ -37,7 +37,8 @@ if exists("loaded_matchit")
\ '-\@<!\<\%(delete\|rewrite\|start\|write\|read\)\>\%(.*\(\%$\|\%(\n\%(\%(\s*\|.\{6\}\)[*/].*\n\)*\)\=\s*\%(invalid\s\+key\|at\s\+end\|no\s\+data\|at\s\+end-of-page\)\>\)\)\@=:\%(\<not\s\+\)\@<!\<\%(not\s\+\)\=\%(invalid\s\+key\|at\s\+end\|no\s\+data\|at\s\+end-of-page\)\>:\<end-\%(delete\|rewrite\|start\|write\|read\)\>' .s:ordot
endif
-if has("gui_win32") && !exists("b:browsefilter")
+" add gtk support
+if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
let b:browsefilter = "COBOL Source Files (*.cbl, *.cob)\t*.cbl;*.cob;*.lib\n".
\ "All Files (*.*)\t*.*\n"
endif
diff --git a/runtime/ftplugin/css.vim b/runtime/ftplugin/css.vim
index ea4424418c..33fcee31c0 100644
--- a/runtime/ftplugin/css.vim
+++ b/runtime/ftplugin/css.vim
@@ -1,7 +1,8 @@
" Vim filetype plugin file
-" Language: CSS
-" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
-" Latest Revision: 2008-07-09
+" Language: CSS
+" Maintainer: Doug Kearns <dougkearns@gmail.com>
+" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
+" Latest Revision: 2008-07-09
if exists("b:did_ftplugin")
finish
diff --git a/runtime/ftplugin/typescript.vim b/runtime/ftplugin/typescript.vim
new file mode 100644
index 0000000000..f701ae96cd
--- /dev/null
+++ b/runtime/ftplugin/typescript.vim
@@ -0,0 +1,39 @@
+" Vim filetype plugin file
+" Language: TypeScript
+" Maintainer: Doug Kearns <dougkearns@gmail.com>
+" Last Change: 2019 Aug 30
+
+if exists("b:did_ftplugin")
+ finish
+endif
+let b:did_ftplugin = 1
+
+let s:cpo_save = &cpo
+set cpo-=C
+
+" Set 'formatoptions' to break comment lines but not other lines,
+" and insert the comment leader when hitting <CR> or using "o".
+setlocal formatoptions-=t formatoptions+=croql
+
+" Set 'comments' to format dashed lists in comments.
+setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,://
+
+setlocal commentstring=//%s
+
+setlocal suffixesadd+=.ts,.d.ts,.tsx,.js,.jsx,.cjs,.mjs
+
+" Change the :browse e filter to primarily show TypeScript-related files.
+if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
+ let b:browsefilter="TypeScript Files (*.ts)\t*.ts\n" .
+ \ "TypeScript Declaration Files (*.d.ts)\t*.d.ts\n" .
+ \ "TSX Files (*.tsx)\t*.tsx\n" .
+ \ "JavaScript Files (*.js)\t*.js\n" .
+ \ "JavaScript Modules (*.es, *.cjs, *.mjs)\t*.es;*.cjs;*.mjs\n" .
+ \ "JSON Files (*.json)\t*.json\n" .
+ \ "All Files (*.*)\t*.*\n"
+endif
+
+let b:undo_ftplugin = "setl fo< com< cms< sua< | unlet! b:browsefilter"
+
+let &cpo = s:cpo_save
+unlet s:cpo_save
diff --git a/runtime/ftplugin/typescriptreact.vim b/runtime/ftplugin/typescriptreact.vim
new file mode 100644
index 0000000000..3bd6001a18
--- /dev/null
+++ b/runtime/ftplugin/typescriptreact.vim
@@ -0,0 +1,33 @@
+" Vim filetype plugin file
+" Language: TypeScript React
+" Maintainer: Doug Kearns <dougkearns@gmail.com>
+" Last Change: 2020 Aug 09
+
+let s:match_words = ""
+let s:undo_ftplugin = ""
+
+runtime! ftplugin/typescript.vim
+
+let s:cpo_save = &cpo
+set cpo-=C
+
+if exists("b:match_words")
+ let s:match_words = b:match_words
+endif
+if exists("b:undo_ftplugin")
+ let s:undo_ftplugin = b:undo_ftplugin
+endif
+
+" Matchit configuration
+if exists("loaded_matchit")
+ let b:match_ignorecase = 0
+ let b:match_words = s:match_words .
+ \ '<:>,' .
+ \ '<\@<=\([^ \t>/]\+\)\%(\s\+[^>]*\%([^/]>\|$\)\|>\|$\):<\@<=/\1>,' .
+ \ '<\@<=\%([^ \t>/]\+\)\%(\s\+[^/>]*\|$\):/>'
+endif
+
+let b:undo_ftplugin = "unlet! b:match_words b:match_ignorecase | " . s:undo_ftplugin
+
+let &cpo = s:cpo_save
+unlet s:cpo_save
diff --git a/runtime/ftplugin/vim.vim b/runtime/ftplugin/vim.vim
index 295112297f..b87e144220 100644
--- a/runtime/ftplugin/vim.vim
+++ b/runtime/ftplugin/vim.vim
@@ -1,7 +1,7 @@
" Vim filetype plugin
" Language: Vim
" Maintainer: Bram Moolenaar <Bram@vim.org>
-" Last Change: 2020 Jul 26
+" Last Change: 2020 Aug 14
" Only do this when not done yet for this buffer
if exists("b:did_ftplugin")
@@ -49,7 +49,8 @@ setlocal isk+=#
setlocal keywordprg=:help
" Set 'comments' to format dashed lists in comments
-setlocal com=sO:\"\ -,mO:\"\ \ ,sO:#\ -,mO:#\ \ ,eO:##,:\",:#
+" Avoid that #{} starts a comment.
+setlocal com=sO:\"\ -,mO:\"\ \ ,sO:#\ -,mO:#\ \ ,eO:##,:\",b:#
" Format comments to be up to 78 characters long
if &tw == 0