Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use Ctrl+Click to Select Word in VS Code

In Visual Studio, if you hold CTRL and click on word, it selects the entire word. If you drag, it selects text word-by-word.

I find this feature of Visual Studio very useful when I'm copy pasting small bits of code, since I can just keep holding CTRL, select words, and press C, X, or V to move stuff around.

In VS Code, you can't do this. Instead, CTRL+CLICK is bound to "Go To Definition".

Is there any way to match the behavior of VS Code with Visual Studio in this context?

like image 711
Zeenobit Avatar asked Apr 15 '17 16:04

Zeenobit


People also ask

How do you select a specific word in VS Code?

Ctrl+D selects the word at the cursor, or the next occurrence of the current selection. Tip: You can also add more cursors with Ctrl+Shift+L, which will add a selection at each occurrence of the current selected text.

How do you select a word in Visual Studio?

SelectCurrentWord as 'Ctrl + W, Ctrl + W'.

How do you select and move text in VS Code?

For moving the text right and left you can use TAB key: TAB move the selected text right. SHIFT + TAB move the selected text left.


1 Answers

As @phuzi said in the comments you can use double click to select the word or double click and drag to select word to word (it will snap on the last character of each word). If you triple-click on a line or click on line num, it will select the whole line (with the invisible character at last '\n').
If you press CTRL + D it will select the word where the cursor is. Also if there are multiple instance of same word you can select them all one after another using CTRL + D.

like image 117
Saad Saiyed Avatar answered Oct 11 '22 05:10

Saad Saiyed