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

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.

Related

Renaming project name shown in JetBrains Toolbox

I've recently made a new Empty Project in IntelliJ IDEA and added a couple Gradle based modules to it. The project and the modules are under W:\IJ Workspace\ProjectName directory - the project itself is in W:\IJ Workspace\ProjectName\ProjectName folder, and the modules are in W:\IJ Workspace\ProjectName\ModuleName folders.
JetBrains Toolbox shows the project and its correct directory (W:\IJ Workspace\ProjectName\ProjectName) but the name it displays - is the name of first module I created in the project, not ProjectName. Is there any way to change the name Toolbox is displaying for that project? Or is there a way to manually add a project to Toolbox, forcing it to use its actual name?
Do this while IDE is closed (at very least while that project is closed).
Locate a folder with project settings (.idea subfolder, usually that would be PROJECT_ROOT/.idea).
See if you have .name file there. If not -- create new one.
Open that .name file in any text editor and write desired project name there -- it's a plain text file with a single line of text (no new lines).
Save the file and launch IDE.
Next time you open that project is should use the name from that .name file.
P.S. This works in PhpStorm (where IDE also has a special "Rename Project" action) but should work in IntelliJ IDEA (and other IDEA-based IDEs) as well.

Cannot add Sublime project preferences after opening repo via Github Desktop

I have been happy to notice that Github Desktop lets me open a repo in Sublime Text. It seems to open the repo as a project but I have a hard time figuring out how to edit the project preferences for the repo. Specifically, I would like to add file_exclude_patterns.
I have tried Project > Save Project As... in Sublime, but then when I open the repo through Github Desktop it opens two Sublime windows: one that respects my project preferences and one that ignores them.
From your problem description, it sounds like you might be running into issues with the hot_exit setting. When that setting is turned on (which is the default), then whenever you quit Sublime, it saves the state of all open windows into a session file before it quits.
That session file contains a list of every window that's open, what files are open in each, their scroll position, selection, any unsaved changes to files, and so on. When you restart Sublime, it loads the session file and restores its state back to what it was previously, seamlessly putting you back to where you were before.
One of the potentially unintended side effects of this is that the session is always restored every time you start Sublime. So if you have a project open in a window, and you quit, Sublime keeps a record that you had one window containing that project. If you start it and tell it to open the same project, it will first restore the session and then open the project, resulting in two windows.
As such, turning off hot_exit may solve this problem for you. When it's off, the session information isn't saved, and Sublime starts in a more or less "fresh" state every time. The downside to this is that you will be prompted to save all unsaved files, your list of open files is lost, etc. Depending on your use case, this may or may not be an issue.
If you already have that setting off and this still happens, then the issue would be that GitHub for Windows is opening both the project and the folder, which would result in two windows. In that case there's not a lot to do but poke the people in charge of GitHub for Windows and tell them to fix their code.
On the other hand, if you turn off hot_exit and you get one window, but it doesn't respect your project preferences, then the problem is that GitHub for Windows is only opening the folder, not the sublime-project file.
In that case, there's not a whole lot to be done, unfortunately. Sublime won't load a sublime-project file just because it happens to be contained in a folder, since there can conceivably be many of them in there (many people keep their project files in a single folder, for example).
If Sublime is associated with sublime-project files, then opening the sublime-project file would result in Sublime opening the project for you, so that may be a possibility as well.
Beyond that, you're more or less in the realm of things like using Project > Switch Project or Project > Quick Switch Project to get the window to display what you want; that's not very handy with regards to just opening the project, though.

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.

old file name stuck at the top of sublimetext

Very strange issue here, it's not causing problems but is aesthetically annoying. I had the kindle plugged into my windows machine as to edit the kindle's files. One of the kindle file names is now listed after the name of the python program I'm working on in sublime text. To paint a picture, above the menu drop downs in sublime text, there is the path to the document (IE python program) I'm working on, followed by the random file from the kindle.
The kindle file is no longer on my computer and never had anything to do with sublime text. I've tried restarting the computer and reinstalling sublime text, neither worked. Any ideas what might be going on??? Thanks!
The sublime text window caption shows you the name of the currently open file, followed by the name of the current project in parentheses (if you have a project open at all), followed by the name of the program.
Based on the screenshot in your image:
You currently have the file softmax.py open and it is stored in a folder on your desktop named machine learning\python programs\test\newyorktest\
The name of the Sublime project file is Casting the Circle_A Woman's Book of Ritual_B009FKTQD8_sample.sdr.sublime-project (the caption doesn't show the sublime-project part because that's redundant).
I would imagine that when you set up the project you accidentally chose that name as the name of the project file.
In order to fix your problem, select Project > Save Project As... from the menu and enter a different name for it. The location that you save the file in doesn't matter (it can be inside the folder of your project or in some other location), all that is important is that it has the extension .sublime-project.
Once you pick the new name, Sublime will immediately swap to using the new project file instead of the old one, which will keep your current set of open files, etc, and the caption will change.
You can then seek out and delete the other project file if you want.

How to add an external project to Xcode 4?

I am stuck with an issue of including an project in Xcode 4. I have all the document but it works with Xcode 3 and not Xcode 4.
How to add ZXingWidget.xcodeproj to my project in Xcode 4?
In Xcode 4, you're mostly meant to create a new Workspace to which you can add multiple projects. From the main menu: File > New... > New Workspace...
Once you create your new workspace, drag the Xcode project files into the project navigator of the newly-created workspace. Drop the first one anywhere in the project navigator pane but be careful to note the insertion pointer when you drop the second one. Advice: Drop it beneath the entire first project but with your pointer as close to the left edge of the project navigator panel as you can get. This makes sure you're not inserting a project into another project.
In this way, you get all the benefits of a workspace (automatic dependencies, etc.) without changing the structure of the projects themselves. Then you simply open the workspace rather than the individual projects within it.
Despite that this question had been asked months ago, here is a great resource directly answering it. It worked flawlessly for me (even though I had ARC turned on for the main project I was importing it into).

Resources