Sublime Forum

Alphabetize Window menu by Folder, not File, name

#1

How can I get the Window menu to list the Folder/Files by Folder name, then File name? With 20+ Windows open, it is incredibly frustrating that the Window menu items are never in the same place, and Ctrl-tilde switching can get tedious with that many Windows.

What I see: dropbox.com/s/1zcx898zblixz … .41.10.png

I’m editing api.js, and switching between a few different projects to build this one. I’m on a tiny screen, so having multiple columns is not practical, and with the existing alphabetization it is hard to find the right api.js file (so many projects with that file open).

I was told to use Projects, but that requires me to create a Project for every single folder I want to open in Sublime, which would be ridiculous.

Appreciate any advice. I’m looking at creating a plugin, but that seems like overkill for this situation. I’d probably need to create an entirely new Menu item, populate it with all the open Window names, and then figure out how to trigger the display of that Window.

I’m on an updated Mac Air. Thanks!

0 Likes

#2

I run into this exact situation literally 100’s of times per day. I have many windows open all the time, and the list on the Windows menu sorts by filename, and so the position of a window on the list changes constantly as I switch between files within a folder. Is there any way to edit the template that creates the Window menu? I looked in the Default package, unzipped it, and found pretty much every menu except the Window menu! Where is it hiding? And more importantly, if I stripped out the filename from the display, would it even matter, or would it just keep sorting on some internal value of “filename + foldername”? When it comes right down to it, I don’t ever need the filename. The folder name tells me what window I want.

0 Likes

#3

The Window menu just doesn’t need the filename. Keep it simple and strip it down to just the folder.

0 Likes

#4

Checking across my Windows, Linux and MacOS computers my guess would be that the Windows menu is something specific to MacOS since it’s the only OS where such a menu appears. Potentially this is the reason why it’s not listed in Default/Main.sublime-menu. I don’t know if it’s something that the OS just forces into the menu or if Sublime itself is implementing it there, although I would assume it’s Sublime doing it since there are other slight menu changes that are MacOS specific (location of Preferences and About Sublime, for example).

In any case it looks like the menu is listing the windows based on the caption of the Window itself, so it would appear the the crux of your issue is that you need some way to modify what the title bar lists and not how the menu is sorting itself.

There is an issue on the issue tracker for that, so you may want to chime in there to include this as an extra use case for the change:

1 Like

#5

Thanks for the additional info, OdatNurd! That gives me a new line of reasoning to see if I can get the behavior of the Window menu to change – and if I can’t, I’ll add a comment to the Issue you referenced.

0 Likes