diff --git a/after/ftplugin/typescriptreact/caw.vim b/after/ftplugin/typescriptreact/caw.vim new file mode 100644 index 0000000..293cd3d --- /dev/null +++ b/after/ftplugin/typescriptreact/caw.vim @@ -0,0 +1,16 @@ +" vim:foldmethod=marker:fen: +scriptencoding utf-8 + +let b:caw_oneline_comment = '//' +let b:caw_wrap_oneline_comment = ['/*', '*/'] +let b:caw_search_possible_comments = 1 + +if !exists('b:did_caw_ftplugin') + if exists('b:undo_ftplugin') + let b:undo_ftplugin .= ' | ' + else + let b:undo_ftplugin = '' + endif + let b:undo_ftplugin .= 'unlet! b:caw_oneline_comment b:caw_wrap_oneline_comment b:caw_wrap_multiline_comment b:did_caw_ftplugin' + let b:did_caw_ftplugin = 1 +endif diff --git a/macros/generate-ftplugins.vim b/macros/generate-ftplugins.vim index c1a5c68..173d42a 100644 --- a/macros/generate-ftplugins.vim +++ b/macros/generate-ftplugins.vim @@ -287,6 +287,7 @@ function! s:oneline() abort \ 'tssgm': "comment = '", \ 'txt2tags': '%', \ 'typescript': '//', + \ 'typescriptreact': '//', \ 'uc': '//', \ 'uil': '!', \ 'vb': "'", @@ -406,6 +407,7 @@ function! s:wrap_oneline() abort \ 'tsalt': ['/*', '*/'], \ 'tsx': ['{/*', '*/}'], \ 'typescript': ['/*', '*/'], + \ 'typescriptreact': ['/*', '*/'], \ 'uc': ['/*', '*/'], \ 'velocity': ['#*', '*#'], \ 'vera': ['/*', '*/'], @@ -445,6 +447,9 @@ function! s:additional_vars() abort \ 'typescript': join([ \ 'let b:caw_search_possible_comments = 1', \ ], "\n"), + \ 'typescriptreact': join([ + \ 'let b:caw_search_possible_comments = 1', + \ ], "\n"), \} endfunction