Skip to content

Instantly share code, notes, and snippets.

@vitaLee
Created June 28, 2012 08:22
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save vitaLee/3009871 to your computer and use it in GitHub Desktop.
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]
w.focus_view(next_view)
@97-109-107
Copy link

Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment