Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

In Sublime Text, I know Command + D selects the current word and the next occurrence of it when you press the shortcut again.

What I'm searching for is a Sublime Text 3 plugin that assigns the following behavior to a keyboard shortcut:

  1. First shortcut press, selects the current word (Exactly as Command + D does)
  2. Second shortcut press, expands the selection to also include the next word (whatever that word is)

In short, I'm trying to simplify the following:

  • Command + D (To select current word)
  • Alt + Shift + Right arrow to expand selection so it includes the next word
share|improve this question

1 Answer 1

  1. Go to Preferences → Key Bindings ‐ User.
  2. Add below lines to just opened file between [ and ].
    { "keys": ["f1"], "command": "move", "args": {"by": "subword_ends", "forward": true, "extend": true}},
    { "keys": ["f1"], "command": "find_under_expand", "context":
        [
            { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
        ]
    },
    
  3. Change f1 to any other shortcut key, if you want.
share|improve this answer

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.