Let me start by saying that I couldn't live without TextMate...it's the one program that made my switch from the Windows world (a year and counting! :) ) permanent. I have just a couple of issues I am looking for guidance on however.
Firstly, when building Wordpress themes for clients, I generally start with three files, for which I have my own custom TextMate templates. I was wondering if there is a way to automatically create these three files (with correct filenames if possible) from my templates. Ideally, this would be bound to a keystroke string (command-shift-N would be nice, since the muscle memory is already there for that string), but mousing it from the menu would work too.
I had first thought of using a macro, but apparently, you can't use a macro to create a new file.
Second, the keyboard shortcut for Save As stopped working some time ago. I thought it might be an issue with a buggy install of Tiger, but even after upgrading to Leopard (via a clean install), I still don't have the ability to use the keyboard shortcut. I'm pretty sure it's not a conflict with the keystroke string being redefined by a bundle or anything (I've gone through all the bundles I have active, and nothing is using it), so I'm at a loss.
Any ideas?
Thanks, Keith
On 26 Aug 2008, at 14:21, Keith Solomon wrote:
Let me start by saying that I couldn't live without TextMate...it's the one program that made my switch from the Windows world (a year and counting! :) ) permanent. I have just a couple of issues I am looking for guidance on however.
Firstly, when building Wordpress themes for clients, I generally start with three files, for which I have my own custom TextMate templates. I was wondering if there is a way to automatically create these three files (with correct filenames if possible) from my templates.
not a direct solution, but I've been using SVN for this.
I have a repository containing my default files and file structure. (for a web site)
I export it to a 'new project' folder, tweak filenames if necessary (this becomes my upload copy location), then create a repository for the project, import the upload copy and checkout a working copy to my dev environment. This is the editable 'files under version control' - I then drag this folder to TM, save as a project and start work.
edits are committed as appropriate and uploadable copies of the files are exported from the repository to the 'live' version folder.
On 26.08.2008, at 15:21, Keith Solomon wrote:
Firstly, when building Wordpress themes for clients, I generally start with three files, for which I have my own custom TextMate templates. I was wondering if there is a way to automatically create these three files (with correct filenames if possible) from my templates. Ideally, this would be bound to a keystroke string (command-shift-N would be nice, since the muscle memory is already there for that string), but mousing it from the menu would work too.
It is possible to open more than files or a entire project by using TM's templates. Look at the attachment.
--Hans
On 26.08.2008, at 17:08, Keith Solomon wrote:
Interesting...
The only problem (for me anyway) is getting the new files to open in a project. Generally, my workflow is: create new folder in my dev directory for the new theme. open folder in TM as a project (via a Finder button, but that shouldn't matter I don't think). create three base files for theme. Using the template you sent, TM just opens three new windows, separate from the project created in 2.
Maybe try this approach:
generate all template file and store them in tmTemplate; then copy them structured to a new folder; and mate that folder:
Cheers,
--Hans
On 26 Aug 2008, at 15:21, Keith Solomon wrote:
[...] Firstly, when building Wordpress themes for clients, I generally start with three files, for which I have my own custom TextMate templates. I was wondering if there is a way to automatically create these three files (with correct filenames if possible) from my templates. [...]
Since templates are just commands, converting them to a real (TextMate) command will make this much simpler.
There is (sort of) an example of this in the Xcode bundle (New Project Using Xcode Template). It creates a project (folder with files) based on an Xcode template and then simply open that folder in TextMate (which makes it open as a project).
Second, the keyboard shortcut for Save As stopped working some time ago. [...] I'm pretty sure it's not a conflict with the keystroke string being redefined by a bundle or anything [...]
It’s the most likely explanation though. See http://wiki.macromates.com/Troubleshooting/KeyBindings for how to debug further, and if that fails, check if it is local (http://wiki.macromates.com/Troubleshooting/101 ).
Allan Odgaard wrote:
Since templates are just commands, converting them to a real (TextMate) command will make this much simpler.
There is (sort of) an example of this in the Xcode bundle (New Project Using Xcode Template). It creates a project (folder with files) based on an Xcode template and then simply open that folder in TextMate (which makes it open as a project).
Ok, I have no idea what's going on there! :) I know nothing of Ruby...
It’s the most likely explanation though. See http://wiki.macromates.com/Troubleshooting/KeyBindings for how to debug further, and if that fails, check if it is local (http://wiki.macromates.com/Troubleshooting/101 ).
Occam's Razor FTW! Wouldn't you know, it was in the only bundle I didn't look at when I did my sweep...and I had no idea you could search for a bundle item by keystroke... :)
Thanks again for writing such a great app! Keith