Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

vscode select code block doesn't work for python methods

Tags:

I'm trying to use default vscode block selection (alt + shift + ) but it doesn't work for python methods(it selects the whole first line and then go crazy and select whole file). I couldn't find any useful extension. do you have any suggestion?

Update:

as @jill-cheng said currently the best approach is to fold the block using Ctrl + Shift + [ and select the whole line using Ctrl + l

for folding shortcuts refer to https://stackoverflow.com/a/30077543/13877794

like image 564
omid Avatar asked Jul 21 '20 06:07

omid


1 Answers

At present, vscode does not support automatic recognition and quick selection of Python function blocks.

Usually, this function is identified by the '{ }' of the function.

You could use the shortcut key 'Ctrl + L' to select a single line of code. As for selecting the python function block, you can try to collapse it and select it.(Select until the cursor is on the next line.)

For more information:Key Bindings.

like image 178
Jill Cheng Avatar answered Sep 30 '22 01:09

Jill Cheng