0

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

1 Answer 1

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .