Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make ctrl word end or start recognize underscore

In vscode, ctrl + arrow will not stop at an underscore. Is there any way to change this behaviour, or is there a shortcut to select characters between two underscores?

(I have searched through available shortcuts and extensions but could not find any)

Thanks!

like image 611
leo Avatar asked Sep 06 '25 03:09

leo


1 Answers

If you add the underscore to your wordSeparators in the setting Editor: Word Separators, then

  1. Ctrl+rightArrow : move to the next word separator,

  2. followed by another rightArrow to move after that underscore, then

  3. Ctrl+Shift+rightArrow will select all word characters up to the next word separator, which might or might not be the next underscore - depends on your code.

like image 92
Mark Avatar answered Sep 09 '25 19:09

Mark