diff options
author | Adam Stankiewicz <sheerun@sher.pl> | 2019-12-31 14:05:09 +0100 |
---|---|---|
committer | Adam Stankiewicz <sheerun@sher.pl> | 2019-12-31 14:05:09 +0100 |
commit | b8a5504021e0d21310bc603855ac8107828b5759 (patch) | |
tree | 2f2bf182b686597e7cc4c4f1b7d35881f9993f55 /after/ftplugin/tsx.vim | |
parent | cea0d08a062478503814e51aa21c6486a0dd1b21 (diff) | |
download | vim-polyglot-b8a5504021e0d21310bc603855ac8107828b5759.tar.gz vim-polyglot-b8a5504021e0d21310bc603855ac8107828b5759.zip |
Update
Diffstat (limited to 'after/ftplugin/tsx.vim')
-rw-r--r-- | after/ftplugin/tsx.vim | 32 |
1 files changed, 32 insertions, 0 deletions
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 <buffer> + autocmd CursorMoved <buffer> call jsx_pretty#comment#update_commentstring(b:original_commentstring) +augroup end + +setlocal suffixesadd+=.tsx + +endif |