kommentary
kommentary copied to clipboard
Feature request: comment a part of line out
NERDCommenter has the ability to comment out a part of a line. For instance, if I have the following html file:
lorem ipsium dolor sit amet
, and I select ipsum dolor
in visual mode and trigger <Plug>kommentary_visual_default
I would like for it to cause the following:
lorem <!-- ipsium dolor --> sit amet
However, currently this plugin only seems operate on full lines, which causes this instead:
<!-- lorem ipsium dolor sit amet-->
Hi, this would be a really cool feature, unfortunately it would also take quite a bit of time to implement properly.
I don't think I'll work on this anytime soon, however I'd be more than happy to accept contributions..
@b3nj5m1n The primary reason I want this feature is I so that I can create a mapping <leader>C
to comment out everything to the right of the cursor. Perhaps that is an easier feature to implement? Is that something that could be added natively to kommentary?
To illustrate, with the cursor on the first character of dolor
, pressing <leader>C
would cause the following text
lorem ipsium dolor sit amet
to change into this:
lorem ipsium <!-- dolor sit amet -->
For single-line comments one just has to insert the commentstring
at the cursor position, but for multi-line strings like in the example above it's trickier I guess.
+1 for this feature. I use gciw
and gcf,
a lot with https://github.com/tomtom/tcomment_vim (commenting out individual function parameters).
Hi, thanks for your interest in kommentary, unfortunately I'll not be adding any new features, I'm sorry I never got to this issue.
If you're not aware of it yet, take a look at https://github.com/numToStr/Comment.nvim.