Sublime Forum

The only thing I dislike about Sublime Text 2

#1

Self-saving (self-updating?) projects.

I need to add many files from many locations on servers to comprise a typical project. So, I save these as a project.

Sometimes, as I work through the day, I inadvertently open a new file from the Finder (double-clicking it) and now it’s a part of my project.

Conversely, sometimes I will inadvertently close a file that is part of my project. So, to add it back I need to hunt the file down again and re-open it into the project. Just today that happened. I opened a file from Finder and did not realize the current window was a project. So I chose “close other tabs” and my carefully-assembled project file is down the drain, now consisting solely of this new one-off file.

Personally, I’d rather have the option to have Project files be something you need to SAVE YOURSELF. This way, in either of the above instances, I could simply close all windows and re-open my project file and there are all the files I need.

0 Likes

#2

This isn’t a direct resolution to your problem, but to help work with those files that you need to hunt down you might try the FavoriteFiles [1] plugin. If you are opening the same files day after day, this could help you out a lot.

[1] github.com/facelessuser/FavoriteFiles

0 Likes

#3

why it sounds like you are not really using the project feature…

closing tabs doesn’t affect anything in a project.
opening new files when in a project also doesn’t make a difference.
opening new folders does affect the project I think.

so, you sure you saved your folders as a sublime-project?
and you can do (ctrl+alt+p, you are using mac, you may know the equivalence) to switch to it?

0 Likes

#4

Have a look at this plugin that keeps a project-specific history and provides a quick panel with recently closed and accessed files from that project:
github.com/FichteFoll/sublimetext-filehistory

0 Likes

#5

When I drag a folder onto sublime on mac then find and replace all. Then I try to quit. I’m presented with 825 “Would you like to save changes?” Dialog boxes.

How can I get sublime to ask me the OS X way and not present 825 windows? IE The “Save All” button is missing from the dialog.

0 Likes

#6

TL;DR in pink…

@OP I would say this is not so much a Sublime fault as a user error (no offense, just being frank). I thought about this for a few moments after reading it (your post that is), and considered if it were such that one couldn’t open files outside the current dir: that’s just about every IDE worth naming; Aptana, Komodo, Eclipse etc. Okay maybe not every IDE - that’s an exaggeration for emphasis, but I think you get me?

There are IDE’s that require that you assign a dedicated project folder, and won’t allow opening non-project files. A lot, perhaps most of them do: Aptana, Eclipse etc. There’s nothing wrong with that (by the way, isn’t Git, Hg, and in fact most file systems designed to work within, but not outside the current dir and subdirs (think C:/System). Even symlinks do that, we as users know that they are symlinks, but the stupid computer is sort of “fooled” into believing they are in the subdirectory.
But I digress.

I like that Sublime is drag and drop, plug and play and if I have to leave or the computer crashes, I close the window… badaboom it reopens instantly all my files. I do this: have a ‘general’ workspace project that is basically always open, and I actually don’t type IN-BROWSER anymore because if it crashes or reloads the page… my text is gone (on Chrome. I know there is Lazarus and it was brilliant on Firefox, but I find it to be a cache hog on Chrome). This post was written in ST2. I don’t use Word anymore either, if I need it, I type in ST2 then copypaste to Word.
ST2 is my to-do list.
ST2 saved my life. I am grateful. Thank you, ST2!

In my opinion, as a result of my own findings after much trial and error (more error than trial), the most important part of the project consists of two stages:

  1. Literally plotting things out with pen and paper, then
  2. Compiling, as accurately and conclusively as possible the elements, files, media, code, and so on at a dedicated location.

I’m not pointing fingers and saying that you can’t really blame the app for this, but you can’t really blame the app for this.

0 Likes

#7

First let me say that I think you may be confusing the term “project” with “window”. A window is not a project in itself. A project is a folder with a .sublime-project and .sublime-workspace files in it. If you want to know how to create a project, keep reading.

Well that’s easy, change open_files_in_new_window setting to true in your user settings… Now when double clicking a file will always open in a new ST window.

"open_files_in_new_window" : true

That is easy too… press cmd+p and type anything remotely similar to your file name, then press enter. Magic, the file is now open in your project window and it took you less than 2 seconds. This works on the condition that the file is in the project folder, and you have indeed configured a project, not just opened a window with tabs. As skopp pointed out, it’s normal behaviour in pretty much any IDE in the world to work in workspaces which are represented by a project folder.

But ST, being such an amazing IDE, also lets you add a number of different folders to a project. For that you first need to create a project. To do that open a new window with cmd+shift+n, then go to Project/Save project as. Now the folder where you save that file is the project folder, and can access all the files in that folders and sub folders with cmp+p. If you want to add more folders from different locations in your hard drive, you can go to Project/Add folder to project.

If the problem is that you don’t really work in “projects” but in “window views with tabs”, with files from all over your hard drive with no order whatsoever, that is really your very unique way of doing things. There’s no way an IDE will help you there . You could use spotlight, or even better, Alfred or QuickSilver to find the needed file (the one you accidentally closed) in a matter of seconds without never leaving your keyboard.

Alfred alfredapp.com
QuickSilver qsapp.com/

0 Likes

#8

I really like this idea and I tried it out: I created a “general” project and added the following settings to the general.sublime-project file:

"settings": { "hot_exit": true, "remember_open_files": true }
I did this because in my user settings these settings are set to false.
But it doesn’t work: I don’t see my last open files when I reopen the project. Am I doing something wrong here?

0 Likes