-
-
Notifications
You must be signed in to change notification settings - Fork 213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comment out a portion of a line #10
Comments
Oops, Github escaped by backslashes :) .. Obviously I meant "\iw" and "{Visual}\" respectively. |
I have no such plans. How often does this really come up? I'm trying to think of even one instance of wanting this. |
Mind you, I'm biased because like 90 percent of my code is in languages that only have linewise comments. But that raises the question of what happens in those languages. |
Certainly language requirements dictate comment structure, but also personal coding style can avoid the need for partial line comments. To give you a specific example in C++, I was debugging a remote problem yesterday with the following block:
I needed to bypass out the first two boolean checks, while maintaining the essence if block and bracket syntax. To do so, I was hoping to highlight only part of the first line, press "\", and produce this:
Instead got this:
Naturally I can fix this by hand, but then there's no benefit to using this plugin ;) |
Okay, well, I guess I'm not opposed to it, but I'm not very motivated to work on it either. And I'm kind of worried about how much complexity it will introduce. One thing I am absolutely opposed to is configuration options for separate linewise and inline comments, because this means one of:
Both of those are unacceptable, in my book. Instead, we either have to parse This is a daunting task, so I feel like I should also inform you of tcomment, a commenting plugin that does pretty much everything. |
Is there any way to comment a block instead of comment each line in the block? /*
int x = 3;
int y = 4;
*/
return 0; instead of: /* int x = 3; */
/* int y = 4; */
return 0; |
@Alaya-in-Matrix I think a separate issue is appropriate for a request like that (my comment on it is -- how might user choose which type of comment to apply? global config?) And +1 for this issue. I often find a need to comment out a specific argument to a function call. It's very natural with argtextobj plugin: |
Also would be interested in this, but I also understand that it wouldn't be very simple to develop and maintain |
vim-commentary doesn't support inline comments, while tcomment does. See this PR: tpope/vim-commentary#10
the missing endif had an impact on other plugins loading abilities see: [vim-commentary issue:1109](tpope/vim-commentary#10]
sounds like you could do this with vim-surround instead |
The vim-commentary documentation states three keyboard mapping examples to comment out whole lines of code, but I'm curious there is any plan to extending this plugin to support portions of a line.
Such as, for example, "\iw" would comment out only single word, and "{Visual}" comment out only highlighted words.
I can attempt to tackle this feature myself, but I'm no Tim Pope when it comes to Vim plugins :)
The text was updated successfully, but these errors were encountered: