ST2 is rapidly doing what no edit has managed to do for years: replace TextMate. But there is one part of it that feels a lot less complete and at times downright wrong than the rest: The sidebar (and, to a lesser extent, the projects concept).
Let’s illustrate with an example. I’m in a (Python/Buildout) project directory, which has some files I want to be editing at the root (*.cfg) and some source code in a subfolder (src/). It also has a lot of stuff I don’t want to have in the project (a huge parts/ directory for example).
To start working with this, I might do:
$ cd the-project $ subl -n .
This means I get a sidebar with a “Folders” tree containing only one folder (“the-project”), which I then have to expand every time. That’s two superfluous levels of expand/collapse. It also brings in everything unless I do a global exclude of e.g. ‘parts’.
So, I might instead try:
$ cd the-project $ subl -n *.cfg src/*
Now I have only the files and folders I want to work on. The sub-folders of src/ are under the Folders tree, and the top-level files are in the Files tree. But wait - all the files are open. I don’t want to work on them right now, I just need them there so I can search across them and maybe edit them later. Let’s close their tabs.
D’oh! All the files disappear from the Files tree.
There are a few things that feel “wrong” here:
The “Files” list is just the same as a list of open tabs. This is neither obvious nor terribly necessary. (If there are too many tabs to show, most applications would turn the last tab into a drop-down list of all or the hidden tabs).
There is no way to have top-level files in a project. The files in the “Files” list are not really part of the project (unless they also happen to be in a folder under Folders)
The distinction between “Files” and “Folders”: why do I care? It’s obvious from the expand/collapse icon (or lack thereof) to the left of the file/folder name
I think with relatively small tweaks, this situation could be made more logical:
Rename “Files” to “Open files”.
Introduce an option to hide the “Open files” list, next to the option to show/hide the tabs bar.
Rename “Folders” to “Project contents”
Let this contain both top-level files and folders
If the ‘subl’ command line option is passed a single file, open it in a new tab; if it’s passed a directory and/or multiple files or a directory and one or more files, open a project with no files open (no “untitled” tab either!). (This is basically how the TextMate ‘mate’ command works, and I think it’s quite sensible.)
Ensure it is possible to easily search across all files in a project (whether under a top level folder or not)
There are two other improvements that would also make sense:
Make it possible to use the arrow keys to navigate the sidebar folder tree
Make it possible to hide folders/files on a per-project basis by right-clicking on the relevant file/folder and choosing to remove it from the project (but not from disk). This is currently only possible in a top-level folder.