Sublime Text 3: how do you configure the display and/or sorting of the Window menu? - sublimetext3

If you open a couple folders in Sublime Text 3, you'll see entries for each folder added to the Window menu. It appears that the default format of each entry on the menu is:
(active-filename) - (foldername)
The list on the Window menu is sorted alphabetically starting with (active-filename). Whenever you select a file to work on, the (active-filename) part of the entry changes, and the list reorders itself. If you have a dozen Windows open, the position of a given window in the list will change all the time as you work with files. This makes it hard to find a window when repeatedly switching between Windows.
Is there a way to configure Sublime Text 3 to display only the folder name in the list on the Windows menu? Alternatively, is there a way to configure it to sort on folder name and not on the ever-changing "active" filename?

Unfortunately there open issues around this but no attention form the SublimeText Team yet
https://forum.sublimetext.com/t/alphabetize-window-menu-by-folder-not-file-name/13017/4
https://github.com/SublimeTextIssues/Core/issues/1972
https://github.com/SublimeTextIssues/Core/issues/1445
https://github.com/SublimeTextIssues/Core/issues/1179

Related

Is it possible to split windows without showing tabs in the middle?

If I split the IDE into 2 sides, the tab list is duplicated. Is there any way to hide the one in the middle of the screen, to save space and make it easier to compare the 2 files?
Sure. I can see a few possible options actually.
1. Use more appropriate Compare Files functionality: look for Compare with... action in the context menu.
For example:
Locate and select 2 files in the Project View, use context menu and choose Compare Files action.
... or select one file and use Compare with... -- now point to the 2nd file via file chooser dialog.
... or copy contents of one of the files into the Clipboard and then use Compare with Clipboard... in your Editor context menu (currently opened file).
NOTE: You can edit/merge files in Differences Viewer screen; when you exit it the changes will remain until auto-save or manual Save is called.
2. Do not display list of the opened tabs on the right side: put it at the top/bottom or temporarily hide it completely (until you are done with your comparing task).
You can change the tabs position quickly at any time via Help | Find Action... (or Search Everywhere via Shift + Shift) and search for tab placement -- it can then be changed right from there without the need to go into the Settings/Preferences screen (use the appropriate ON/OFF toggle).

Sublime sidebar create a custom menu

Is there some way to add a new menu to the sidebar?
Right now, I have the following menus in the sidebar:
OPEN FILES
FOLDERS
Would it be possible to add a new custom menu above those two that would then have multiple child-menus? These child-menus would be used to run various commands or scripts that would manipulate the selected text or the currently open file.
For example:
MY CUSTOM MENU
Sort selected text
Insert gibberish text
Open command prompt
OPEN FILES
FOLDERS
While it's possible to add context menu entries to the files and folders that appear in the side bar already, the side bar is not customizable such that you can add new sections or content, or even change the order of the items that already appear.

Sort project folders in alphabetical order in Sublime Text 3 sidebar?

In the Sublime Text sidebar is there a way to have project folders displayed in alphabetical order, instead of by the order that the folders were added.
This is driving me nuts. I've searched everywhere for this and have given up, but it's so painful.
The contents of side bar folders are displayed in a sorted (lexical) ordering, with all sub-folders brought to the top instead of being in their natural sort position. There is currently no setting available or internal API that allows for changing that.
That said, the ordering of top level folders that you have manually added to your project is entirely under your control and defaults (as you've noticed) to the order that they were added in.
The folders in the sidebar are listed in the order that they're listed in the folders section of the sublime-project file. You can use Project > Edit Project to open your project file and manually reorder the elements in the folders list.
Additionally you can also click and drag the top level folders to change their relative ordering. Doing so causes Sublime to automatically rewrite the project file for you.
If the Project > Edit Project setting is not enabled, you haven't saved the current session as a project yet. In that case there will be no project file until you create one, but you can still drag to reorder the folders.
You can use sublime plugins for this. One that I can think of is SortTabs
In Sublime Text 3, if you have "Project Manager" installed use it to CLEAR RECENT PROJECTS. Then when you look for a project to open with Ctrl-Alt-P, they will be in alphabetic order.
To install "Project Manager" on the menu go to Preferences-Package Control, then click on Install Package. Scroll to find "Project Manager". Click on it to install. Restart Sublime Text. It will be on menu at bottom of Projects.

Sublime Text: delete file in group?

I'm looking for a way to delete from the system (not just remove from the opened session) a given file, within Sublime 3 (3103).
The file in question is opened in Sublime, and shows in the sidebar in a Group.
I've installed the Sidebar Enhancements but this only adds the option, in the context menu, to delete a file that is opened within a Folder.
For files in Groups, right clicking on its name in the sidebar only shows the options: Close, Close Others, Close Others Below, New File, Open File.
Is there some way of performing this rather simple task that I might be missing?
Try:
TabsExtra
It gives you the ability to delete files from tab right-click menus.

How to open Sublime Text files in window based on extension?

Is there any way to get Sublime to open all files of a certain extension in the same window? For example, when using a 2x2 grid, I'd like to keep all SCSS files in the upper left, all HAML in upper right, JS lower left and search in lower right. I'd like to use the search function, and have files go to the other three tabs instead of the search window each time.
I've tried the 'open in relevant window' plugin and it doesn't appear to make any difference.
When opening lots of files it gets very tedious opening them and having to manually move them to a window that wasn't active when opening.
Edit: I'm working on a Mac, so I'd need something that works there, or preferably cross platform.
Edit: Op is working on a Mac, I'll leave this in case any windows users are interested in this solution.
---
Perhaps an extra shell extension would help.
If you're familiar with the Registry, you can create a new key that opens all selected files in a new window. Simply create a modified version of what Sublime Text already has.
The existing key for Sublime Text exists here:
HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text\command
With the default value of (depending on version):
C:\Program Files\Sublime Text 3\sublime_text.exe "%1"
You could create a new key like so:
HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text (new window)\command
Then add the -n arguement to the default value:
C:\Program Files\Sublime Text 3\sublime_text.exe -n "%1"
This will create a new window every time you use the shell extension to open files and will keep multiple files organized in the same window.
To take this a step further, if you have any programming experience you could create your own shell extension which takes a list of files and groups them for you, which then in turn can create the new windows programmatically.

Resources