trejder
trejder

Reputation: 17495

Key bindings for navigating through selection regions

When you press Ctrl+F, enter some search query and click on Find All (or hit Alt+Enter), Sublime Text 3 will find and select all occurrences of searched term found in current document. It will even count then, writing X selection regions in status bar.

I'd like to add a functionality, where pressing Alt+Left Arrow moves cursor to previous selected region, while pressing Alt+Right Arrow moves it to the next selected region.

I know how to modify Sublime Text 3's key bindings and add own keyboard shortcut, but I have no experience with selection regions in ST3 API, so I don't even know, where to start.

Can someone help here?

Upvotes: 0

Views: 51

Answers (1)

Limon Monte
Limon Monte

Reputation: 54379

You can add your own shortcuts:

  1. Open menu Preferences > Key Bindings - User

  2. Add these lines:

  { "keys": ["alt+right"], "command": "find_next" },
  { "keys": ["alt+left"], "command": "find_prev" }
  1. Save

That's it, now you can use Alt+Left Arrow to move cursor to previous selected region and Alt+Right Arrow to move it to the next selected region

Upvotes: 1

Related Questions