Hi there, This may be a bit of a newbish question, but hopefully someone can answer it for me.
I have quite a few JSP files, but a couple of them contain almost solely CSS information (with some serverside info sprinkled in).
So, of course, I'd like those couple of files to be highlighted as CSS files, with the CSS bundle to be active for those files.
However, the issue I am running into is that whenever I select the language for that file, it sticks for all JSPs.
So what would be the best way to get those few files to be read as CSS, but keeping their same file names, etc?
Thanks in advance for all of your help,
Use the bottom menu and select the language you want (in this case css), or you you can press ⌃⌥⇧C which will select css or give you a popup menu where you can select parse as css, which will also make the css bundle's commands take priority. ph
On Jan 5, 2008, at 6:46 AM, Nate Cavanaugh wrote:
Hi there, This may be a bit of a newbish question, but hopefully someone can answer it for me.
I have quite a few JSP files, but a couple of them contain almost solely CSS information (with some serverside info sprinkled in).
So, of course, I'd like those couple of files to be highlighted as CSS files, with the CSS bundle to be active for those files.
However, the issue I am running into is that whenever I select the language for that file, it sticks for all JSPs.
So what would be the best way to get those few files to be read as CSS, but keeping their same file names, etc?
Thanks in advance for all of your help,
View this message in context: http://www.nabble.com/Changing-language-for-a-specific-file-tp14630274p14630... Sent from the textmate users mailing list archive at Nabble.com.
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
Hi there, Thanks for that, however, I am already doing that. The problem is that this change is now stuck for all JSP files, and everytime I need to use one or the other I have to keep switching the language back and forth. I guess what I am asking is, is there a way to set those few specific files to use CSS and the rest to use JSP automatically, so that every time I open them I don't have to manually switch?
Thanks again for your help :)
Peter Haza wrote:
Use the bottom menu and select the language you want (in this case css), or you you can press ⌃⌥⇧C which will select css or give you a popup menu where you can select parse as css, which will also make the css bundle's commands take priority. ph
On Jan 5, 2008, at 6:46 AM, Nate Cavanaugh wrote:
Hi there, This may be a bit of a newbish question, but hopefully someone can answer it for me.
I have quite a few JSP files, but a couple of them contain almost solely CSS information (with some serverside info sprinkled in).
So, of course, I'd like those couple of files to be highlighted as CSS files, with the CSS bundle to be active for those files.
However, the issue I am running into is that whenever I select the language for that file, it sticks for all JSPs.
So what would be the best way to get those few files to be read as CSS, but keeping their same file names, etc?
Thanks in advance for all of your help,
View this message in context: http://www.nabble.com/Changing-language-for-a-specific-file-tp14630274p14630... Sent from the textmate users mailing list archive at Nabble.com.
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
On 05.01.2008, at 20:36, Nate Cavanaugh wrote:
Hi there, Thanks for that, however, I am already doing that. The problem is that this change is now stuck for all JSP files, and everytime I need to use one or the other I have to keep switching the language back and forth. I guess what I am asking is, is there a way to set those few specific files to use CSS and the rest to use JSP automatically, so that every time I open them I don't have to manually switch?
Håkan Waara wrote the plugin TabMate which does this exactly on basis of a modeline inside of a document specifying TABSIZE, language, etc.
Unfortunately the link to that plugin is broken. Hopefully Håkan reads this.
If not, has someone a copy of it? Otherwise we can try to rewrite it.
On the other hand, I believe that Allan mentioned something in this list to support such things in TM 2.0.
--Hans
Thanks Hans, That's much appreciated info. If someone does have tabmate, that would be awesome. I was trying to find it, to no avail.
BTW, is there any sort of guestamation when TM 2 will be coming out? I am dying for the FTP features. Of course, I'd rather have it as great as possible, but if I have a general date to hope for, that will at least make the anxiety of waiting all the more easy to bear :)
Hans-Jörg Bibiko wrote:
On 05.01.2008, at 20:36, Nate Cavanaugh wrote:
Hi there, Thanks for that, however, I am already doing that. The problem is that this change is now stuck for all JSP files, and everytime I need to use one or the other I have to keep switching the language back and forth. I guess what I am asking is, is there a way to set those few specific files to use CSS and the rest to use JSP automatically, so that every time I open them I don't have to manually switch?
Håkan Waara wrote the plugin TabMate which does this exactly on basis of a modeline inside of a document specifying TABSIZE, language, etc.
Unfortunately the link to that plugin is broken. Hopefully Håkan reads this.
If not, has someone a copy of it? Otherwise we can try to rewrite it.
On the other hand, I believe that Allan mentioned something in this list to support such things in TM 2.0.
--Hans ______________________________________________________________________ For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
Nate Cavanaugh wrote:
Thanks Hans, That's much appreciated info. If someone does have tabmate, that would be awesome. I was trying to find it, to no avail.
As of this very moment I can get to the TabMate page at http://konstochvanligasaker.se/tabmate/, even though the entry on the blog says the link is broken. Give it another shot, and if it still doesn't work let me know and I can email the ZIP file to you (it's only 84K). The source code is another 150K.
I could also attach the ZIP to a message to this list, if that's not considered rude.
Thanks for all the help guys, it's much appreciated.
Quick question, do you know if this is possible with TabMate *without* modelines? I'm working on a huge code base with multiple users and strict coding standards and the modelines aren't allowed to sit in SVN, which means I have to copy the mode lines every time I edit the file, in which case, I might as well just manually change the language.
Anyone know of a work around (even if it's a work around in SVN)?
Hans-Jörg Bibiko wrote:
On 05.01.2008, at 20:36, Nate Cavanaugh wrote:
Hi there, Thanks for that, however, I am already doing that. The problem is that this change is now stuck for all JSP files, and everytime I need to use one or the other I have to keep switching the language back and forth. I guess what I am asking is, is there a way to set those few specific files to use CSS and the rest to use JSP automatically, so that every time I open them I don't have to manually switch?
Håkan Waara wrote the plugin TabMate which does this exactly on basis of a modeline inside of a document specifying TABSIZE, language, etc.
Unfortunately the link to that plugin is broken. Hopefully Håkan reads this.
If not, has someone a copy of it? Otherwise we can try to rewrite it.
On the other hand, I believe that Allan mentioned something in this list to support such things in TM 2.0.
--Hans ______________________________________________________________________ For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
On Jan 8, 2008, at 1:38 PM, Nate Cavanaugh wrote:
Thanks for all the help guys, it's much appreciated.
Quick question, do you know if this is possible with TabMate *without* modelines? I'm working on a huge code base with multiple users and strict coding standards and the modelines aren't allowed to sit in SVN, which means I have to copy the mode lines every time I edit the file, in which case, I might as well just manually change the language.
Anyone know of a work around (even if it's a work around in SVN)?
AFAIK, the only options are: change it every time you open the file. Use tabmate with modelines. Change the file extension. Or change the language syntaxes to support that file extension.
I had to do exactly that a few times and I eventually resorted to just changing it each time I opened the file. The trick is to open in in a new window and then change it, that way it doesn't effect your other open files syntax pref when switching project tabs.
—Thomas Aylott – subtleGradient—
On 8 Jan 2008, at 21:57, Thomas Aylott - subtleGradient wrote:
On Jan 8, 2008, at 1:38 PM, Nate Cavanaugh wrote:
Quick question, do you know if this is possible with TabMate *without* modelines? I'm working on a huge code base with multiple users and strict coding standards and the modelines aren't allowed to sit in SVN, which means I have to copy the mode lines every time I edit the file, in which case, I might as well just manually change the language.
Anyone know of a work around (even if it's a work around in SVN)?
AFAIK, the only options are: change it every time you open the file. Use tabmate with modelines. Change the file extension. Or change the language syntaxes to support that file extension.
The last option would be the most elegant way.
For private usage one could also do this with the plugin TMTOOLS http://email.eva.mpg.de/~bibiko/downloads/textmate/
write a simple command "Open as CSS" bound to any key equivalent à la:
"$TMTOOLS" show openPanel "$TMTOOLS" set grammar '{to="CSS";}'
or
a command "Set grammar to CSS" "$TMTOOLS" set grammar '{to="CSS";}'
Thus you only have to press one single key.
If you have many files like that one also could think about to maintain a file containing file names and grammar like
header.jsp TAB css script.jsp TAB JavaScript ...
and use "$TMTOOLS" show openPanel followed by a script which parses that file and sets the according grammar.
Furthermore to maintain that file easily one can write a command "Remember Grammar" and make usage of: GRAM=$("$TMTOOLS" get currentGrammar) echo "$TM_FILENAME $GRAM" >> myFILEwithGRAMMARS
--Hans
On 8 Jan 2008, at 19:38, Nate Cavanaugh wrote:
[...] Quick question, do you know if this is possible with TabMate *without* modelines? I'm working on a huge code base with multiple users and strict coding standards and the modelines aren't allowed to sit in SVN, which means I have to copy the mode lines every time I edit the file, in which case, I might as well just manually change the language.
Anyone know of a work around (even if it's a work around in SVN)?
TextMate will get the file type either from the first line of the file or the extension. The recommended solution is to use double-extensions when it is important that different file types have the same “final” extension, e.g. “foo.css.php”, “foo.js.php”, “foo.php” -- here all files are php, but TextMate can assign different grammars to them based on the secondary extension.
Hi Alan, Thanks for the reply, but I'm now trying to get this to work, and for some reason, it's still treating each of the files identically.
Is there some special method for changing the language that I should be using?
For instance, I have css_cached.jsp. I copied that file and have css_cached.css.jsp. Whenever I change the language type it does it for all jsp's, like before.
Any suggestions?
Thanks Alan,
Allan Odgaard-3 wrote:
On 8 Jan 2008, at 19:38, Nate Cavanaugh wrote:
[...] Quick question, do you know if this is possible with TabMate *without* modelines? I'm working on a huge code base with multiple users and strict coding standards and the modelines aren't allowed to sit in SVN, which means I have to copy the mode lines every time I edit the file, in which case, I might as well just manually change the language.
Anyone know of a work around (even if it's a work around in SVN)?
TextMate will get the file type either from the first line of the file or the extension. The recommended solution is to use double-extensions when it is important that different file types have the same “final” extension, e.g. “foo.css.php”, “foo.js.php”, “foo.php” -- here all files are php, but TextMate can assign different grammars to them based on the secondary extension.
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
On 11 Feb 2008, at 21:46, Nate Cavanaugh wrote:
Thanks for the reply, but I'm now trying to get this to work, and for some reason, it's still treating each of the files identically.
Is there some special method for changing the language that I should be using?
For instance, I have css_cached.jsp. I copied that file and have css_cached.css.jsp. Whenever I change the language type it does it for all jsp's, like before.
Any suggestions?
If you use double-extensions, you will need to edit the fileTypes array in the grammar, as TM is not smart enough to automatically learn about these.
See e.g. http://blog.macromates.com/2007/file-type-detection-rspec-rails/
Allan Odgaard-3 wrote:
On 8 Jan 2008, at 19:38, Nate Cavanaugh wrote:
[...] Quick question, do you know if this is possible with TabMate *without* modelines? I'm working on a huge code base with multiple users and strict coding standards and the modelines aren't allowed to sit in SVN, which means I have to copy the mode lines every time I edit the file, in which case, I might as well just manually change the language.
Anyone know of a work around (even if it's a work around in SVN)?
TextMate will get the file type either from the first line of the file or the extension. The recommended solution is to use double- extensions when it is important that different file types have the same “final” extension, e.g. “foo.css.php”, “foo.js.php”, “foo.php” -- here all files are php, but TextMate can assign different grammars to them based on the secondary extension.
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
-- View this message in context: http://www.nabble.com/Changing-language-for-a-specific-file-tp14630274p15420... Sent from the textmate users mailing list archive at Nabble.com.
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
On 2/12/08, Allan Odgaard throw-away-2@macromates.com wrote:
If you use double-extensions, you will need to edit the fileTypes array in the grammar, as TM is not smart enough to automatically learn about these.
See e.g. http://blog.macromates.com/2007/file-type-detection-rspec-rails/
Allan, thanks for pointing out this article. I've just tuned things up a bit, including adding builder as a suffix for ruby-on-rails.
I'm thinking though that I'm going to have to keep on top of this, since it seems that whenever the ruby bundle get's updated it's going to add the rb suffix back to it's language definition.
Any thoughts towards either:
1. Allow some precedence to be set between bundle language definition, so that you could set up the ruby-on-rails bundle to take precedence over the ruby bundle when determining the language. 2. Making the language selection project specific, so that I could set a project to be either a ruby or ruby on rails project 3. Really inventing here. Somehow 'automatically' detect the type of project from it's contents. For example you might detect a rails project for looking for one or more telltale files like script/generate and/or config/environment.rb or config/routes.rb Of course this would have to be specifiable in the bundle/language description, rather than being hardcoded into TM.
On 13 Feb 2008, at 14:16, Rick DeNatale wrote:
[...] I'm thinking though that I'm going to have to keep on top of this, since it seems that whenever the ruby bundle get's updated it's going to add the rb suffix back to it's language definition.
No, a delta file is stored under ~/Library with just your updated fileTypes array.
Any thoughts towards either:
[...] Somehow 'automatically' detect the type of project from it's contents [...]
Yes, there are thoughts toward that ;)