A small but surprisingly useful (for me) plugin for navigating between selections:
It scroll the view up/down to show the next selections.
Very useful after a Find All to check if the selections is what you have expected.
Enjoy!
[code]import sublime, sublime_plugin
class NavigateSelectionsCommand(sublime_plugin.WindowCommand):
def run(self, forward=True):
sels = self.window.active_view().sel()
if len(sels) == 0:
return
visible_region = self.window.active_view().visible_region()
if forward:
iterator = reversed(sels)
else:
iterator = sels
next_sel = None
for s in iterator:
if visible_region.contains(s):
break
next_sel = s
if next_sel is None:
if forward:
next_sel = sels[0]
else:
next_sel = sels-1]
self.window.active_view().show(next_sel, True)[/code]
//Navigate Selections
{ "keys": "super+alt+down"], "command": "navigate_selections", "args": {"forward": true} },
{ "keys": "super+alt+up"], "command": "navigate_selections", "args": {"forward": false} }