[TxMt] Re: How to do basic things with files and project drawer

Fabio fauzzo at email.it
Tue Sep 15 13:59:34 UTC 2009

Thanks for the reply, please see comments below:

>> 1. New Project
>> [...]
>> The question: is there any way to have the paths set from my "root"
>> element?
>> For example if I drag an image that is placed into /myroot/img/ the
>> html file that gets it uses a src link like "../../img/image.gif". Is
>> it possible to have "/img/image.gif" instead?
> I do not quite understand. But if you drag eg an image from the  
> drawer/
> Finder to an HTML document TextMate will insert the relative path seen
> from that HTML document, this ensures that the HTML doc can see the
> image file later on.

I mean that I usually prefer to set all my image paths to something  
like "/img/file_name.gif" instead of TM way: "../../img/file  
name.gif", they both normally work yes, but when you are using apache  
mod_rewrite or when, later, you want to move the file somewhere in  
other directories, by using default TM path you should address all  
paths to the new location (or mod_rewrite path).
By using the "absolute relative path" like "/img/image.gif" the image  
will always work even if you move the file into a directory like:




>> 2. Project Drawer and new files in project
>> How can I create a new file or duplicate an existing one?
> If you did select the file in question simply press ??S (Save As)
> to duplicate it.

That is what I usually do, but with the problem that Project Drawer is  
not correctly updated: the old file disappears from PD tree.
I have to restart TM to see it again. It is always there anyway, it  
seems to be only a display problem of TM project drawer.

For Exemple, if open a file called "menu.html" that is placed inside / 
models/menu.html, and then I choose "Save As..." and select /test.html  
as the new saving location and name, Project Drawer will show me a  
file called "test.html" placed into /models and no file in the project  

I have to close TM and restart it to see files where they really are.  
Do you confirm?

>> 3. While I editing CSS or HTML files, sometimes I need the color
>> chooser, the default keys CTRL + SHIFT + C do not open it. That keys
>> seems to be used by the default Math bundle. Is the solution to
>> manually change such keys in Math bundle? Why TM provides such
>> overlapping keys?
> TextMate doesn't listen on the ?^C, thus deleting that short-cut in
> the Math bundle won't work.
> If you're inside a CSS doc or inside a CSS scope (ie if your caret in
> inside of "<style type="text/css">?</script> of an HTML file) press
> ??C. From others ^? > CSS > Insert Color?

correct, but when I have an open file like could be "test.css" and CSS  
language is associated to such file, if I am creating a rule and I hit  
[ CTRL + SHIFT + C ] why it does not open color picker but Math bundle  

The same happens when I am inside a .html file and the caret is placed  
into tags:

<style type="text/css" media="screen">

> 4. A little "bug" with file tabs
> In addition ^?R will select the current doc in the drawer.
> If you need your own way to display the name simply create a new
> tmcommand in the bundle editor:
> Input: Discard:
> Output: Show as Tooltip
> Command:
> echo "$TM_FILEPATH"
> and bind it to any short-cut.

that is ok, but is always a patch to the wrong (in my opinion)  
behaviour of TM with not visible tabs.
In DW CS3 for example, active tab is always displayed in tabs list. In  
TM you need to see tab even if you want o drag the file tab near to  
another for faster select. But you can't do that at the moment.

>> And I don't understand where TM places the new file if no
>> directory is selected.
> If you press ??N (New File) you will see a dialog with a field
> called ?Location?. This will be the place you're looking for.

correct, but like before Project Drawer tree seems buggy:

If I create a new file with SHIFT + CMD + N, and I set location to "/ 
models" and file name to "test.html", sometimes I see the new file  
placed at the end of the list at the same level of the project root.  
Sometimes I will see the file twice: once inside "models" directory  
and also at the end of the list, out of models directory.
If I restart TM, the files listing in project drawer remains the same  
(double file) and I cannot understand why.
If I want to delete it, I have to delete both files from Project Drawer.
In the finder the file is placed correctly, but again there is a  
problem with PD tree.

That is very strange and is confusing me.

Thanks for the help!



 Caselle da 1GB, trasmetti allegati fino a 3GB e in piu' IMAP, POP3 e SMTP autenticato? GRATIS solo con Email.it http://www.email.it/f
 Last Minute a Riccione. Scopri le offerte su vacanzedivertenti.it  
* Buona Vacanza!
 Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=9525&d=15-9

More information about the textmate mailing list