I am a long time Emacs users trying to modernize and Sublime Text seems to be a very good alternative.
Unfortunately I am running into a problem with a workflow that I use very often.
I am editing file “foo.cpp” and want to open up a second window with a clone view of “foo.cpp” in it so I can edit foo.cpp in both windows simultaneously.
I did many websearches and did find this plugin from Mike Fowler: https://github.com/mikefowler/simple-clone.
I grabbed this code from it and thought everything was solved:
class CloneToNewWindowCommand(sublime_plugin.WindowCommand):
def run(self):
# activeGroup = self.window.active_group() --Matt Bolt: Commented out unused variable
layout = self.window.get_layout()
rows = len(layout'rows']) - 1
cols = len(layout'cols']) - 1
# Clone to new window if requested
self.window.run_command("new_window")
# Open the current file in the new window
sublime.windows()-1:][0].open_file(self.window.active_view().file_name())
Sadly, I discovered that my two views to the file are actually disconnected so the view in one window does
not show changes being made in the other window. It syncs up when you save the file, but that is not good enough.
I have searched in vane for a way to write this in a python script. I cannot find any way to either clone a new view
to a NEW window or to move a view to a NEW window. I know the engine can do this since you can simply drag
a tag into a new window. But I want a key stroke bound to this, tab dragging is cumbersome in comparison.
Please tell me there is a way to do this. Seems like a pretty basic operation.
-Thanks, Derek