Multiline Text Single Line Comment And Support Nested Comment (for HTML, JSX, Vue, CSS, XML, XSL and Markdown)
This extension enhances the comment functionality of VS Code for HTML, JSX, Vue, CSS, XML, XSL and Markdown files.
Call the "Add Comment" command on multiple lines and each line will get its own block comment.
If you add a comment to a line which already has a comment, the opening and closing block will be replaced.
The "Toggle Comment" command checks if all selected lines are comments and then adds or removes block comments.
For all other file types the corresponding vscode built-in comment commands are invoked.
Configuration
Keybindings
the following keybindings: Starting with Enhanced Comments
Indentation Mode
There are three different indentation modes:
global(default,this can prevent the appearance of prettier eslint problem): The comment starts for each line at the position where the first non-whitespace charakter of the first marked line is.
individual: The comment starts at the position where the first non-whitespace charakter is. This is computed for each line individually.
add indent of first line: The comment starts for each line at the position where the first non-whitespace charakter of the first marked line is. Additionally the indent of the first line is added to every line.
You can specifiy it in the settings:
Known Issues
Only use the same comment style in the same file. so embedded CSS and JavaScript Code in HTML is not supported. But I don't think this is a big problem. You can use this plugin's features wherever needed. In other places, you can use the vscode built-in comment commands.
The global indentation mode does not work properly, if you use whitespaces and tabs for indentation at the same time.