Skip to content

Instantly share code, notes, and snippets.

@vitaLee vitaLee/key bindings
Created Jun 28, 2012

What would you like to do?
Cycle group tabs
{ "keys": ["super+alt+right"], "command": "prev_next_view_in_group", "args":{"dir": 1} },
{ "keys": ["super+alt+left"], "command": "prev_next_view_in_group", "args":{"dir": -1} }
import sublime, sublime_plugin
class PrevNextViewInGroupCommand(sublime_plugin.WindowCommand):
def run(self, dir):
w = sublime.active_window()
group_views = w.views_in_group(w.active_group())
views_count = len(group_views)
curr_view = w.active_view()
curr_view_index = w.get_view_index(curr_view)[1]
next_view = group_views[(curr_view_index + dir) % views_count]

This comment has been minimized.

Copy link

97-109-107 commented Feb 26, 2013

Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.