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

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.

Related

What do I do to make Sublime text stop ignoring filenames that start with a dot

I am using Sublime Text editor and I need to change the settings for Sublime 3 to open files that start with a dot like .gitignore. Please let me know where in the settings I need to make the change. I am using Windows OS fyi.
This isn't a Sublime-specific option, but an operating system one, as the OS determines what is displayed in file dialogs as well as the file system explorer. To set the option on Windows, first open Windows Explorer and navigate to the folder containing the dotfile you want to view. Then, in the View tab, click the Options button on the far right, then select Change folder and search options.
You can also find Options under the File menu.
The Options window will now pop up. Select the View tab, then select the option Show hidden files, folders, and drives. Next, click on the Apply to Folders button at the top.
Similar options are also available on macOS and Linux.

Sublime text group opened files in folders

Can you group opened files in the left "OPEN FILES" panel in folders somehow? Or like tree layout like windows explorer.
You can add folders to the side bar, which you can expand and collapse like Windows Explorer, but there is currently no way to group open files other than to have them in separate windows. However, they are working on functionality in Sublime Text 4 that could enable you to have multiple projects or groups open in one window. ST4 is still very much in alpha status and is not stable enough for everyday use.

Sublime Text 3: How do I have multiple workspaces associated with the same project file?

Say, I have two windows, each containing several open tabs, and I want that "structure" to be viewed as one – either a project or a workspace, I do not care. All I want is to be able to close and then re-open both the windows via a single "open" operation.
As far as I understand, usually a workspace corresponds to one window (possibly with multiple tabs); on the other hand, I've seen it mentioned several times that multiple workspaces can correspond to the same project (file).
How do I achieve that?
If I try to add a new workspace to an existing project via Project → New workspace for project, that seems to work at first, but then if I, say, close the project, close the editor, open a new empty window and use "Open project…" – I end up with just one of my two windows re-opened.
The created .sublime-project file is essentially empty: all it has is "{}". What shall I place there to have two workspaces associated with that one project?
Thank you!
Project or workspace in sublime is essentially about paths, for saying if you are working on the a project in /depot/project_a/..., you can set up a sublime project under /depot/project_a/project_a.sublime-project, then in that project you add "." as your folder. then you can set up another sublime project under /depot/project_a.sublime-project and add "project_a" as your folder in that second project. Sublime text will recognize them as different project although they are literally the same one.
Then you can have 2 windows on the same project but have their own files opened.
I help I explain clearly and it will help you.

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

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

Add an already existing directory to a directory in Solution Explorer

I want to add an already existing directory to a directory in Solution Explorer, but whenever I right-click on the directory and select Add => Existing Item, I can only add individual files, but not directories.
How do I add an already existing directory to a directory inside a Project inside Solution Explorer?
Click the 'Show all files' button at the top of the Solution Explorer and right click the folder desired and select 'include in project'.
Drag and drop the folder from Windows Explorer onto your Visual Studio solution window :)
Source here
or simply copy & paste into solution explorer.
VS 2012 seems to distinguish between 'Solution Folders', which are only folders containing either other solution folders, or containing project folders. The drag-and-drop works (with my settings) only for the project folders, and no for the solution folders.
If I add a new solution folder, nothing happens on the machine. If I drag-and-drop a machine folder to the main Solution, it refuses to accept it. If I drag-and-drop the folder to a Solution Folder, I get an error message saying this cannot be done.
Some other answers are missing an important point: if the folder is not in a project in the solution it is impossible to add the folder
This is the solution:
1) Add a new folder to the sln - it does not care that the folder already exists on the disk because this a virtual folder in the sln
2) Add the file to the folder using "add existing files"
When dealing with a solution level folder that has been removed for some reason, and now needs to be added back, open the .sln file in a text editor like notepad++.
Find your "FolderName" in the section that looks like this...
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NewFolder1", "NewFolder1", "{73ED84FC-F250-4CCC-B267-34CEB67F2883}"
EndProject
Delete from "Project" to "EndProject" ONLY for the specific Project/Folder you're having trouble with.
You may get a message in VS2012 that says your solution has been modified by an external source. Choose the option to "Discard" your changes for the external changes. Lastly, add your solution level folder, and add your project(s) to that folder as existing items, drag/drop them, or copy and paste them, according to your preference.
For those who had a hunch it could be done but weren't able to do it, NOTE: Drag Folder or Files ONTO the name of the Project Name in Solution Explorer in the least
Expand the "Project" item in the menu bar and select "Show All Files". Then locate the folder you wish to add in the Solution Explorer (folders that are not currently included will be light grey with a dotted outline instead of the usual solid icon) right click the desired folder and select "Include in project"
Once finished select "Show All Files" from the Project menu again to return to the regular view.
(This is very similar to Radenko Zec's answer, but does not require the "Show All Files" button to already be present in a toolbar. I would just leave this as a response to his answer, but I don't currently have the reputation to leave comments.)

Resources