IIRC it used to be that when you said File > New what you got was a file with the same extension as the currently selected file (e.g. in the project navigator). Now, however, what you get is always a ".txt" file. I wonder if that feature was just something I dreamed and, if not, whether it might return; it was mighty convenient. m.
-- matt neuburg, phd = http://www.apeth.net/matt/ pantes anthropoi tou eidenai oregontai phusei Programming iOS 7! http://shop.oreilly.com/product/0636920031017.do iOS 7 Fundamentals! http://shop.oreilly.com/product/0636920032465.do RubyFrontier! http://www.apeth.com/RubyFrontierDocs/default.html
You need to set a scope in fileType for attr.untitled in .tmp_properties (where else)
I have the following which sets files as kohana 2 php file unless it's in a templates dir where it ends up as a mustache file
[ attr.untitled ] fileType = 'text.html.php.ko2'
[ "templates/{**/,}*" attr.untitled ] fileType = 'text.html.mustache'
On Wed, Nov 19, 2014 at 12:01 AM, Matt Neuburg matt@tidbits.com wrote:
IIRC it used to be that when you said File > New what you got was a file with the same extension as the currently selected file (e.g. in the project navigator). Now, however, what you get is always a ".txt" file. I wonder if that feature was just something I dreamed and, if not, whether it might return; it was mighty convenient. m.
-- matt neuburg, phd = http://www.apeth.net/matt/ pantes anthropoi tou eidenai oregontai phusei Programming iOS 7! http://shop.oreilly.com/product/0636920031017.do iOS 7 Fundamentals! http://shop.oreilly.com/product/0636920032465.do RubyFrontier! http://www.apeth.com/RubyFrontierDocs/default.html
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
On Nov 19, 2014, at 2:37 AM, George McGinley Smith george@gsgd.co.uk wrote:
You need to set a scope in fileType for attr.untitled in .tmp_properties
It isn't a scope problem. It's the name of the file itself. I want it to end in .asciidoc and it offers to end in .txt instead. m.
-- matt neuburg, phd = http://www.apeth.net/matt/ pantes anthropoi tou eidenai oregontai phusei Programming iOS 7! http://shop.oreilly.com/product/0636920031017.do iOS 7 Fundamentals! http://shop.oreilly.com/product/0636920032465.do RubyFrontier! http://www.apeth.com/RubyFrontierDocs/default.html
On 19 Nov 2014, at 21:11, Matt Neuburg wrote:
On Nov 19, 2014, at 2:37 AM, George McGinley Smith george@gsgd.co.uk wrote:
You need to set a scope in fileType for attr.untitled in .tmp_properties
It isn't a scope problem. It's the name of the file itself. I want it to end in .asciidoc and it offers to end in .txt instead. m.
I think you misunderstood the options here.
So, if you go to Preferences → Files and set New Document Type to AsciiDoc then all new files default to *.asciidoc (after ⌘N + ⌘S).
Alternatively, you can create ~/MyAsciiDocProjects/.tm_properties and in that file place this:
[ attr.untitled ] fileType = 'text.asciidoc'
Now when you have a project open under ~/MyAsciiDocProjects and use either ⌥⌘N (New Tab) or ⌃⌘N (New File in file browser) it will default to *.asciidoc — but outside that folder, it’ll still use the file type specified in Preferences → Files → New Document Type.
On Nov 19, 2014, at 12:49 PM, Allan Odgaard mailinglist@textmate.org wrote:
Alternatively, you can create ~/MyAsciiDocProjects/.tm_properties and in that file place this:
[ attr.untitled ] fileType = 'text.asciidoc'
But I don't understand how you make the leap from "this is the type of the file" (using some sort of scope) to "this is the extension that new file names should have". I don't see anything there about a file extension, which is what I'm after. m.
-- matt neuburg, phd = http://www.apeth.net/matt/ pantes anthropoi tou eidenai oregontai phusei Programming iOS 7! http://shop.oreilly.com/product/0636920031017.do iOS 7 Fundamentals! http://shop.oreilly.com/product/0636920032465.do RubyFrontier! http://www.apeth.com/RubyFrontierDocs/default.html
On 20 Nov 2014, at 2:44, Matt Neuburg wrote:
But I don't understand how you make the leap from "this is the type of the file" (using some sort of scope) to "this is the extension that new file names should have". I don't see anything there about a file extension, which is what I'm after. m.
When you set the file type to `text.asciidoc` then TextMate will use the first extension listed in the grammar for that scope (which should be `asciidoc`) when saving (and there isn’t already a name asssociated with the document).
On 18 Nov 2014, at 23:01, Matt Neuburg wrote:
IIRC it used to be that when you said File > New what you got was a file with the same extension as the currently selected file (e.g. in the project navigator). Now, however, what you get is always a ".txt" file. I wonder if that feature was just something I dreamed and, if not, whether it might return; it was mighty convenient. m.
I think you dreamt it up. It’s not entirely clear where the file type should be taken from (on ⌘N) nor if this is always desired (that it uses whatever file type it can grab from existing window). But I’m open for making it smarter than now.
As George mentioned, it is possible to set the default file type for new files. Unless you want to change it for different folders, I recommend setting it via Preferences → Files instead of .tm_properties: This is just because everything set via the UI we can better control and it’s easier for a user to later discover what the value is set to.
On Nov 19, 2014, at 3:43 AM, Allan Odgaard mailinglist@textmate.org wrote:
Unless you want to change it for different folders
Well, I think I do. When I'm working on an AsciiDoc project, I want AsciiDoc files. When I'm working on a Ruby project, I want Ruby files.
You don't have this issue? You work on and generate a lot of different kinds of files. The file-creation interface doesn't bother you a little? m.
-- matt neuburg, phd = http://www.apeth.net/matt/ pantes anthropoi tou eidenai oregontai phusei Programming iOS 7! http://shop.oreilly.com/product/0636920031017.do iOS 7 Fundamentals! http://shop.oreilly.com/product/0636920032465.do RubyFrontier! http://www.apeth.com/RubyFrontierDocs/default.html
On 19 Nov 2014, at 12:43, Allan Odgaard mailinglist@textmate.org wrote:
On 18 Nov 2014, at 23:01, Matt Neuburg wrote:
IIRC it used to be that when you said File > New what you got was a file with the same extension as the currently selected file (e.g. in the project navigator). Now, however, what you get is always a ".txt" file. I wonder if that feature was just something I dreamed and, if not, whether it might return; it was mighty convenient. m.
I think you dreamt it up. It’s not entirely clear where the file type should be taken from (on ⌘N) nor if this is always desired (that it uses whatever file type it can grab from existing window). But I’m open for making it smarter than now.
As George mentioned, it is possible to set the default file type for new files. Unless you want to change it for different folders, I recommend setting it via Preferences → Files
For my markdown files I used the above recommended Preferences → Files method. It resulted in new files with a .mdown suffix. How do I change it to get the .md suffix, the suffix I use for my markdown files?
instead of .tm_properties: This is just because everything set via the UI we can better control and it’s easier for a user to later discover what the value is set to.
Bert Fitié
On 20 Nov 2014, at 9:13, Bert Fitié wrote:
[…] For my markdown files I used the above recommended Preferences → Files method. It resulted in new files with a .mdown suffix. How do I change it to get the .md suffix, the suffix I use for my markdown files?
Sounds like you have an outdated Markdown bundle: https://github.com/textmate/markdown.tmbundle/commit/baa7f0b3eab2c0b98efa06e...
https://github.com/textmate/textmate/wiki/Reverting-To-Defaults
Btw I remember that feature too, in fact that's why I initially reimplemented it in avian-missing.tmbundle https://github.com/elia/avian-missing.tmbundle/tree/1c6283ceba44a0ac380a565c45153f3703e75846#n-new-file, what happened was more or less the following:
After hitting the new file key equivalent a dialog was presented:
- it has the base-name selected (ready to be overwritten) - it had the same extension as the current file set - the folder of the current file was selected
I then removed it https://github.com/elia/avian-missing.tmbundle/commit/bdc9240388bd56f1978feaae99c424d95c92706b when ⇧⌘N was introduced creating the file directly in the filebrowser and letting me change the name*. But it never was on par with its predecessor and also has that nasty rewrite-as-you-type bug that people reports from time to time.
* also it was relying on assistive devices and applescript and had a few limitations
Elia
📢 twitter/elia http://twitter.com/elia ☕️ github/elia http://github.com/elia
On Thu, Nov 20, 2014 at 9:25 AM, Allan Odgaard mailinglist@textmate.org wrote:
On 20 Nov 2014, at 9:13, Bert Fitié wrote:
[…] For my markdown files I used the above recommended Preferences →
Files method. It resulted in new files with a .mdown suffix. How do I change it to get the .md suffix, the suffix I use for my markdown files?
Sounds like you have an outdated Markdown bundle: https://github.com/textmate/markdown.tmbundle/commit/ baa7f0b3eab2c0b98efa06e1dbd7941f3ecbf227
https://github.com/textmate/textmate/wiki/Reverting-To-Defaults
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate