Created
February 7, 2012 20:18
-
-
Save d4rky-pl/1761699 to your computer and use it in GitHub Desktop.
Sublime Text Editor split view tabbing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# srsly Klausa... | |
# | |
# { "keys": ["super+shift+["], "command": "split_prev_view" }, | |
# { "keys": ["super+shift+]"], "command": "split_next_view" }, | |
# { "keys": ["super+alt+left"], "command": "split_prev_view" }, | |
# { "keys": ["super+alt+right"], "command": "split_next_view" }, | |
# | |
import sublime_plugin | |
class split_prev_view(sublime_plugin.WindowCommand): | |
def run(self): | |
focused = self.window.active_group() | |
for i in range(self.window.num_groups()): | |
self.window.focus_group(i) | |
active = self.window.active_view_in_group(i) | |
views = self.window.views_in_group(i) | |
for index, item in enumerate(views): | |
if(item.id() == active.id() and index > 0): | |
self.window.focus_view(views[index-1]) | |
self.window.focus_group(focused) | |
class split_next_view(sublime_plugin.WindowCommand): | |
def run(self): | |
focused = self.window.active_group() | |
for i in range(self.window.num_groups()): | |
self.window.focus_group(i) | |
active = self.window.active_view_in_group(i) | |
views = self.window.views_in_group(i) | |
max_index = len(views) - 1 | |
for index, item in enumerate(views): | |
if(item.id() == active.id() and index < max_index): | |
self.window.focus_view(views[index+1]) | |
self.window.focus_group(focused) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment