Alexander Solonik
Alexander Solonik

Reputation: 10230

vscode quickly select and comment code block without using mouse

Hi guys suppose i want to comment the below code in vscode

files_converted.forEach( ( item , idx ) => {
        zip_Directory( `${req.body.outputPath}/${item}` ,  `${req.body.outputPath}/${item}.zip` );
    })
    .then( () => {
        console.log('FILES CONVERTED AND ZIPPED !')
    }).catch( (err) => 
        { console.error(err) 
    }); 

Is there anyway of quickly selecting and commenting out the above code without using the mouse ? The comment style i prefer is ( /* some comment here */ ).

Upvotes: 0

Views: 1147

Answers (2)

Eric
Eric

Reputation: 575

for bracket selection, use this...

https://marketplace.visualstudio.com/items?itemName=dbankier.vscode-quick-select

for block comment, use Shift+Alt+A

Upvotes: 0

ChatterOne
ChatterOne

Reputation: 3541

  • To select something inside curly brackets, you can use smart select. The idea is that you can select the text inside curly brackets and "expand" the selection or "shrink" it. The default keyboard shortcut on Mac is Ctrl+Shift+Cmd+Right Arrow to grow and the left arrow to shrink.

  • To use block comments instead of line comments you can use ... well, the "block comment" function :-P Which by default is Command+Option+/ on Mac.

Upvotes: 3

Related Questions