Skip to content

Instantly share code, notes, and snippets.

Created April 19, 2013 06:54
Show Gist options
  • Save anonymous/5418588 to your computer and use it in GitHub Desktop.
Save anonymous/5418588 to your computer and use it in GitHub Desktop.
Sublime Text 2 re-order tab
[
{ "keys": ["ctrl+super+left"], "command": "move_tab", "args": {"mod": -1} },
{ "keys": ["ctrl+super+right"], "command": "move_tab", "args": {"mod": 1} }
]
#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