summaryrefslogtreecommitdiffstats
path: root/after/ftplugin/jsx.vim
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2020-09-10 10:30:32 +0200
committerAdam Stankiewicz <sheerun@sher.pl>2020-09-10 10:30:32 +0200
commitfb7cf8a9ab782d67db5aa71bffac67e63fcc0c4c (patch)
tree9b41186c43daaacf5b6d1cee71f8bde4dbc8edf2 /after/ftplugin/jsx.vim
parent19a69cf77d521d6f3856d2f5c1a2faa678b937ba (diff)
downloadvim-polyglot-fb7cf8a9ab782d67db5aa71bffac67e63fcc0c4c.tar.gz
vim-polyglot-fb7cf8a9ab782d67db5aa71bffac67e63fcc0c4c.zip
Update
Diffstat (limited to 'after/ftplugin/jsx.vim')
-rw-r--r--after/ftplugin/jsx.vim35
1 files changed, 35 insertions, 0 deletions
diff --git a/after/ftplugin/jsx.vim b/after/ftplugin/jsx.vim
new file mode 100644
index 00000000..94f90c13
--- /dev/null
+++ b/after/ftplugin/jsx.vim
@@ -0,0 +1,35 @@
+if !exists('g:polyglot_disabled') || (index(g:polyglot_disabled, 'javascript') == -1 && index(g:polyglot_disabled, 'jsx') == -1)
+
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" Vim ftplugin file
+"
+" Language: javascript.jsx
+" Maintainer: MaxMEllon <maxmellon1994@gmail.com>
+"
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+" modified from html.vim
+" For matchit plugin
+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:jsx_pretty_old_cms = &l:commentstring
+
+augroup jsx_comment
+ autocmd! CursorMoved <buffer>
+ autocmd CursorMoved <buffer> call jsx_pretty#comment#update_commentstring(b:jsx_pretty_old_cms)
+augroup end
+
+setlocal suffixesadd+=.jsx
+
+endif