Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a shortcut for selecting word under cursor in Sublime Text, Atom

Is there a shortcut or a command to select word under cursor in Sublime Text or Atom? I want a replacement for double-click. So I could press shortcut instead and get selection on a current word and start typing to replace it or get in quotes etc...

like image 871
firedev Avatar asked Jul 29 '12 17:07

firedev


People also ask

How do I select all text below my cursor?

Select all text above your cursor: ctrl+shift+home . Select all text below your cursor: ctrl+shift+end .

How do you select a word under a cursor?

Select one word by placing your cursor at one end of the word. Hold down the "Ctrl" key and the "Shift" key. Press the right arrow key to select the word to the right, or press the left arrow key to select the word to the left.

How do you select words in Sublime Text?

Using the Mouse Whether clicking, double clicking to select a word or dragging to select text, you can hold down modifier keys to work with multiple selections: Ctrl to add to the selection. Alt to remove from the selection.

What does Ctrl d do in Sublime Text?

Ctrl + D in SublimeText is "Quick Add Next." This appears to be equivalent to Ctrl + B in Brackets, which is "Add next match to Selection" on the Find menu.


2 Answers

command+d on OSX

control+d on Windows/Linux

You can find all the default keybindings by going to Preferences > Keybindings - Default and perusing the list.

like image 68
Liam Cain Avatar answered Sep 19 '22 14:09

Liam Cain


You can add a key binding to select the word:

{ "keys": ["ctrl+shift+w"], "command": "expand_selection", "args": {"to": "word"} } 

Unlike the find_under_expand command (control+d by default) repeated presses won't add cursors at matching words.

like image 42
CodingWithSpike Avatar answered Sep 17 '22 14:09

CodingWithSpike