sublimehq / sublime_text

Issue tracker for Sublime Text
https://www.sublimetext.com
809 stars 39 forks source link

Temporarily focus on a single group / file #5084

Open beipm opened 2 years ago

beipm commented 2 years ago

Problem description

When working on grown projects, it is not uncommon - at least in my workflow - to have many files open at the same time, making use of Sublime's group functions and layout features.

This can be imagined, for example, as having a code file open on the left and a collection of relevant header files that I consult on the right. Another scenario would be open files with "affected" code areas, also for the purpose of reference, whilst editing a primary file.

However, this leads to the matter that - due to the rather rigid arrangement of files by Sublime - a lot of space is wasted on the screen that is not that relevant when typing on the main file itself.

It would therefore be nice if there were some kind of "distraction free" mode that refers to "inside the window" and allows to focus on a single group or file with easy means to swap back.

Preferred solution

I would prefer it if there were a window-specific "Distraction-Free" variant under "View", which does not protect against distractions on the screen itself, but against distractions in the editor window.

This 'internal distraction-free mode' - I propose the name 'focus view on active group' - is offered by other development environments, such as Netbeans, in the form of a window icon in the tab bar; if you click on it, only the 'view' where you clicked on the icon is temporarily visible. The icon then changes to signify that you are in this mode. All other views are hidden. When you click again on the icon, the former layout is recovered.

For integration in Sublime, I could imagine this as a menu item under View including a hotkey. In the tab bar, an icon could also indicate when this mode is active - and exit it by clicking on it.

Alternatives

It would probably be simpler implementation-wise to offer the option of opening the currently focused file in a new window and linking this to a hotkey as well. The new window should then ideally have the same position and size as the originating window.

This menu item could be placed under File between New Window and Close Window as "Open in a new window".

Additional Information

No response

keith-hall commented 2 years ago

It may be worth trying Origami's zoom function: https://packagecontrol.io/packages/Origami or https://packagecontrol.io/packages/MaxPane

beipm commented 2 years ago

Indeed this is exactly what I want. Thank you very much for that suggestion and your response.

Still, I wonder why this isn't a feature included in sublime itself and if this is intentional, as it would build upon the already given features.