Home Download Buy Blog Forum Support

Create a new file in a directory?

Create a new file in a directory?

Postby pkulak on Thu Mar 10, 2011 7:24 pm

This is the one big issue that I'm having, and I can't seem to figure it out. I'm using Sublime Text 2 for Mac and when I want to make a new file in some directory, right clicking on the directory doesn't give me a menu, and clicking File -> New just gives me a new scratch file which I have to save by navigating the whole tree down to the folder that I want. Is there some really easy way to do this that I'm missing?
pkulak
 
Posts: 3
Joined: Thu Mar 10, 2011 7:17 pm

Re: Create a new file in a directory?

Postby guillermooo on Thu Mar 10, 2011 7:32 pm

You could do the following until that kind of rodent-ridden, er... mouse-driven operation is available:

1) ctrl + p (Goto Anything)
2) <find existing file in the target dir>
3) enter
4) ctrl + n
5) ctrl + s

In 3), Sublime will change the working dir to point to the opened file's directory. It's faster than it may seem to be.
guillermooo
 
Posts: 729
Joined: Thu Jul 23, 2009 9:06 am

Re: Create a new file in a directory?

Postby pkulak on Thu Mar 10, 2011 9:44 pm

guillermooo wrote:You could do the following until that kind of rodent-ridden, er... mouse-driven operation is available:

1) ctrl + p (Goto Anything)
2) <find existing file in the target dir>
3) enter
4) ctrl + n
5) ctrl + s

In 3), Sublime will change the working dir to point to the opened file's directory. It's faster than it may seem to be.


Ah, I didn't notice that now when saving a new file I don't start at the root of the project. That must have changed, or somehow I was screwing it up before. Thank you.

I just have one more question, if you don't mind: now that I've got a file open after using Goto Anything, how do I reveal it in the project tree? I see reveal in finder, but that's it.
pkulak
 
Posts: 3
Joined: Thu Mar 10, 2011 7:17 pm

Re: Create a new file in a directory?

Postby guillermooo on Thu Mar 10, 2011 9:56 pm

pkulak wrote:I just have one more question, if you don't mind: now that I've got a file open after using Goto Anything, how do I reveal it in the project tree? I see reveal in finder, but that's it.


I don't quite understand what you mean by "reveal" here... Doesn't it show up for you in the sidebar (project tree)? Also, are you talking about the existing file you used to chdir, or the newly created file? If it's the latter, Sublime won't sync with the disk until you save.
guillermooo
 
Posts: 729
Joined: Thu Jul 23, 2009 9:06 am

Re: Create a new file in a directory?

Postby pkulak on Thu Mar 10, 2011 10:23 pm

guillermooo wrote:
pkulak wrote:I just have one more question, if you don't mind: now that I've got a file open after using Goto Anything, how do I reveal it in the project tree? I see reveal in finder, but that's it.


I don't quite understand what you mean by "reveal" here... Doesn't it show up for you in the sidebar (project tree)? Also, are you talking about the existing file you used to chdir, or the newly created file? If it's the latter, Sublime won't sync with the disk until you save.


No, if I open a file with Goto Anything I get the file open, but it doesn't open all it's parent directories and show me where it is in the project tree. That's totally the expected behavior, but sometimes I want to know where a file is just to get context, see the files near it, etc.
pkulak
 
Posts: 3
Joined: Thu Mar 10, 2011 7:17 pm

Re: Create a new file in a directory?

Postby guillermooo on Thu Mar 10, 2011 10:34 pm

I see... Yeah, I don't think that's possible with the sidebar. Sublime Text 1 used to let you control whether you'd look for dirs or base names in the QuickPanel (watered-down Goto Anything kind of thing). I used to find that extremely useful for exactly what you say.
guillermooo
 
Posts: 729
Joined: Thu Jul 23, 2009 9:06 am


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 32 guests