From b8a5504021e0d21310bc603855ac8107828b5759 Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Tue, 31 Dec 2019 14:05:09 +0100 Subject: Update --- after/ftplugin/tsx.vim | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 after/ftplugin/tsx.vim (limited to 'after/ftplugin/tsx.vim') diff --git a/after/ftplugin/tsx.vim b/after/ftplugin/tsx.vim new file mode 100644 index 00000000..e29d1e41 --- /dev/null +++ b/after/ftplugin/tsx.vim @@ -0,0 +1,32 @@ +if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1) + +" modified from html.vim +" For matchit plugin + +if get(g:, 'vim_jsx_pretty_disable_tsx', 0) + finish +endif + +if exists("loaded_matchit") + let b:match_ignorecase = 0 + let b:match_words = '(:),\[:\],{:},<:>,' . + \ '<\@<=\([^/][^ \t>]*\)[^>]*\%(>\|$\):<\@<=/\1>' +endif + +" For andymass/vim-matchup plugin +if exists("loaded_matchup") + setlocal matchpairs=(:),{:},[:],<:> + let b:match_words = '<\@<=\([^/][^ \t>]*\)\g{hlend}[^>]*\%(/\@\|$\):<\@<=/\1>' + let b:match_skip = 's:comment\|string' +endif + +let b:original_commentstring = &l:commentstring + +augroup jsx_comment + autocmd! CursorMoved + autocmd CursorMoved call jsx_pretty#comment#update_commentstring(b:original_commentstring) +augroup end + +setlocal suffixesadd+=.tsx + +endif -- cgit v1.2.3