nerdcommenter
nerdcommenter copied to clipboard
jsx comments
hi scrooloose,
Is there a way to integrate jsx style comments in your plugin?
Instead of
//<View>
I'd like to get
{/* <View> */}
I guess this won't be trivial since you need to detect whether the current line is jsx code or regular javascript. But that would be damn useful!
See #280 for history and discussion of this issue. I'll keep this issue open since it is an outstanding feature request and the other issue was closed when we reverted the original code related to this.
After some searches, I found this feature implemented in vim-commentary but not accurately implemented, so I created this issue there.
What I want to say, I think it is somehow possible to bring this feature to vim.
Oh it's definitely possible, it's just quite a bit of work and doesn't fit well with the current layout of the code in this plugin. I'd love to see it done too because I'd benefit as well, but I haven't had time to implement it myself. Anybody is welcome to, I think if you look at the history this project has been pretty open to contributions. A tad slow reviewing sometimes, but we generally accept things when they are found to be ship shape.
Hopefully this is helpful. I solved this by setting custom delimiters on javascript files, then using
let g:NERDCustomDelimiters = {'javascript': { 'left': '//', 'right': '', 'leftAlt': '{/* ', 'rightAlt': ' */}' }}
A tree-sitter-based plugin did awesome work to support jsx and I'm now happy with it:
Hi @MuhammadSawalhy -- ok, you're saying I need to switch from vim-commentary
to the Comment.nvim to make this work? I added nvim-ts-context-commentstring but that did not fix the issue using vim-commentary
(even though nvim-ts-context-commentstring actually recommends using vim-commentary
...)