Thanks for the reply, please see comments below:
- 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:
test/small_files/long/path/myhtml_file.html
or
/short_path/myhtml_file.html
- 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 root.
I have to close TM and restart it to see files where they really are. Do you confirm?
- 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 instead?
The same happens when I am inside a .html file and the caret is placed into tags:
<style type="text/css" media="screen"> color: </style>
- 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!
-- Ciao
Fabio
-- 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
Sponsor: 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
On 15.09.2009, at 15:59, Fabio wrote:
- 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?
[...] 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:
test/small_files/long/path/myhtml_file.html
or
/short_path/myhtml_file.html
OK, then you can duplicate the HTML bundle drag command "Insert Image With Dimension" and rewrite it to your need. (Please have a look at manual chapter 11 'Drag Commands')
- 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.
Yes, this is known issue, but there's no need to restart TM. Simply activate any other app like the Finder and re-activate TM. This can be done automatically via AppleScript eg; or one could write a command which duplicates the selected file, set the focus to Finder, set focus to TM.
- 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?
[...] 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 instead?
NOT: CTRL + SHIFT + C! Please use SHIFT+APPLE+C instead. As I said TM doesn't listen to CTRL + SHIFT + C.
- A little "bug" with file tabs
In addition ^?R will select the current doc in the drawer.
[...] that is ok, but is always a patch to the wrong (in my opinion) behaviour of TM with not visible tabs.
By myself I seldom click on a tab to select a file. Instead I'm using the short-cut APPLE+1..9 for selecting one of the nine tabs (have a look at Main Menu > Navigation > Go to Tab) and the title bar tells me the current file name I'm working on. And more often I'm using APPLE+T "Go to file".
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.
Hmm, never did that before - by myself I select the folder before I create a new file - but I could reproduce it. I got a "ghost file" of the same name if I chose an other folder. weird.
Ciao,
--Hans