From 2504a3d84e97be144019ef184f0c2aed42f3152d Mon Sep 17 00:00:00 2001 From: impulse Date: Tue, 27 Aug 2019 12:58:11 +0200 Subject: [PATCH] Add comment styles for React filetypes .jsx/.tsx (#393) Note that to-date there has not been an official vim filetype for React-Javascript and React-Typescript. The `javascriptreact` and `typescriptreact` filetypes were added upstream to both Vim (8.1.1890) and NeoVim during the course of discussion on this PR. Some other Vim plugins are known to use filetype hacks such as `javascript.jsx` or `typescript.jsx`. This plugin supports the now official upstream designations. If this conflicts with your usage you can either tweak the other plugins (and/or submit a fix to use the official filetypes upstream) or add custom file type comment setting in your vim rc/init file. Co-Authored-By: Caleb Maclennan --- plugin/NERD_commenter.vim | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugin/NERD_commenter.vim b/plugin/NERD_commenter.vim index c13ef9d..0e27d24 100644 --- a/plugin/NERD_commenter.vim +++ b/plugin/NERD_commenter.vim @@ -237,6 +237,7 @@ let s:delimiterMap = { \ 'java': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' }, \ 'javacc': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' }, \ 'javascript': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' }, + \ 'javascriptreact': { 'left': '//', 'leftAlt': '{/*', 'rightAlt': '*/}' }, \ 'javascript.jquery': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' }, \ 'jess': { 'left': ';' }, \ 'jgraph': { 'left': '(*', 'right': '*)' }, @@ -451,6 +452,7 @@ let s:delimiterMap = { \ 'twig': { 'left': '{#', 'right': '#}' }, \ 'txt2tags': { 'left': '%' }, \ 'typescript': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' }, + \ 'typescriptreact': { 'left': '//', 'leftAlt': '{/*', 'rightAlt': '*/}' }, \ 'uc': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' }, \ 'uil': { 'left': '!' }, \ 'upstart': { 'left': '#' },