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 ++++++++++++++++++++++++++++++++ after/ftplugin/typescript.vim | 32 -------------------------------- after/ftplugin/typescriptreact.vim | 2 +- 3 files changed, 33 insertions(+), 33 deletions(-) create mode 100644 after/ftplugin/tsx.vim delete mode 100644 after/ftplugin/typescript.vim (limited to 'after/ftplugin') 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 diff --git a/after/ftplugin/typescript.vim b/after/ftplugin/typescript.vim deleted file mode 100644 index e29d1e41..00000000 --- a/after/ftplugin/typescript.vim +++ /dev/null @@ -1,32 +0,0 @@ -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 diff --git a/after/ftplugin/typescriptreact.vim b/after/ftplugin/typescriptreact.vim index 931839b1..223f77c5 100644 --- a/after/ftplugin/typescriptreact.vim +++ b/after/ftplugin/typescriptreact.vim @@ -1,5 +1,5 @@ if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1) -source :h/typescript.vim +source :h/tsx.vim endif -- cgit v1.2.3