Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Selection multiple variables or types with different lengths in vscode

So imagine I have mutiple lines of variable and their definitions in multiple lines like this (for example in flutter) :

 TypeA a;
 TypeABCD abcd;
 Typ abcdefghijklmnopqrstuwxyz;

now I want to select all of the types together or all of the variables together; I know how to select multiple line together in vscode but the problem is in this case it does not cover the specific selection of them or it selects them partly because they have different lengths. how can I select multiple variables or types or whatever in this case?

imagine what I want to select is:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

a 
abcd 
abcdefghijklmnopqrstuwxyz 

how can I do that?

or this:

TypeA
TypeABCD
Typ

>Solution :

You can press "option" on Mac or "ctrl" on other OS to navigate cursor by word and not character.

So the trick is to do multi-cursor on each line then use word navigation to select what you want – press Ctrl + Shift + -> for example to select first word in each line even if words are of different length.

Its pretty hand and I use even more complex tricks to be productive, hope this helps.

Below is video showing the same.
https://drive.google.com/file/d/1mrw3jyhk6NEtWg4Y5p7eK5dCPCnbA8ln/view?usp=drive_link

Sample image
enter image description here

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading