summaryrefslogtreecommitdiffstats
path: root/after/indent/tsx.vim
diff options
context:
space:
mode:
Diffstat (limited to 'after/indent/tsx.vim')
-rw-r--r--after/indent/tsx.vim38
1 files changed, 38 insertions, 0 deletions
diff --git a/after/indent/tsx.vim b/after/indent/tsx.vim
new file mode 100644
index 00000000..dd8ee271
--- /dev/null
+++ b/after/indent/tsx.vim
@@ -0,0 +1,38 @@
+if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
+
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" Vim indent file
+"
+" Language: typescript.jsx
+" Maintainer: MaxMellon <maxmellon1994@gmail.com>
+" Depends: leafgarland/typescript-vim
+"
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+if get(g:, 'vim_jsx_pretty_disable_tsx', 0)
+ finish
+endif
+
+if exists('b:did_indent')
+ let s:did_indent = b:did_indent
+ unlet b:did_indent
+endif
+
+let s:keepcpo = &cpo
+set cpo&vim
+
+if exists('s:did_indent')
+ let b:did_indent = s:did_indent
+endif
+
+setlocal indentexpr=GetJsxIndent()
+setlocal indentkeys=0.,0{,0},0),0],0?,0\*,0\,,!^F,:,<:>,o,O,e,<>>,=*/
+
+function! GetJsxIndent()
+ return jsx_pretty#indent#get(function('GetTypescriptIndent'))
+endfunction
+
+let &cpo = s:keepcpo
+unlet s:keepcpo
+
+endif