Created
April 19, 2013 06:54
-
-
Save anonymous/5418588 to your computer and use it in GitHub Desktop.
Sublime Text 2 re-order tab
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
Show hidden characters
[ | |
{ "keys": ["ctrl+super+left"], "command": "move_tab", "args": {"mod": -1} }, | |
{ "keys": ["ctrl+super+right"], "command": "move_tab", "args": {"mod": 1} } | |
] |
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
#http://www.sublimetext.com/forum/viewtopic.php?f=2&t=5897 | |
import sublime_plugin | |
class MoveTab(sublime_plugin.TextCommand): | |
def run(self, edit, mod): | |
view = self.view | |
window = view.window() | |
group_index, tab_index = window.get_view_index(view) | |
view.window().set_view_index(view, group_index, | |
(tab_index + int(mod)) % len ( | |
view.window().views_in_group(group_index)) ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment