Sublime Forum

Shortcut to select mutiple words


Let’s say I have the below code:
Hello, world!
Hello, how are you?

Now if I want to select the word “Hello”, I could place my cursor anywhere on the first “Hello” and press

To select the next “Hello”, I know I can press CTRL + D again, but I sometimes want to use my cursor to select it. I can press CTRL and place my cursor at the end / last character of the second “Hello”.

My question is how to select the same word after the selected word previously ( the first “Hello” ) no matter where I place my cursor on the word just like when I select the first “Hello” by the command CTRL + D?



I’m unsure of what you’re trying to achieve here, but ctrl+d will select the word under/touching the cursor or the next instance of the last selected text; so in your example you can press ctrl+d to select the word even if the cursor is at the end of it.



CTRA + D would be able to select the word. I mean if there is a “cursor” way to do this. For multiple cursors, we can hold CTRL and click on the new character of the word.

Now is it possible to select the word automatically no matter where I place my cursor on the word instead of placing the cursor on the last character of the word?

For example, assume | is our cursor. When we press CTRL + D now on H|ello, it would select the whole word “Hello”, it will work no matter where the cursor is, like He|llo, Hel|lo, Hell|o.

But how do we select the entire word with one click only, like placing the cursor after the character “H” H|ello then left/right click and it will select the entire word?

In my example, assume the code is
Hello, world!
Hello, how are you?
Hello, select me.

After I have selected the first “Hello”, Sublime Text will highlight all the same words, now I only want to select the first and third line, pressing CTRL + D is not ideal in this case, instead normally we would hold CTRL and click on the last character of the third “Hello”.

I believe I already explained this very clearly.



There’s no default way to do that; the standard in applications (including Sublime) is to double click to select, not single click to select.

In your case I would ctrl+d, then ctrl+click on the third one and ctrl+d again, or ctrl+d to select the first one, then ctrl+k,ctrl+d to skip the second one and ctrl+d to select the third one.