You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I really don't understand how a popular plugin like this wouldn't have a simple way to toggle block comments with one command.
I could use cm to make a multipart comment, and then cu to uncomment, but that's worse, I think, than having a command that would do both instead of the default way for c, which seems to toggle comment line by line.
Is there a way for me to remap c to toggle a block comment?
The text was updated successfully, but these errors were encountered:
The m in \cm doesn't stand for multi-part (or even multi-line) it stands for minimal and is bound to NERDComMinimalComment(). This is a very tricky comment syntax to deal with in most languages. Creating it is easy, but finding them and reversing the state is very difficult to parse. This plugin currently doesn't have enough parsing smarts to handle that. If you'd like to contribute the feature we'd love to have it.
If you are doing development work and need to toggle blocks on and off I can suggest a couple approaches:
Figure out how to the language can be used to guard blocks of code by toggling comments on just one line.
Use the line by line comment syntax. You can still select regions in vim and toggle them all at once, but the single line comment syntax is a lot easier to parse and revert.
Use the "sexy" comment syntax if your language supports it. This usually functions the same way as the minimal block comment syntax but uses extra characters to visually denote the comment block. This makes it a lot easier to parse and find what's part of the same block vs. what might not even be comment syntax at all. Comments created using the \cs command to invoke NERDComSexyComment() can typically be reversed using the \ci binding for NERDComInvertComment(). You don't even have to select the same block, inverting can be done with the cursor anywhere in the block.
I really don't understand how a popular plugin like this wouldn't have a simple way to toggle block comments with one command.
I could use cm to make a multipart comment, and then cu to uncomment, but that's worse, I think, than having a command that would do both instead of the default way for c, which seems to toggle comment line by line.
Is there a way for me to remap c to toggle a block comment?
The text was updated successfully, but these errors were encountered: