Sublime Forum

Dev Build 2103

#1

Dev Build 2013 is out now, with some changes to project handling.

Projects are now split into two files: a user editable .sublime-project file, and an opaque .sublime-workspace file. .sublime-project files contain information on the folders and settings in the project, while the workspace file contains all the session related data. A .sublime-project file looks something like this:

{
	"folders":
	
		{
			"path": "src",
			"file_exclude_patterns": "*.lua"]
		},
		{
			"path": "/C/data/reference"
		}
	],
	"settings":
	{
		"tab_size": 8
	}
}

A few comments on this:

  • Paths may be relative (to the .sublime-project file location) or absolute, but must be in a unix style on all platforms (e.g., “/C/Windows” rather than “C:\Windows”)
  • Folders may have keys “file_exclude_patterns” and “folder_exclude_patterns”. These are combined with the global settings of the same name.
  • “settings” are file settings, and will take precedence over user file settings, but not syntax specific file settings. Any settings will apply to all open files in the project’s window.
  • Editing the project via the UI (e.g., dragging a folder onto the window) will cause the .sublime-project file to be rewritten. If you’d like to preserve your comments and formatting, you’ll have to avoid doing this.
  • Existing .sublime-project files will be converted into two files on load. You shouldn’t lose any data when this happens, but I’d recommend backing them up in any case.

I’m planning to also make a change in a future build, where opening a project (via Project/Open Project and Project/Recent Projects) will open it in a new window. The Switch Project menu item will change the project in the current window.

Let me know what you think!

0 Likes

#2

I’d like it if you could just hold the ALT key when selecting a project from “Switch project” menu and it would cause it to open in a new window. Like in chrome when you enter an address in the bar but want it to open in a new tab.

0 Likes

#3

firefusion’s suggestion makes sense, but I also like how it is now. Switch project is intuitive enough, and opening a project should open it in a new window, so I really don’t know… Personally I think I ll be using the second one.

also, thanks for the implementation of the fallback_encoding!!

0 Likes

#4

What’s the difference between “path” and “mount_points” ?
My project was converted to this:

[code]{
“folders”:
{
“mount_points”:

		"/D/DB",
		"/D/C"
	],
	"file_exclude_patterns": "*.dcuil"]
}

}[/code]
and the file_exclude_patterns doesn’t look to work.

Apart this issue, these additions to the project configuration is exactly what I need.

Make sense. If you have to work with more than one project at the same time, it’s better to have each project in it’s own window.

0 Likes

#5

+1

0 Likes

#6

mount_points is the old format. Both work, but if you want to use file_exclude_patterns, you’ll need to use the “path” style for folders, as the example above does.

0 Likes

#7

The Package Control plugin doesn’t seem to work anymore? Coincidence.

0 Likes

#8

Is it possible to exclude folders by path, not by pattern? (as in: exclude /somefolder/xyz, but not /someotherfolder/xyz)
Patterns exclude all “/xyz” in a path.

0 Likes

#9

Ah, finally the project-based file/folder exclusion pattern. It looks like I can give ST another try!

0 Likes

#10

Unfortunately I was not aware of some of the interaction between the Packages, Installed Packages and Pristine Packages folders. Because of this, after the automatic upgrades that went out for Package Control yesterday, Package Control will be deleted off of everyone’s machine the next time Sublime Text starts. So the coincidence is that you didn’t restart Sublime Text until the upgrade.

0 Likes

#11

While I do appreciate some of the design ideas behind ST2’s approach to projects, I still believe that the project system is overall quite complex, and that the complexity isn’t adding value. I’d like to offer a little constructive criticism.

The obvious comparison point is TextMate. And I know you’ve probably thought about this more deeply than I have, since I’ve only been a user, and you’ve actually had to do the implementation work. But look what the TextMate project system offers:

  1. Instant “project-lite”: just run ‘mate .’ in some directory and work with that directory’s files in a new window. This is what people want at least 75% of the time. No project file at all. Note that it’s easy to open as many of these windows as you want.

  2. Next step: the ability to turn that view into a project file, by doing “save project as”, under the File menu. This is where the power users get started. Once a project exists, it’s easy to get back to, because “open” a folder, “open” a file, or “open” a project file in TextMate are all mapped to the same “open” in the file menu. Any number of projects can be open at a time. Simple.

  3. Ability to set up a file & folder pattern for a project, to do filtering. Power users are now fairly happy.

With these 3 features, the system of setting up and accessing projects is simple, understandable, robust, and it pleases most folks. The “File” menu contains all the needed operations, by the way, which isn’t many.

(Aside about searching: the 2 kinds of search scope in Textmate (search in file & search in project) are probably all that’s really needed. I’m not sure that ST2’s extra scopes (“search in open files” & “search in open folders”) add value that outweighs the clutter of their presence.)

I would seriously consider adopting something much more like TextMate’s project approach as a starting point, and then seeing if there are ways to improve it. (You may not find that it needs a lot of improvement, unless there is something truly new to offer, which I personally haven’t seen yet.)

Having said all that: fantastic software so far and thanks for your efforts! This is turning into a great editor that could really have a huge user base.

0 Likes

#12

[quote=“sandover”]1. Instant “project-lite”: just run ‘mate .’ in some directory and work with that directory’s files in a new window. This is what people want at least 75% of the time. No project file at all. Note that it’s easy to open as many of these windows as you want.

  1. Next step: the ability to turn that view into a project file, by doing “save project as”, under the File menu. This is where the power users get started. Once a project exists, it’s easy to get back to, because “open” a folder, “open” a file, or “open” a project file in TextMate are all mapped to the same “open” in the file menu. Any number of projects can be open at a time. Simple.

  2. Ability to set up a file & folder pattern for a project, to do filtering. Power users are now fairly happy.[/quote]

For #1, please see sublimetext.com/docs/2/osx_command_line.html if you are on OS X. Linux users get this via the sublime_text command if their Sublime Text 2 folder is in their path.

For #2, see the Project menu and select “Save Project As…”

For #3, it sounds like this was just implemented in build 2103, however I have not actually used it.

0 Likes

#13

@sandover
Its not specifically stated in the forum patch notes (it does on the dev download page), but as of this release, you can open a folder on the command line now in a “project-lite” fashion.

*Passing folders on the command line will open them in a new window by default

Then you can save it as a project.
File and folder patterns can then be added to the .sublime-project file with file_exclude_patterns and folder_exclude_patterns.

Guess I don’t see which of those features is missing.

Edit: wbond beat me to it :<

Edit 2: btw I’m using windows 7 64 bit and the command line opening works for me

0 Likes

#14

I think there is a memory leak with this version. I have only a few small html files open… here’s a screengrab of Activity Monitor (the CPU in this grab is really low but it had been consistently at around 100%): cl.ly/9XfK

Let me know if you need more info

0 Likes

#15

What plugins do you have installed? I’m not seeing any memory/CPU usage like that myself, btw.

0 Likes

#16

I think I figured out the problem, I checked the console & it said jshint was not loading or something. I found it within the SublimeLint package, then removed the package & it seems to be fine now.

The other major packages I am using are: Package Control, SublimeCodeIntel & ZenCoding.

I’ll update this if the problem occurs again

0 Likes

#17

Using the current (or recent) builds, here’s something to try:

  1. Close ST2 – with project X open
  2. cd into folder A and do “sublime_text .”
  3. Result: ST2 opens project X, including any files that were open, and adds folder A into it under the “folders” area. Was that expected/intended?

Now something else to try:

  1. Close the project, make it go away, so there are no files of folders in the sidebar. (Pop quiz: how? There’s no “close project” command)
  2. Close this “clean” edition of ST2
  3. cd into folder A and do “sublime_text .”
  4. Result: the straightforward and expected behavior. BUT…
  5. Now close ST2.
  6. cd into folder B and do “sublime_text .”
  7. Result: both folder and A and folder B are in the sidebar! Why??

In order to predict what ST2 is going to do at any point here requires quite some real thinking. If you have spent any time with Textmate, you know that the mental model around projects and folders is much more straightforward. I’m claiming that that is incredibly valuable – and has the advantage of probably being much easier to implement than ST2’s project feature with its many menu commands (with commands like “close project” still MIA).

0 Likes

#18

Running into an oddity with the naming of the sublime-workspace file. My project file is named .sublime-project and it’s naming the workspace file .sublime-project.sublime-workspace. Is this intended? If it is would it be possible to have it named .sublime-workspace instead?

0 Likes