Sublime Forum

Pull tab to a new window

#1

Pull out tab from current Sublime window, to became a separate window (new instance of Sublime). So you can move around that window (instance of Sublime).

Ideally a keyboard shortcut for it would be nice.

0 Likes

#2

Dragging and dropping a tab to make a new window has been a long standing feature of Sublime Text. A way to do it from a keyboard doesn’t exist, but could be provided by a plugin.

1 Like

#3

Below is the plugin I use. My apologies to the original author, but I could not find the original post.

import sublime
import sublime_plugin

class MoveToNewWindowCommand(sublime_plugin.WindowCommand):
	def run(self):
		tab = self.window.active_view()
		file = tab.file_name()
		if tab.is_dirty() or tab.is_scratch():
			sublime.message_dialog('You need to save your changes first!')
			return
		tab.close()
		self.window.run_command('new_window')
		new_win = sublime.active_window()
		new_win.set_sidebar_visible(False)
		new_win.open_file(file)

1 Like

#4

It’s working, thanks xD.

0 Likes