Scorb
Scorb

Reputation: 1900

SublimeText3 open header/source

I use sublimetext3 to program C++.

I use multiple window splits with multiple files open.

Sometimes I use alt+o hotkey / switch_file command to open the associated header/source file.

If I hit switch_file command and the matching header/source is already open in the same sub window split, it will jump to that tab instead of reopening the file.

But if I have a header open in one sub window split, and the source open in another sub window split, and I do switch_file command, it will open another copy of the file in the currently focused window.

Is there a way that I can set it to jump to the file even if it needs to focus another window split?

Thanks

Upvotes: 0

Views: 792

Answers (1)

r-stein
r-stein

Reputation: 4847

I think the easiest way to establish this is to change the switch_file command. Install PackageResourceViewer and type PackageResourceViewer: Open Resource, select Default and then open switch_file.

In line 41 just change

self.window.open_file(new_path, flags = sublime.FORCE_GROUP)

to

self.window.open_file(new_path)

and save the file. This will not overwrite the existing file (which is in a zip folder), but create a file, which shadows the original file.

Upvotes: 1

Related Questions