Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

What is the keyboard shortcut to select a word that your typing cursor is currently on ?

For example, if the word I want to select is World, while the typing cursor is between one of the letters of that word such as This Wo|rld is huge, what do I press to select only World ?

share|improve this question

2 Answers 2

up vote 4 down vote accepted

I don't know a single shortcut to select the word, but you can do it in two steps, by first moving the cursor to the start of the word, then select the word.

1) Move cursor to left of word:

⌥←

2) Select word to right of cursor:

⇧⌥→

Of course you could do a similar thing with moving to the right of the word with ⌥→ then selecting the word to the left of the cursor with ⇧⌥← if you prefer.

share|improve this answer
    
That is a good substitute. –  Render Mar 9 '13 at 20:20

You could also create ~/Library/KeyBindings/ and save this as DefaultKeyBinding.dict:

{
    "~w" = selectWord:; // option-w
}

You have to reopen applications to apply changes. DefaultKeyBinding.dict doesn't work in Xcode or some cross-platform applications, but you could use KeyRemap4MacBook as a fallback:

<?xml version="1.0"?>
<root>
<item>
<name>Xcode</name>
<identifier>private.xcode</identifier>
<only>XCODE</only>
<autogen>__KeyToKey__ KeyCode::W, VK_OPTION | ModifierFlag::NONE, KeyCode::CURSOR_LEFT, ModifierFlag::OPTION_L, KeyCode::CURSOR_RIGHT, ModifierFlag::OPTION_L | ModifierFlag::SHIFT_L</autogen>
</item>
</root>
share|improve this answer
    
Ahh I actually wanted this feature to be used in Xcode. THanks though. –  Render Mar 10 '13 at 14:52
    
I'm using the updated version of KeyRemap4MacBook (aka "Karabiner") and couldn't get the XML config to work (OPT-W insists on inserting a greek :sigma: rather than running the macro). However, the DefaultKeyBinding.dict worked fine (OSX Mavericks). –  David Lively Aug 19 at 1:05

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.