From fauzzo@email.it Tue Sep 15 13:59:37 2009 From: Fabio To: textmate@lists.macromates.com Subject: [TxMt] Re: How to do basic things with files and project drawer Date: Tue, 15 Sep 2009 15:59:34 +0200 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8969508444801445263==" --===============8969508444801445263== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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 =20 > 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 =20 like "/img/file_name.gif" instead of TM way: "../../img/file =20 name.gif", they both normally work yes, but when you are using apache =20 mod_rewrite or when, later, you want to move the file somewhere in =20 other directories, by using default TM path you should address all =20 paths to the new location (or mod_rewrite path). By using the "absolute relative path" like "/img/image.gif" the image =20 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 >> 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 =20 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 =20 seems to be only a display problem of TM project drawer. For Exemple, if open a file called "menu.html" that is placed inside /=20 models/menu.html, and then I choose "Save As..." and select /test.html =20 as the new saving location and name, Project Drawer will show me a =20 file called "test.html" placed into /models and no file in the project =20 root. I have to close TM and restart it to see files where they really are. =20 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 " > 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) =20 behaviour of TM with not visible tabs. In DW CS3 for example, active tab is always displayed in tabs list. In =20 TM you need to see tab even if you want o drag the file tab near to =20 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 "/=20 models" and file name to "test.html", sometimes I see the new file =20 placed at the end of the list at the same level of the project root. =20 Sometimes I will see the file twice: once inside "models" directory =20 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 =20 (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 =20 problem with PD tree. That is very strange and is confusing me. Thanks for the help! -- Ciao Fabio =20 =20 -- Caselle da 1GB, trasmetti allegati fino a 3GB e in piu' IMAP, POP3 e SMTP au= tenticato? GRATIS solo con Email.it http://www.email.it/f =20 Sponsor: Last Minute a Riccione. Scopri le offerte su vacanzedivertenti.it =20 * Buona Vacanza! Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=3D9525&d=3D15-9 --===============8969508444801445263==-- From bibiko@eva.mpg.de Tue Sep 15 15:03:51 2009 From: =?utf-8?q?Hans-J=C3=B6rg?= Bibiko To: textmate@lists.macromates.com Subject: [TxMt] Re: How to do basic things with files and project drawer Date: Tue, 15 Sep 2009 17:03:43 +0200 Message-ID: <298FF63C-B86D-44A1-815E-BC9CF2AE2C38@eva.mpg.de> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0103909697205433343==" --===============0103909697205433343== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On 15.09.2009, at 15:59, Fabio wrote: >>> 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? > > [...] 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') >>> 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. 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. >>> 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? >> > [...] > 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. >> 4. 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 --===============0103909697205433343==--