Skip to content

Commit 0363df7

Browse files
committed
Add option to disable syntax highlighting for tsx files
1 parent 1e3ac3a commit 0363df7

4 files changed

Lines changed: 14 additions & 0 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ If you still want to use this plugin, make sure that you put this plugin **ahead
9090
9191
|name|default|description|
9292
|---|---|---|
93+
|`g:vim_jsx_pretty_disable_tsx`|0|Disable the syntax highlighting for tsx files|
9394
|`g:vim_jsx_pretty_template_tags`|`['html', 'raw']`|highlight JSX inside the tagged template string, set it to `[]` to disable this feature|
9495
|`g:vim_jsx_pretty_highlight_close_tag`|0|highlight the close tag separately from the open tag|
9596
|`g:vim_jsx_pretty_colorful_config`|0|colorful config flag|

after/ftplugin/typescript.vim

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
" modified from html.vim
22
" For matchit plugin
3+
4+
if get(g:, 'vim_jsx_pretty_disable_tsx', 0)
5+
finish
6+
endif
7+
38
if exists("loaded_matchit")
49
let b:match_ignorecase = 0
510
let b:match_words = '(:),\[:\],{:},<:>,' .

after/indent/typescript.vim

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
"
88
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
99

10+
if get(g:, 'vim_jsx_pretty_disable_tsx', 0)
11+
finish
12+
endif
13+
1014
if exists('b:did_indent')
1115
let s:did_indent = b:did_indent
1216
unlet b:did_indent

after/syntax/typescript.vim

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
"
88
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
99

10+
if get(g:, 'vim_jsx_pretty_disable_tsx', 0)
11+
finish
12+
endif
13+
1014
let s:jsx_cpo = &cpo
1115
set cpo&vim
1216

0 commit comments

Comments
 (0)