This step is going to require something more than just dragging an element over, as we are now going to mix some Automator with some bash to get the job done. Step 2: Open the selected item in TextMate. Now drag this bar into the workflow area. You can find this block by typing "Get Selected Finder Items" in the search bar or by searching the Library for Applications > Finder. The first thing that we need to do is get our selected Finder item, our directory that we want to open. To accomplish our task, we need two of these building blocks. Automator allows you to create quick scripts by giving you a building-block approach for common things you might like to do. Using some knowledge of Automator, this can be done quite easily. When I'm using Finder to navigate my filesystem, I sometimes want to open a directory into TextMate from Finder, and a contextual menu would be perfect. I love being able to load in a directory as a project, like I do with a lot of my rails applications. This post only scratches the surface of the power of bundles - check out the TextMate manual entry and the TextMate wiki for more information.Opening a directory in TextMate from Finder Sunday, September 17, 2006 If you’d like to check your newly created bundle into version control, or distribute it to someone else, you can find the actual bundle package in ~/Library/Application Support/TextMate/Bundles/. Once you’ve done this, the bundle should be available in the Bundles list, and your command is ready to use. Once you’re satisfied with your command, go to Bundles -> Bundle Editor -> Reload Bundles to activate it : The final line doesn’t have this backslash, so when TextMate hits the end of this line, it knows it’s time to finish. the “" character simply tells TextMate that the command isn’t finished yet, and to jump to the next line. The “|” character tells TextMate to pipe the output of each function into the next one. Inside the command editor, the commands are actually piped into each other using “| " : The sed command above replaces closing tags with their pygments equivalents. Let’s have a quick look at how each of these commands work : Commands are basically just shell scripts that TextMate runs, so anything you can do in a terminal you can probably do in a TextMate command.ĭelete this place-holder text, and add your custom shell command instead. The Edit Command window will be pre-populated with an example command. With your new bundle highlighted, click the + button at the bottom left once again, and select New Command.Ī new command will be created within your bundle - once again, choose a name for it. Decide what you want to call it, and enter the name. Go to Bundles -> Bundle Editor -> Show Bundle Editor, which will launch the editor window.Ĭlick the + button at the bottom left of the window, and select New Bundle.Ī new bundle will be created in the list. This seems like a good candidate for automation, so let’s get started! These changes were to support the Pygments syntax highlighter used by Jekyll, and to add a custom jekyll plugin (ext_link) to format external links. Recently I’ve been migrating a bunch of blog posts from WordPress to Jekyll, and found myself repeating the same tasks again and again : If you find yourself repeating the same commands over and over in TextMate, it’s relatively straightforward to create your own bundle.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |